Page 1 of 1

Trouble with creating include file in nasm

Posted: Fri Aug 30, 2002 5:31 pm
by beyondsociety
I am having trouble with trying to create a include file for my program.

If someone could help me out with these questions, I would appreciate it.

What does a include file have to have in it to work?
How would I compile it in nasm?
How would I include it in my program?
How would I compile my program in nasm to include that file?
Then how would I run the program?

I want to have the include file run with my bootsector.

Re:Trouble with creating include file in nasm

Posted: Fri Aug 30, 2002 10:04 pm
by crazybuddha
The include file is only code which is inserted whereever the %include "myfile" is located.

It is not assembled separately.

See my web page for an example:

http://www.crazybuddha.com/setup.php

Re:Trouble with creating include file in nasm

Posted: Fri Aug 30, 2002 10:12 pm
by Warmaster199
I am pretty sure that an assembler include file is named "file.inc".

You either include it by using the line %include "file.inc"

Include files can have anything from variables to labels with code, to equates, to proceedures. You can even add macros to make an instruction that you processor supports, but the assembler won't! I never made assembler programs that need includes (I've only made assembler bootsectors and partial start-up codes)

But in C/C++, includes are essential!

From what I can guess, as long as the .inc is in the same folder as the source, you can assemble the code as "nasm code.asm code.bin"...