Category:ARM Assembly: Difference between revisions
m
→Conditional Opcodes: Rephrased a sentence for clarity
Puppydrum64 (talk | contribs) m (→Limitations of the ARM: Formatting (again)) |
Puppydrum64 (talk | contribs) m (→Conditional Opcodes: Rephrased a sentence for clarity) |
||
Line 33:
If your code does one thing when a flag is set and another when that same flag is clear, the ARM can
<lang ARM Assembly>;ARM ASSEMBLY
Line 51:
sub ax,bx
done:</lang>
===Setting Flags===
The flags, or condition codes, are only set by instructions that end in an "s," or by compare commands such as <code>CMP</code>. This lets you "preserve" the processor's state after an important calculation, but do some other things before execution branches depending on the result of that calculation. On any other processor, the calculation that determines whether a branch occurs MUST happen JUST before that branch statement or the branch will be taken based on the wrong data.
|