segment code
..start:
mov ax,stack
mov ss,ax
mov sp,stack_top
mov ax,yems
mov ds,ax
mov dx,hello
mov ah,9
int 21h
mov ax,moar
mov ds,ax
mov dx,hi2
mov ah,9
int 21h
mov ah,4ch
int 21h
segment yems
hello: db "hello world$"
segment dayter
hi:
incbin "E:\dos\low1.raw"
incbin "E:\dos\low2.raw"
incbin "E:\dos\low3.raw"
incbin "E:\dos\low4.raw"
incbin "E:\dos\low5.raw"
incbin "E:\dos\low6.raw"
incbin "E:\dos\low7.raw"
incbin "E:\dos\low8.raw"
incbin "E:\dos\low1b.raw"
incbin "E:\dos\low3b.raw"
incbin "E:\dos\low5b.raw"
incbin "E:\dos\low7b.raw"
incbin "E:\dos\low8b.raw"
incbin "E:\dos\low1c.raw"
segment moar
hi2:
db "does this still work?$"
incbin "E:\dos\extreme.raw"segment stack stack
resb 256
stack_top:
All you have to do is change register ds to contain the address of the appropriate segment, and you're all good! The code above is a mess, but it's what I used for testing. All files included in segment dayter add up to 63kb. The file in segment moar is 16.9 (nice) kb. The whole .exe is about 80kb!
Because I like to do all the development in my Windows environment, I needed to use a 32-bit linker. For this, I highly recommend Alink! Of course, I'm using NASM for assembling the code. Here are the commands, for future reference:
nasm -f obj -o file.obj file.asm
alink file.obj
No comments:
Post a Comment