[BITS 16] org 0x0 mov ax, cs mov ds, ax cli mov ss, ax mov sp, 0xFFF0 sti jmp 0x07C0:start print: lodsb or al, al jz done mov ah, 0x0E int 0x10 jmp print done: ret resetmsg db "Resetting floppy...", 10, 13, 0 loadmsg db "Loading sectors...", 10, 13, 0 jumpmsg db "Jumping to loaded sectors...", 10, 13, 0 start: nop reset: ; Resets floppy mov si, resetmsg call print xor ax, ax xor dx, dx int 13h jc reset load: mov si, loadmsg call print mov bx, 0x1000 mov es, bx xor bx, bx mov al, 10 ; Load 10 sectors mov ah, 2 mov cl, 2 ; Load 10 sectors mov ch, 0 ; Track 0 mov dx, 0x0000 ; Head 0, Drive 0 int 13h jc load jumpto: mov si, jumpmsg call print jmp 0x1000:0000 times 510 - ($-$$) db 0 ; end of sector 1 mov ax, cs mov ds, ax cli mov ss, ax mov sp, 0xFFFF0 sti jmp sec2start message db "It works!", 0 sec2start: mov si, message print2: lodsb or al, al jz done2 mov ah, 0x0E int 0x10 jmp print2 done2: nop cli hlt times 512 * 2880 - ($-$$) db 0 ; Pad out 0's to make floppy disk image.
Here's the output:
Resetting disk...
Loading sectors...
Jumping to loaded sectors...
And then nothing...It just hangs!
So can someone help me with this?
P.S. The last line of code was to make a bootable floppy image! I know its not the best way but it works!