Flow-control structures: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) m (→{{header|ARM Assembly}}: clarification) |
||
Line 259: | Line 259: | ||
=={{header|ARM Assembly}}== |
=={{header|ARM Assembly}}== |
||
<lang ARM Assembly>SWI n ;software system call |
<lang ARM Assembly>SWI n ;software system call |
||
B |
B label ;Branch. Just "B" is a branch always, but any condition code can be added for a conditional branch. |
||
;In fact, almost any instruction can be made conditional to avoid branching. |
;In fact, almost any instruction can be made conditional to avoid branching. |
||
BL |
BL label ;Branch and Link. This is the equivalent of the CALL command on the x86 or Z80. |
||
;The program counter is copied to the link register, then the operand of this command becomes the new program counter. |
;The program counter is copied to the link register, then the operand of this command becomes the new program counter. |
||
BX |
BX Rn ;Branch and Exchange. The operand is a register. The program counter is swapped with the register specified. |
||
;BX LR is commonly used to return from a subroutine.</lang> |
;BX LR is commonly used to return from a subroutine.</lang> |
||