Re:Moon Bugs (2018)
by chillingeffect on Wednesday April 23, 2025 @04:06PM
(#43776132)
oh man, I apologize, I got it wrong! Sorry, the whole program can only be 64K in total, you're right!
how are you creating your .com files btw?
I think it is this, it's been a couple of weeks:
nasm -f bin -o foobar.com foobar.asm
Top of the file you'll need this offset for DOS (or 7c00 for an MBR) to adjust your pointers with based on where the program gets loaded:
[bits 16] [offset 100]
I bet you can use more than 64kb of memory, I set ES to A000 and write to video memory in mode 13. So I imagine if you have a data source -- know your (LBA) block offsets (MBR style) or use a DOS interrupt to load a file -- you can still stomp on some memory outside of the given 64k and set your DS register there.
I haven't done it yet but if I wanted to load a .wad file or something that's the line I'd follow ;)
The only question I have though is... How? I see DOS initialize all of the segment registers to the same address. Is this something DOS specific like special bits in _start or something? Or something I do myself?
I guess I could imagine my one mega .asm file that includes all my resources and then in _start I just set my segment registers to "further down in the file" using labels. But yeah, I'm a newb at this but love the simplicity of graphics programming like this, tips very much appreciated :)