Data Transfer Instructions (Between Stack And Register) - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.2)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

6.6.4

Data Transfer Instructions (between Stack and Register)

 Types and functions of extended instructions
Extended instruction
sld.b
%rd,[%sp+imm20] %rd ← B[%sp+imm20] (with sign extension)
sld.ub %rd,[%sp+imm20] %rd ← B[%sp+imm20] (with zero extension)
%rd,[%sp+imm20] %rd ← W[%sp+imm20]
sld
%rd,[%sp+imm20] %rd ← A[%sp+imm20](23:0), ignored ← A[%sp+ imm20](31:24)
sld.a
[%sp+imm20],%rs B[%sp+imm20] ← %rs(7:0)
sld.b
[%sp+imm20],%rs W[%sp+imm20] ← %rs(15:0)
sld
[%sp+imm20],%rs A[%sp+imm20](23:0) ← %rs(23:0), A[%sp+ imm20](31:24) ← 0
sld.a
%rd,[%sp+imm24] %rd ← B[%sp+imm24] (with sign extension)
xld.b
xld.ub %rd,[%sp+imm24] %rd ← B[%sp+imm24] (with zero extension)
%rd,[%sp+imm24] %rd ← W[%sp+imm24]
xld
xld.a
%rd,[%sp+imm24] %rd ← A[%sp+imm24](23:0), ignored ← A[%sp+ imm20](31:24)
xld.b
[%sp+imm24],%rs B[%sp+imm24] ← %rs(7:0)
xld
[%sp+imm24],%rs W[%sp+imm24] ← %rs(15:0)
xld.a
[%sp+imm24],%rs A[%sp+imm24](23:0) ← %rs(23:0), A[%sp+ imm20](31:24) ← 0
These extended instructions allow you to directly specify a displacement of up to 20 bits/24 bits. Specification of imm20/imm24
can be omitted.
Basic instructions after expansion
sld.b, xld.b
sld.ub, xld.ub
sld, xld
sld.a, xld.a
 Expansion formats
If imm20/imm24 is omitted, the as assembler assumes that [%sp+0x0] is specified as it expands the instruction.
(1) sOP %rd,[%sp+imm20]
sOP [%sp+imm20],%rs
Example: sld.a %rd,[%sp+imm20]
imm20  0x7f
ld.a %rd,[%sp+imm20(6:0)]
(2) xOP %rd,[%sp+imm24]
xOP [%sp+imm24],%rs
Example: xld.a %rd,[%sp+imm24]
imm24  0x7f
ld.a %rd,[%sp+imm24(6:0)]
S5U1C17001C Manual
(Rev. 1.0)
Expanded into the ld.b instruction
Expanded into the ld.ub instruction
Expanded into the ld instruction
Expanded into the ld.a instruction
(OP = ld.b, ld.ub, ld, ld.a)
(OP = ld.b, ld, ld.a)
ext
imm20(19:7)
ld.a %rd,[%sp+imm20(6:0)]
(OP = ld.b, ld.ub, ld, ld.a)
(OP = ld.b, ld, ld.a)
0x7f < imm24  0xfffff
ext
imm24(19:7)
ld.a %rd,[%sp+imm24(6:0)]
Seiko Epson Corporation
Function
0x7f < imm20
ext
ext
ld.a %rd,[%sp+imm24(6:0)]
Expansion
0xfffff < imm24
imm24(23:20)
imm24(19:7)
6 Assembler
(1)
(1)
(1)
(1)
(1)
(1)
(1)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
6-17

Advertisement

Table of Contents
loading

Table of Contents