Swap %Rd, %Rs - Seiko Epson S1C17 Series Manual

Cmos 16-bit single chip microcomputer.s1c17 core
Table of Contents

Advertisement

swap %rd, %rs

Function
Swap
Standard)
Extension 1) Unusable
Extension 2) Unusable
15 14 13 12 11 10
Code
0
0
1
|
|
IL
IE
C
Flag
|
|
Mode
Src:Register direct %rs = %r0 to %r7
Dst:Register direct %rd = %r0 to %r7
CLK
One cycle
Description
(1) Standard
Swaps the byte order of the 16 low-order bits of the rs register high and low and loads the
results to the rd register.
23
rs
X
23
0
rd
(2) Delayed slot instruction
This instruction may be executed as a delayed slot instruction by writing it directly after a
branch instruction with the "d" bit.
Example
When r1 = 0x123456
swap
%r2,%r1
S1C17 FAMILY S1C17 CORE MANUAL
rd(15:8) ← rs(7:0), rd(7:0) ← rs(15:8), rd(23:16) ← 0
9
8
7
|
|
0
1
1
r d
|
|
|
|
|
V
Z
N
|
|
|
16
15
X
X
X
X
X
X X
16
0
0
0
0
0
0 0
15
; 0x005634 → r2
6
5
4
3
2
1
0
|
1
1
1
1
r s
|
|
|
|
|
8 7
Byte 1
Byte 0
Byte 0
Byte 1
8 7
EPSON
7 DETAILS OF INSTRUCTIONS
0
0
7-119

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the S1C17 Series and is the answer not in the manual?

Table of Contents