Flow-control structures: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 123: | Line 123: | ||
=={{header|68000 Assembly}}== |
=={{header|68000 Assembly}}== |
||
<code>JMP</code>,<code>JSR</code>,<code>RTS</code>, and branching work almost identical to [[6502 Assembly]]. There are a few exceptions: |
<code>JMP</code>,<code>JSR</code>,<code>RTS</code>, and branching work almost identical to [[6502 Assembly]]. There are a few exceptions: |
||
* <code>BCS</code> and <code>BCC</code> are the opposite for the purposes of unsigned comparisons. |
* Compared to the 6502, <code>BCS</code> and <code>BCC</code> are the opposite for the purposes of unsigned comparisons. |
||
* An additional <code>BSR</code> can be used for nearby subroutines. This is "cheaper" than a <code>JSR</code>. |
* An additional <code>BSR</code> can be used for nearby subroutines. This is "cheaper" than a <code>JSR</code>. |
||
* <code>DBRA</code> is used for looping. A register operand is decremented with each loop. The loop terminates when the value in the register underflows from 0 to FFFF. |
* <code>DBRA</code> is used for looping. A register operand is decremented with each loop. The loop terminates when the value in the register underflows from 0 to FFFF. |