I have a few questions actually, but first EXTERNDEF. Is that what I use to have a proc in one file and us it in another? Can I get a quick example? Some code paster here uses @@ and @ for local labels? What are they for? MASM32 help doesn't seem to have any info. What API is good for loading a binary file with no formating info ect.? Thanks
Posted on 2001-04-26 19:27:00 by asm_happy
EXTERNDEF is used for separate compilation. There is an example in the MASM32 help file. For example : ; file1.inc externdef Function1 : proc ; file1.asm Function1 proc ... Function1 endp Now if you want to use Function1 in another file, you do : ; file2.asm INCLUDE file1.inc call Function1 The compiler will generate the correct EXTERN and PUBLIC statements. In file1.asm, it will declare Function1 as PUBLIC. In file2.asm it will declare Function1 as EXTERN. You can find more info in the chapter eight of the Art of Assembly Language
Posted on 2001-04-27 09:34:00 by karim
Thanks for the quick example. MASM32's explanition is a litte too terse for me. Does this mean every file will be compiled every time? Or will just the one, using the objs for the others?
Posted on 2001-04-27 17:49:00 by asm_happy
The file needs to be compiled only once (of course, if you change it you need to recompile it). After all the obj files have been compiled, you link them to produce an executable. So in the previous example, you will do : >ml /c file1.asm => file1.obj >ml /c file2.asm => file2.obj >link file1.obj file2.obj /out:executable.exe When you change file2.asm, you don't need to recompile file1.asm. You need to recompile file2.asm and to link file2.obj with file1.obj. You can use the NMAKE (or MAKE) utility to manage dependencies between source files, object files and executables.
Posted on 2001-04-30 03:55:00 by karim