Hey I've been working through some tutorials, and I've been compiling
my .inc files and outputting them as .bin files. Everything is working fine,
so I'm just going to assume that's the right format, right?
.INC Files to .BIN?
This is a common misconception due to thinking within higher-level constraints.
The extension of the file doesn't matter, the contents do. The only exception to this is when IDEs and picky compilers/assemblers make such a seemingly useless distinction.
The file extension is merely a way for the "human" to keep track of their code. Traditionally, you have a main set of .ASM files and supporting .INC files... much like .C and .H files, respectively, for the C programming language.
Bottom line, do things however you want/can... but make sure you (and others if that's the case) can figure out what is going on with your source code.
The extension of the file doesn't matter, the contents do. The only exception to this is when IDEs and picky compilers/assemblers make such a seemingly useless distinction.
The file extension is merely a way for the "human" to keep track of their code. Traditionally, you have a main set of .ASM files and supporting .INC files... much like .C and .H files, respectively, for the C programming language.
Bottom line, do things however you want/can... but make sure you (and others if that's the case) can figure out what is going on with your source code.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Hence the reason I suggested to use ASM files instead of INC files.SpooK wrote: The file extension is merely a way for the "human" to keep track of their code. Traditionally, you have a main set of .ASM files and supporting .INC files... much like .C and .H files, respectively, for the C programming language.
I said usually. Also, it's better to use INC files as include files so that someone else who looks at your code can understand what's happening.This is a common misconception due to thinking within higher-level constraints.
I'm using both ASM and INC files. When Spook mentioned "picky" compilers, that's more along the lines of what I was asking. I figured it was similar to .c, .cpp and .h files, but wasn't sure.
And having an OOP background I'm not used to picking the "out-putted" format for my files. Using command line compilers like NASM is very different from firing up DevC++ or VisualStudio.
This is what was confusing to me:
In the second line, I was just following what I figured was a naming convention common to all assembly files.
And having an OOP background I'm not used to picking the "out-putted" format for my files. Using command line compilers like NASM is very different from firing up DevC++ or VisualStudio.
This is what was confusing to me:
Code: Select all
c:\nasm\src\nasm -f bin boot.asm -o boot.bin
c:\nasm\src\nasm -f bin gdt.inc -o gdt.bin
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
The first line is building a complete flat binary, as in an executable. The second line will do the same. I think that you want to be working with object files for the second file (so you can link it in with C)?eboyd wrote:This is what was confusing to me:
Code: Select all
c:\nasm\src\nasm -f bin boot.asm -o boot.bin c:\nasm\src\nasm -f bin gdt.inc -o gdt.bin
if boot.asm includes (or if gdt.inc is set up to be an included file) gdt.inc, Then there is no need to compile gdt.inc as the assembler "adds" the text of gdt.inc to boot.asm as though it were one file. Then the assembler compiles the result.eboyd wrote:I'm using both ASM and INC files. When Spook mentioned "picky" compilers, that's more along the lines of what I was asking. I figured it was similar to .c, .cpp and .h files, but wasn't sure.
And having an OOP background I'm not used to picking the "out-putted" format for my files. Using command line compilers like NASM is very different from firing up DevC++ or VisualStudio.
This is what was confusing to me:
In the second line, I was just following what I figured was a naming convention common to all assembly files.Code: Select all
c:\nasm\src\nasm -f bin boot.asm -o boot.bin c:\nasm\src\nasm -f bin gdt.inc -o gdt.bin
Microsoft: "let everyone run after us. We'll just INNOV~1"