【发布时间】:2015-03-16 23:58:32
【问题描述】:
这就是我的代码的样子。你觉得它有什么问题吗?
compare macro nr1,nr2 ; title of macro
local et1,et2 ; etiquetes
mov eax,nr1
mov ebx nr2
push eax
push ebx
; here I compare the 2 number nr1, nr2 to see whether is bigger
cmp eax,ebx ; comparing the 2 numbers
ja et1
jb et2
et1:
sub eax,ebx ; if the first one is bigger, we substract from it
; here we subtract from the bigger one
push eax
push offset format3
call printf
add esp,8
et2:
sub ebx,eax ; if the second one is bigger we substract like this
push ebx
push offset format3
call printf
add esp,8
add esp, 8
endm
【问题讨论】:
-
您是否收到任何错误消息?如果有,在哪一行?
-
这行
mov ebx nr2好像少了一个逗号。 -
你的汇编器肯定发现了它的问题,并告诉你。为什么不关注它?这肯定比在 Stack Overflow 上提问要快!
-
嗯,实际上,逗号是问题所在。问题是汇编器显示错误的另一行。