English 中文(简体)
如何在没有以前的影响力比较的情况下,用浴室做事?
原标题:How can a bne branch work without a previous cmp compare in ARM sssembly?
  • 时间:2011-10-24 18:23:17
  •  标签:
  • assembly
  • arm

I m learning subroutines in Arm assembly and I m confused with an example. For " bne Body " doesn t it need a cmp x, y before it? What s it comparing?

@ Sum of the first "MAX" Fibonacci with subroutine
.text
.global _start
.equ MAX,10
_start: mov r1,#MAX
bl Fib 
exit: swi 0x11 @ Terminate the program
@Subroutine to compute sum of n Fibonacci numbers
Fib: sub r1,r1,#2 @ Counter - 2
mov r2,#1
mov r3,#2
mov r0,#3
Body: add r4,r2,r3
add r0,r0,r4 @ Update Sum
mov r2,r3
mov r3,r4
Decr: subs r1,r1,#
bne Body @ If Count != 0, repeat loop
Done: mov pc,lr @ Return from subroutine
最佳回答

该次指示规定了旗帜,而布恩则在悬挂这些国旗。 基本上,它比较了1至0,如果它不等于0。 比较实际上是一种分站式操作,即你如何比较万国邮联中的2个数字。 较老的国邮联甚至比较了密码,而许多这类编码实际上只是次要的同义词(如果存在的话,可能会在旗帜上出现小的差别,而且为了明确起见,你应当使用比较代码。

问题回答

暂无回答




相关问题
List of suspected Malicious patterns

I am doing an anti-virus project by disassembling its code and analyzing it. So I want a list of the Suspected Malicious pattern codes, so I can observe which is suspected and which is not? So I want ...

Prefetch for Intel Core 2 Duo

Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I ve been using the (standard?) prefetch set (prefetchnta, prefetcht1, etc) with success for a series of P4 ...

How are mutex and lock structures implemented?

I understand the concept of locks, mutex and other synchronization structures, but how are they implemented? Are they provided by the OS, or are these structures dependent on special CPU instructions ...

Installing GNU Assembler in OSX

No matter how hard I google, I can t seem to find a (relatively) easy-to-follow instruction on how to install the GNU Assembler on a mac. I know I can use gcc -c (Apple Clang on a Mac) to assemble .s ...

8086 assembler,INT 16,2

I got stuck at this thing,I want to see if right shift button has been pressed,so I have this assambler code: mov ah,2 int 16h ;calling INT 16,2 - Read Keyboard Flags interrupt mov ah,...

Translate a FOR to assembler

I need to translate what is commented within the method, to assembler. I have a roughly idea, but can t. Anyone can help me please? Is for an Intel x32 architecture: int secuencia ( int n, ...

热门标签