From: Daniel R. <roc...@ri...> - 2015-11-16 03:23:15
|
This might be the wrong place to ask. I'm not really sure, but if I am posting to the wrong place then please tell me. I have been developing a real mode OS recently. I've gotten to the stage where I know the executable formats and memory layout, etc, so I first want to know if it is possible to fit a port of NASM into 32kb (half of a real mode segment). The other 32kb would be used for assembly code. Preferably everything would be in a single segment, but I wouldn't mind if NASM had to fit into 64kb and then have another 64kb segment for data and stuff like that. I don't need any of the following: * support for output format other than flat binary * preprocessor (no macros needed) * instructions above 80386 Memory map (basic): segment usage ---------------------------------------- 0x0000 IVT, BDA, unused memory 0x1000 Stack segment 0x2000 Kernel (syscalls, runtime libs) 0x3000 Shell 0x4000 User's programs (0x5000) (nasm data) 0x7000 end of usable conventional memory The executable format I chose is the COM file format (64kb max and ORG 0x100). There isn't a PSP. So, given that, should I try to port NASM or write my own assembler? Would it fit into the given size? Older versions of NASM for DOS were almost 500 kb. It seems that from this, NASM will never fit into a 64kb segment. But removing the preprocessor and >386 instructions might make it JUST small enough to fit... and I will be rewriting the whole thing in assembler, and assembler is a lot smaller than C. So it might fit in a segment if I could get the data in another segment. -- Daniel |