NASM assembler - How to make sure the function label isn't executed one extra time?

后端 未结 2 1858
再見小時候
再見小時候 2021-01-18 23:41

Hello I am tinkering around with assembly level programming. I have the following code

    mov al, \'H\'
    call my_function

my_function:
    mov ah,0x0e          


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 00:17

    As Jester notified in his comment, all the labels which are supposed to be functions must be below jmp $ statement so it doesn't execute an extra time.
    P.S. jmp $ is instructing the system to jump to the current location which results in an infinite loop, not allowing to proceed further where the functions exist.

提交回复
热议问题