NASM: Far Call with Segment and Offset Stored in Registers

前端 未结 3 686
生来不讨喜
生来不讨喜 2021-01-22 23:56

I\'ve got the code segment and the offset values stored in two registers, say AX and BX respectively. In NASM how can I encode a far call to AX:B

3条回答
  •  时光取名叫无心
    2021-01-23 00:08

    You have to put them in memory. You can’t perform a far call through registers. Assuming bp is set up as a frame pointer, you can use something like this:

    push ax
    push bx
    call far [bp-N]
    add sp, 4
    

    (with a suitable value for N).

提交回复
热议问题