35.3.3.6. INTEGER SHIFT/ROTATES ON 68K
Code Size Mnemonic Description
(Shift Arithmetic Left)
1110xxx1ss000yyy B,W,L ASL #x,Dy Dy << #x -> Dy
1110xxx1ss100yyy B,W,L ASL Dx,Dy Du << Dx -> Dy
1110000111<-EA-> W ASL
C <----+---- SRC <--- 0
X <---/
(Shift Arithmetic Right)
1110xxx0ss000yyy B,W,L ASR #x,Dy Dy >>> #x -> Dy
1110xxx0ss100yyy B,W,L ASR Dx,Dy Du >>> Dx -> Dy
1110000011<-EA-> W ASR
+---> SRC -------+-----> C
| | |
+----+ +-----> X
high bit
(Shift Logical Left)
1110xxx1ss001yyy B,W,L LSL #x,Dy Dy << #x -> Dy
1110xxx1ss101yyy B,W,L LSL Dx,Dy Dy << Dx -> Dy
1110001111<-EA-> W LSL
C <----+---- SRC <--- 0
X <---/
(SHift Logical Right)
1110xxx0ss001yyy B,W,L LSR #x,Dy Dy >> #x -> Dy
1110xxx0ss101yyy B,W,L LSR Dx,Dy Dy >> Dx -> Dy
1110001011<-EA-> W LSR
0 ---> SRC ----+-----> C
|
+-----> X
1110xxx1ss011yyy B,W,L ROL #x,Dy
1110xxx1ss111yyy B,W,L ROL Dx,Dy
1110011111<-EA-> W ROL
C <---+-- SRC <----+
| |
+----------->+
1110xxx0ss011yyy B,W,L ROR #x,Dy
1110xxx0ss111yyy B,W,L ROR Dx,Dy
1110011011<-EA-> W ROR
+---> SRC --+---> C
| |
+<-----------+
Note: In 68K exist 2 additional operaions ROXL and ROXR it's like
Rotates throught carry.
1110xxx1ss010yyy B,W,L ROXL #x,Dn
1110xxx1ss110yyy B,W,L ROXL Dx,Dy
1110010111<-EA-> W ROXL
C <----------+---- SRC <----+
| |
X <----+ |
| |
+--------------------->+
1110xxx0ss010yyy B,W,L ROXR #x,Dy
1110xxx0ss110yyy B,W,L ROXR Dx,Dy
1110010011<-EA-> W ROXR
+----> SRC -----------+---------> C
| |
+<--------- X <--------+
@
35.3.3.7. INTEGER SHIFT/ROTATES ON Z80
Operation Description Code
RL r Rotate Left CB 10+r
RL (ii+n) ii CB n 16
+<--- Cy <--- r <--+
| |
+----------------->+
RLC r Rotate Left w/o carry CB 00+r
RLC (ii+n) ii CB n 06
Cy <---+--- r <----+
| |
+---------->+
RR r Rotate Right CB 18+r
RR (ii+n) ii CB n 1E
+---> Cy ---> r -->+
| |
+<-----------------+
RRC r Rotate Right w/o carry CB 08+r
RRC (ii+n) ii CB n 0E
Cy <---+---> r --->+
| |
+<----------+
SLA r Shift Left Arithmetic CB 20+r
SLA (ii+n) ii CB n 26
Cy <--- r <--- 0
SLI r Shift Left Logical CB 30+r
SLI (ii+n) ii CB n 36
Cy <--- r <---- 0 (UNDOCUMNENT)
SRA r Shift Right Atithmetic CB 28+r
SRA (ii+n) ii CB n 2E
+---> r ------> Cy
| |
+<----+
high bit
SRL r Shift Right Logical CB 38+r
SRL (ii+n) ii CB n 3E
0 ----> r -----> Cy
Note:
Also exist RLD, RRD
Index Prev Next