我可以在程序集bne jsr swap
上做这样的事情吗,如果不能,我该如何从C解决这个问题,提前致谢
if(start!=pivot_index){
swap(board,start,pivot_index);
}
我被教导说我必须写 jsr
和 sub-routine
但是我可以做这样的事情吗 bne sub-routine
最佳答案
在汇编中通常会被翻译成这样的东西(伪汇编):
load [start]
compare [pivot_index]
branch-if-equal label1
push [pivot_index]
push [start]
push [board]
call swap
add-stack-pointer 12
label1:
即。如果控制表达式不为真,则 if
语句将转换为跳过 if
主体的跳转。
关于c - 汇编中的子程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2891544/