global main ; define for linker
extern printf ; tell linker we need this C function
section .data ; Data section, initialized variables
a: dq 3
b: dq 2
fmt0: db "True"
fmt1: db "Equal"
fmt2: db "False"
section .text
main: push rbp
mov rax,[a]
cmp rax,[b]
jg true
je equal
jmp less
exit:
pop rbp
mov rax,0
ret
true:
mov rdi, fmt0
call printf
jmp exit
equal:
mov rdi, fmt1
call printf
jmp exit
less:
mov rdi, fmt2
call printf
jmp exit
有人可以告诉我,为什么它适用于a = 1 b = 2但是如果a更大则调用所有函数并返回“TrueEqualFalse”,我是汇编程序的新手,我想知道这有什么问题代码