7 DETAILS OF INSTRUCTIONS
7-72
EPSON
S1C17 FAMILY S1C17 CORE MANUAL
ld.a [%sp], %rs
ld.a [%sp]+, %rs
ld.a [%sp]-, %rs
ld.a -[%sp], %rs
Function
32-bit data transfer
ld.a [%sp], %rs
Standard)
A[sp](23:0)
← rs(23:0), A[sp](31:24) ← 0
Extension 1) A[sp + imm13](23:0)
← rs(23:0), A[sp + imm13](31:24) ← 0
Extension 2) A[sp + imm24](23:0)
← rs(23:0), A[sp + imm24](31:24) ← 0
ld.a [%sp]+, %rs (with post-increment option)
Standard)
A[sp](23:0)
← rs(23:0), A[sp](31:24) ← 0, sp(23:0) ← sp(23:0) + 4
Extension 1) A[sp + imm13](23:0)
← rs(23:0), A[sp + imm13](31:24) ← 0, sp(23:0) ← sp(23:0) + imm13
Extension 2) A[sp + imm24](23:0)
← rs(23:0), A[sp + imm24](31:24) ← 0, sp(23:0) ← sp(23:0) + imm24
ld.a [%sp]-, %rs (with post-decrement option)
Standard)
A[sp](23:0)
← rs(23:0), A[sp](31:24) ← 0, sp(23:0) ← sp(23:0) - 4
Extension 1) A[sp + imm13](23:0)
← rs(23:0), A[sp + imm13](31:24) ← 0, sp(23:0) ← sp(23:0) - imm13
Extension 2) A[sp + imm24](23:0)
← rs(23:0), A[sp + imm24](31:24) ← 0, sp(23:0) ← sp(23:0) - imm24
ld.a -[%sp], %rs (with pre-decrement option)
Standard)
sp(23:0)
← sp(23:0) - 4, A[sp](23:0) ← rs(23:0), A[sp](31:24) ← 0
Extension 1) sp(23:0)
← sp(23:0) - imm13, A[sp + imm13](23:0) ← rs(23:0), A[sp + imm13](31:24) ← 0
Extension 2) sp(23:0)
← sp(23:0) - imm24, A[sp + imm24](23:0) ← rs(23:0), A[sp + imm24](31:24) ← 0
Code
15 14 13 12 11 10
9
8
7
6
5
4
3
2
1
0
0 0 1 1 1 1
r s
0 0 1 1 1 0 0
ld.a
[%sp],%rs
|
0 0 1 1 1 1
r s
0 1 1 1 1 0 0
ld.a
[%sp]+,%rs
|
0 0 1 1 1 1
r s
1 1 1 1 1 0 0
ld.a
[%sp]-,%rs
|
0 0 1 1 1 1
r s
1 0 1 1 1 0 0
ld.a
-[%sp],%rs
|
Flag
IL IE
C
V
Z
N
– – – – – –
|
Mode
Src:Register direct %rs = %r0 to %r7
Dst:Register indirect %sp
CLK
One cycle (two cycles when the ext instruction or an increment/decrement option is used)
Description (1) Standard
ld.a
[%sp],%rs
; memory address = sp
The content of the rs register (24-bit data) is transferred to the specified memory location. The
SP contains the memory address to be accessed. This instruction writes 32-bit data with the
eight high-order bits set to 0 in the memory.
(2) Extension 1
ext
imm13
ld.a
[%sp],%rs
; memory address = sp + imm13
The ext instruction changes the addressing mode to register indirect addressing with
displacement. As a result, the content of the rs register is transferred to the address indicated
by the content of the SP with the 13-bit immediate imm13 added. The content of the SP is not
altered.