I\'ve been stuck with this for weeks now and have no idea where I\'m going wrong because NASM hasn\'t given me any errors. The code is pretty self explanatory because of the com
jmp [es:bx]
doesn't jump to the address es:bx
. This command does a near jump to the address stored in the word at es:bx
. This is why lots of older assemblers made you spell this kind of instruction as jmp word ptr [es:bx]
or even jmp near ptr [es:bx]
; it's clearer this way what is going to happen. What you probably want here is a far jump to a fixed location:
; jmp far 8000:0000
db 0eah
dw 00000h ; offset
dw 08000h ; segment
If you do want to jump to es:bx
, use retf
:
push es
push bx
retf