![Epson S1C17 Series Manual Download Page 83](http://html.mh-extra.com/html/epson/s1c17-series/s1c17-series_manual_107781083.webp)
7-24
Seiko Epson Corporation
S1C17 CORE MANUAL
(REV. 1.2)
cmp.a
%rd, %rs
cmp.a/c %rd, %rs
cmp.a/nc %rd, %rs
Function
24-bit comparison
Standard)
rd
(23:0) -
rs
(23:0)
Extension 1)
rs
(23:0) -
imm13
(zero extended)
Extension 2)
rs
(23:0) -
imm24
Code
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 1 1 0 1
r d
1 0 0 0
r s
cmp.a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 1 1 0 1
r d
0 0 0 0
r s
cmp.a/c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 0 1 1 0 1
r d
0 1 0 0
r s
cmp.a/nc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Flag
IL IE C V Z N
– –
↔
–
↔
–
cmp.a
|
|
|
| |
– – – –
↔
–
cmp.a/c
,
cmp.a/nc
|
|
|
| |
Mode
Src: Register direct
%rs
=
%r0
to
%r7
Dst: Register direct
%rd
=
%r0
to
%r7
CLK
One cycle
Description
(1) Standard
cmp.a %rd,%rs ;
rd - rs
Subtracts the contents of the
rs
register from the contents of the
rd
register, and sets or resets the
flags (C and Z) according to the results. It does not change the contents of the
rd
register.
(2) Extension 1
ext imm13
cmp.a %rd,%rs ;
rs - imm13
Subtracts the 13-bit immediate
imm13
from the contents of the
rs
register, and sets or resets the
flags (C and Z) according to the results. The
imm13
is zero-extended into 24 bits prior to the
operation. It does not change the contents of the
rd
and
rs
registers.
*
This combination does not use the
rd
register value for comparison.
(3) Extension 2
ext imm11
; imm11(10:0) = imm24(23:13)
ext imm13
; = imm24(12:0)
cmp.a %rd,%rs ;
rs - imm24
Subtracts the 24-bit immediate
imm24
from the contents of the
rs
register, and sets or resets
the flags (C and Z) according to the results. It does not change the contents of the
rd
and
rs
registers.
*
This combination does not use the
rd
register value for comparison.
(4) Conditional execution
The
/c
or
/nc
suffix on the opcode specifies conditional execution.
cmp.a/c
Executed as
cmp.a
when the C flag is 1 or executed as
nop
when the flag is 0
cmp.a/nc
Executed as
cmp.a
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.
The conditional execution instruction above sets/resets the flags (V and Z) according to the
results if it is executed.