
S1C17 CORE MANUAL
Seiko Epson Corporation
7-3
(Rev. 1.2)
adc
%rd, %rs
adc/c %rd, %rs
adc/nc %rd, %rs
Function
16-bit addition with carry
Standard)
rd
(15:0)
←
rd
(15:0) +
rs
(15:0) + C,
rd
(23:16)
←
0
Extension 1)
rd
(15:0)
←
rs
(15:0) +
imm13
(zero extended) + C,
rd
(23:16)
←
0
Extension 2)
rd
(15:0)
←
rs
(15:0) +
imm16
+ C,
rd
(23:16)
←
0
Code
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 1 1 1 0
r d
1 0 0 1
r s
adc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 1 1 1 0
r d
0 0 0 1
r s
adc/c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 1 1 1 0
r d
0 1 0 1
r s
adc/nc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Flag
IL IE C V Z N
– –
↔
↔
↔
↔
adc
|
|
|
| |
– – –
↔
↔
↔
adc/c
,
adc/nc
|
|
|
| |
Mode
Src: Register direct
%rs
=
%r0
to
%r7
Dst: Register direct
%rd
=
%r0
to
%r7
CLK
One cycle
Description
(1) Standard
adc %rd,%rs
; rd
←
rd + rs + C
The content of the
rs
register and C (carry) flag are added to the
rd
register. The operation is
performed in 16-bit size, and bits 23–16 of the
rd
register are set to 0.
(2) Extension 1
ext imm13
adc %rd,%rs
; rd
←
rs + imm13 + C
The 13-bit immediate
imm13
and C (carry) flag are added to the content of the
rs
register after
being zero-extended, and the result is loaded into the
rd
register. The operation is performed
in 16-bit size, and bits 23–16 of the
rd
register are set to 0. The content of the
rs
register is not
altered.
(3) Extension 2
ext imm3
;
imm3(2:0) = imm16(15:13)
ext imm13
; = imm16(12:0)
adc %rd,%rs
; rd
←
rs + imm16 + C
The 16-bit immediate
imm16
and C (carry) flag are added to the content of the
rs
register, and
the result is loaded into the
rd
register. The operation is performed in 16-bit size, and bits 23–16
of the
rd
register are set to 0. The content of the
rs
register is not altered.
(4) Conditional execution
The
/c
or
/nc
suffix on the opcode specifies conditional execution.
adc/c
Executed as
adc
when the C flag is 1 or executed as
nop
when the flag is 0
adc/nc
Executed as
adc
when the C flag is 0 or executed as
nop
when the flag is 1
In this case, the
ext
instruction can be used to extend the operand.
(5) 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. In this case, extension of the immediate by the
ext
instruction cannot be performed.
Example
(1)
adc %r0,%r1
; r0 = r0 + r1 + C
(2) Addition of 32-bit data, data 1 = {r2, r1}, data 2 = {r4, r3}, result = {r2, r1}
add %r1,%r3
; Addition of the low-order word
adc %r2,%r4
; Addition of the high-order word