Category:ARM Assembly: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1:
{{stub}}{{language}}{{assembler language}}
The ARM architecture is widely used on mobile phones and tablets. It falls under the category of RISC (Reduced Instruction Set Computer) processors, which means it has fewer opcodes than a CPU such as those in the x86 family. However, it makes up for this with its speed. The ARM and its variants are used in many well-known systems such as the Raspberry Pi, Nintendo DS, iPad, and more.
 
===Barrel Shifter===
The ARM can add a bit shift or rotate to one of its operands at no additional cost to execution time or bytecode. If the operand being shifted is a register, the value of that register is not actually changed. The shift or rotate only applies during that instruction.
 
===Separate Destination for Math===
With the x86, 68000, and other similar processors, arithmetic functions take two operands: the source and the destination. Anytime you add two numbers, one of them gets changed. This is not the case with the ARM. The destination can be a third register that isn't involved in the arithemtic whatsoever!
 
<lang ARM Assembly> add r3,r2,r1 ;add r2 to r1 and store the result in r3. r1 and r2 are unchanged.</lang>
 
===Conditional Opcodes===
Checking for condition codes isn't just limited to branching on the ARM. Almost every instruction can be made conditional. If the condition is not met, the opcode will have no effect. This saves a lot of cycles that would be spent branching just to execute a single instruction.
 
<lang ARM Assembly>addeq r0,r0,r1 ;if the last math operation had an answer of zero, add r0 to r1 and store the result in r0.</lang>
[[Category:Assembly]]
1,489

edits