25.04.2020 Views

1989_MELPS_7700_Software_Manual

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

Mitsubishi MELPS 7700 series microcomputer instruction set and addressing mode handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CMP Compare CMP

Operation

Acc - M

Description

Subtracts the contents of memory from the contents of the accumulator. The

accumulator and memory contents are not changed.

Status flags

IPL :

N

V

m

x

D

I

Not affected.

Set to 1 when bit 15 (or bit 7 if the data length selection flag m is set to 1) of

the operation result is 1. Otherwise, cleared to O.

Not affected.

Not affected.

Not affected.

Not affected.

Not affected.

Z Set to 1 when the result of operation is O. Otherwise, cleared to O.

C Set to 1 if the result of operation is 0 or larger. Otherwise, cleared to O.

Addressing mode Syntax Machine code Bytes Cycles

Immediate CMP A, #imm C91S, imm 2 2

Oirect CMP A, dd C51S, dd 2 4

Direct indexed X CMP A, dd, X 051S, dd 2 5

Direct indirect CMP A, (dd) 021S, dd 2 6

Oirect indexed X indirect CMP A, (dd, X) C11S, dd 2 7

Direct indirect indexed Y CMP A, (dd), Y 011S, dd 2 8

Direct indirect long CMPL A, (dd) C71S, dd 2 10

Direct indirect long indexed Y CMPL A, (dd), Y 071S, dd 2 11

Absolute CMP A, mmll C01S, II, mm 3 4

Absolute indexed X CMP A, mmll, X OD1S, II, mm 3 6

Absolute indexed Y CMP A, mmll, Y 091S, II, mm 3 6

Absolute long CMP A, hhmmll CF1S, II, mm, hh 4 6

Absolute long indexed X CMP A, hhmmll, X OF1S, II, mm, hh 4 7

Stack pointer relative CMP A, nn, S C31S, nn 2 5

Stack pointer relative CMP A, (nn, S), Y D31S, nn 2 8

indirect indexed Y

(Notel) This table applies when using the accumulator A. If using the accumulator B, replace "A" with "B".

In this case, "421S" is added at the beginning of the machine code, the bytes-count increases by

1 and the cycles-count increases by 2.

(Note2) When operating on 16-bit data in the immediate addressing mode with the data length selection

flag m set to 0, the bytes-count increases by 1.

80

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!