
156 Assembly Language Programming for the 68000 Family
we always went through the loop 32 times. Also note that this routine
does not check for overflow. The 68000 has a multiply instruction, so this
routine should never be required.
Rotates
Rotates are very similar to shifts. We can rotate to the left or right. The
difference is that rather than shift in zeros, as for left shifts and logical
right shifts, the bit that would normally fall off the end is shifted back
into the longword, word, or byte at the opposite end. The ROL (rotate
left) and ROR (rotate right) instructions work as follows:
ROL
A corresponding pair or rotates, ROXL and ROXR, work in the same
way as ROL and ROR except that the extend bit is included as an extra
bit to be included in the rotate. Here is how they work:
ROXL
ROXR
□
Comments to this Manuals