Assembly (x86程序集)在跳转之前跳回位置?

Assembly (x86程序集)在跳转之前跳回位置?,assembly,x86,nasm,x86-16,Assembly,X86,Nasm,X86 16,我试图跳回我在16位x86指令集程序中跳转的位置。我目前正在做一个跳远到扇区外的位置(1扇区结束),但我想在扇区外的my代码运行后跳回 ;Loading new file into segmented memory 0001:2345 mov bx, 0x0001 ;Setting the location to load the module into memory mov es, bx mov ds, bx mov bx, 0x2345 mov ah, 02 ;Set to rea

我试图跳回我在16位x86指令集程序中跳转的位置。我目前正在做一个跳远到扇区外的位置(1扇区结束),但我想在扇区外的my代码运行后跳回

;Loading new file into segmented memory 0001:2345
mov bx, 0x0001   ;Setting the location to load the module into memory
mov es, bx
mov ds, bx
mov bx, 0x2345

mov ah, 02   ;Set to read disk
mov al, 1    ;Reading 1st sector from disk
mov ch, 0    ;First cylinder
mov cl, 2    ;Reading the physical second sector
mov dh, 0    ;Reading first head
mov dl, 0    ;Reading from the first drive
int 13h      ;Execute interrupt to load disk sector into memory

jmp word 0x0001:0x2345 ;Jump to the location in memory that the we just loaded into memory.
;Where I'd like to jump back to so I can continue to execute some code.
这段代码成功地将我跳转到新的内存位置,并执行我在那里加载的代码。我不太明白如何回到我的主程序。我在想,在我跳转并使用它返回之前,必须有一种方法来存储我的地址位置,但是我无法正确地让jmp处理我存储在堆栈中的地址


任何对x86有一定了解的人都有什么建议吗?

执行您要求的操作的正常方法是使用
调用
指令,该指令推动当前指令指针(如果是“远”调用,即更改代码段的调用),并跳转到指定的地址。要返回到下一条指令,被调用方必须执行
ret
(尤其是
retf
,以从远端调用返回)。因此,您可能会执行以下操作

call word 0x0001:0x2345
在被叫人的末尾

retf
我在想,在我跳转并使用它返回之前,必须有一种方法来存储我的地址位置。是的,它被称为
call
;这就是调用函数的方式。