Skip to content

Commit

Permalink
Fixed mistake concerning rrca/rlca commands
Browse files Browse the repository at this point in the history
  • Loading branch information
meteoritenhagel committed Apr 11, 2021
1 parent 27da01c commit 5267fdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gbasmdev.tex
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ \section{The most common commands}
There are operations for so-called rotations and shifts. The operations |rlc| and |rrc| rotates any register to the left and right respectively, which means that each bit is moved one step left/right, looping around to the other side. For example, if the B register holds |%11001010|
before, then after a |rlc b| it will hold |%10010101|,
but if we ran |rrc b| instead, it would hold |%01100101|.
Note that special, faster commands exist for rotating the A register: |rlca| and |rrca|. These work exactly the same, except they only work on the A register, and execute twice as fast, and take up half the ROM space (see Chapter~\ref{optimize}).
Note that special, faster commands exist for rotating the A register: |rlca| and |rrca|. These work almost the same, except that they reset the z-flag always, execute twice as fast, and take up half the ROM space (see Chapter~\ref{optimize}).

Shifts are similar to rotations, but do not "wrap around" and instead just pad with zeros. The commonly used commands are |sla| for shifting left, and |srl| for shifting right. For example, if B holds |%11000011|
before, then running |sla b| would result in |%10000110|
Expand Down

0 comments on commit 5267fdc

Please sign in to comment.