Mitsubishi M16C/60 Series Software Manual page 59

16-bit single-chip microcomputer
Hide thumbs Also See for M16C/60 Series:
Table of Contents

Advertisement

C M P
Op e r a t io n :
When (T) = 0, (A) – (M)
F u n c t io n :
When T = 0, this instruction subtracts the contents of M from
the contents of A. The result is not stored and the contents of
A or M are not modified.
When T = 1, the CMP subtracts the contents of M from the
contents of M(X). The result is not stored and the contents of
X, M, and A are not modified.
M(X) represents the contents of memory where is indicated by
X.
St a t u s fla g :
N :
V :
T :
B :
I :
D :
Z :
C :
Addressing mode
∆CMP∆#$nn
Immediate
∆CMP∆$zz
Zero page
∆CMP∆$zz,X
Zero page X
∆CMP∆$hhll
Absolute
∆CMP∆$hhll,X
Absolute X
∆CMP∆$hhll,Y
Absolute Y
∆CMP∆($zz,X)
(Indirect X)
∆CMP∆($zz),Y
(Indirect Y)
Note: When T=1, add 1 to the cycle number.
C
O
(T) = 1, (M(X)) – (M)
N is 1 when bit 7 of the operation result is 1 after the
operation; otherwise N is 0.
No change
No change
No change
No change
No change
Z is 1 when the operation result is 0; otherwise Z is 0.
C is 1 when the subtracted result is equal to or greater
than 0; otherwise C is 0.
Statement
MP
ARE
Machine codes
C9
, nn
16
16
C5
, zz
16
16
D5
, zz
16
16
CD
, ll
, hh
16
16
16
DD
ll
, hh
16,
16
16
D9
, ll
, hh
16
16
16
C1
, zz
16
16
D1
, zz
16
16
C M P
Byte number
Cycle number
2
2
2
3
2
4
3
4
3
5
3
5
2
6
2
6
53

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/20 series

Table of Contents