Click to See Complete Forum and Search --> : Asm and VB
Edwin_Drood_1870
Nov 8th, 2000, 10:38 PM
Is it possible to write a loop function in asm and then use the obj file in a vb program?
Sam Finch
Nov 9th, 2000, 06:06 AM
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.
Edwin_Drood_1870
Nov 9th, 2000, 04:47 PM
But can use do this with the obj files? A dll is alot slower isn't it?
Sam Finch
Nov 9th, 2000, 09:45 PM
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.
parksie
Nov 10th, 2000, 03:14 PM
I thought with 32bit programming there was no more near/far messing around?
Sam Finch
Nov 10th, 2000, 04:52 PM
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.
Edwin_Drood_1870
Nov 14th, 2000, 03:25 AM
What are far and near calls?
parksie
Nov 14th, 2000, 06:51 AM
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 ;))
Edwin_Drood_1870
Nov 14th, 2000, 01:57 PM
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?
Sam Finch
Nov 14th, 2000, 03:50 PM
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/language/asm/artofasm/ch11/ch111.htm#HEADING1-133
and passing on the stack is here
http://burks.bton.ac.uk/burks/language/asm/artofasm/ch11/ch114.htm#HEADING4-1
Edwin_Drood_1870
Dec 1st, 2000, 08:02 PM
thanks alot.
hey Sam,
What sort of program are you working on that requires you to code in binary? Just being nosey!
V(ery) Basic
Dec 14th, 2000, 04:45 AM
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...
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?
parksie
Dec 15th, 2000, 01:41 PM
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".
HarryW
Dec 15th, 2000, 01:53 PM
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 :)
(sigh) no hope of an intelligent and stimulating conversation then? Oh well, sounds about right for this forum.
HarryW
Dec 15th, 2000, 04:10 PM
Well perhaps if you want to discuss artificial intelligence, you might display some of your own and join the *shock horror* artificial intelligence thread :rolleyes:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.