Results 1 to 18 of 18

Thread: Asm and VB

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    62
    Is it possible to write a loop function in asm and then use the obj file in a vb program?

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    You can write standard dlls in ASM using something like MASM or PASS32, then use a declare Statement and use the function in VB, if you have a C++ compiler you can set up a dll using that and just use inline ASM inside the function.

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    62
    But can use do this with the obj files? A dll is alot slower isn't it?

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    the first time you use a dll in an instance of your application it has to load, but that's nothing compared to how long a VB app takes to load anyway, after that it's just a far call to your procedures.

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I thought with 32bit programming there was no more near/far messing around?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    you don't have to, nowadays you just use far calls, but you can still use near calls for backward compatibility, it's still a far call though, it's just that near calls aren't used anymore.

    I think anyway, or maybe I'm just making it up as I go along.

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    62
    What are far and near calls?

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    I think...

    They're left from 16bit programming. The memory address was split into a segment:offset address. A near call was one inside your current code segment. A far call was one to a different segment.

    Trust me, you don't want to play around with those .

    (Sam...if this is wrong let me know )
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    62
    So it originated from asm but dosen't apply anymore to VB or C++? Does it have something to do with RAM memory locations as in c or asm?

  10. #10
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Parksie's actually right, in most asm compilers you don't have to worry about them, because you very rarely actually type in a memory address, if you're passing parameters on the stack (like windows does) to your own functions then you need to know which one it is to get at your parameters.

    they are still used in 32bit programming, but unless you're coding in binary (which I am unfortunatley) you don't have to worry.

    Near and far procedures are described here
    http://burks.bton.ac.uk/burks/langua...m#HEADING1-133

    and passing on the stack is here
    http://burks.bton.ac.uk/burks/langua...htm#HEADING4-1

  11. #11

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    62
    thanks alot.
    "As for me, I am poor and needy but God is thinking about me right now." Psalm 40

  12. #12
    Guest

    Intrigued!

    hey Sam,

    What sort of program are you working on that requires you to code in binary? Just being nosey!

  13. #13
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    I thought he was making a special compiler, but I don't think you need binary for that as MASM 6 was written in a previous MASM (weird). So this has left me confused. I must go back into my cardboard box to think about this...
    Courgettes.

  14. #14
    Guest
    hmm, i was thinking the other night (quite a rare occurence in the first place) about how hard it would be to create a compiler from scratch. And it put me in mind of recursive programming - in other words, which came first: the chicken or the egg. I reckon building a compiler is the second hardest thing a programmer can undertake, by its very nature a compiler must have pretty much no bugs at all.

    The
    hardest thing, obviously, is Artificial Intelligence - which has no reliable definition. I hope i'm not going too deep here, but i'd like to get some opinions on this

    What do you think?

  15. #15
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Hi there V(ery)!!! Haven't heard from you in ages! How's it going?

    wossname - I think it's the egg. Because, during evolution, when the species was sufficiently changed to become a "Chicken", it would have come from an egg laid by a non-"Chicken".
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  16. #16
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Well that depends on whether you think the kind of egg is defined by what laid it, or what it will hatch into. It's all a matter of definition, as it usually is

    Harry.

    "From one thing, know ten thousand things."

  17. #17
    Guest
    (sigh) no hope of an intelligent and stimulating conversation then? Oh well, sounds about right for this forum.

  18. #18
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Well perhaps if you want to discuss artificial intelligence, you might display some of your own and join the *shock horror* artificial intelligence thread
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width