I want to compile this source code in Windows (It just an example):
start:
NOP
NOP
When I compile it with NASM or FASM, output file length is 2 bytes. But when I compile it with GNU assembler (as) the output file length is 292 bytes!
How to compile an assembly file to a raw binary (like DOS .com) format with GNU assembler (as)?
Why I do this?
I want to write my own simple OS, I write my codes with C (without using any C standard libraries even stdio.h or math.h) and convert it to assembly:
gcc -S my_os.c -o my_os.asm -masm=intel
Then, I compile assembly file to a raw binary:
as my_os.asm
Then I rename a.out
(output of assembler) to my_os.flp
and finally start my OS with VMWare :)