How to load a kernel from disk with BIOS int 13h in NASM assembly?

前端 未结 5 2029
醉话见心
醉话见心 2021-02-02 01:21

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

5条回答
  •  清酒与你
    2021-02-02 01:55

    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
    

提交回复
热议问题