【发布时间】:2017-03-14 22:38:00
【问题描述】:
我想知道是否有办法做出有条件的决定并根据该结果调用函数。
例如。我想比较一些东西。如果它们是偶数,我想做函数调用。但是,我编写函数的方式需要调用函数而不是跳转到它。 (基于我的函数处理堆栈的方式)有没有办法做到这一点?如图所示,我已经复制了我的代码,它无法编译。
.endOfForLoop: cmp dword [ebp - 4], 1 ; compares the boolean to one
je call print_prime ; if it is one then prime needs to be printed
jmp call print_not_prime ; otherwise it is not prime
使用 NASM、x86 32 位汇编、linux、intel
【问题讨论】:
-
跳跃和呼叫是相互排斥的,两者不会像您显示的那样一起出现。
标签: function assembly x86 call intel