beautypg.com

Sub [%ir],%r sub [%ir]+,%r – Epson S1C63000 User Manual

Page 143

background image

S1C63000 CORE CPU MANUAL

EPSON

137

CHAPTER 4: INSTRUCTION SET

SUB [%ir],%r

SUB [%ir]+,%r

Subtract r reg. from location [ir reg.] and increment ir reg.

2 cycles

Function:

[ir]

[ir] - r, ir

ir + 1

Subtracts the content of the r register (A or B) from the data memory addressed by the ir
register (X or Y). Then increments the ir register (X or Y). The flags change due to the operation
result of the data memory and the increment result of the ir register does not affect the flags.

Code:

Mnemonic

MSB

LSB

SUB [%X]+,%A

1

1

0

0

0

0

1

1

0

1

0

0

1

1869H

SUB [%X]+,%B

1

1

0

0

0

0

1

1

0

1

1

0

1

186DH

SUB [%Y]+,%A

1

1

0

0

0

0

1

1

0

1

0

1

1

186BH

SUB [%Y]+,%B

1

1

0

0

0

0

1

1

0

1

1

1

1

186FH

Flags:

E

I

C

Z

Mode:

Src: Register direct
Dst: Register indirect
Extended addressing: Invalid

Subtract r reg. from location [ir reg.]

2 cycles

Function:

[ir]

[ir] - r

Subtracts the content of the r register (A or B) from the data memory addressed by the ir
register (X or Y).

Code:

Mnemonic

MSB

LSB

SUB [%X],%A

1

1

0

0

0

0

1

1

0

1

0

0

0

1868H

SUB [%X],%B

1

1

0

0

0

0

1

1

0

1

1

0

0

186CH

SUB [%Y],%A

1

1

0

0

0

0

1

1

0

1

0

1

0

186AH

SUB [%Y],%B

1

1

0

0

0

0

1

1

0

1

1

1

0

186EH

Flags:

E

I

C

Z

Mode:

Src: Register direct
Dst: Register indirect
Extended addressing: Valid

Extended

LDB

%EXT,imm8

operation:

SUB

[%X],%r

[00imm8]

[00imm8] - r (00imm8 = 0000H + 00H to FFH)

LDB

%EXT,imm8

SUB

[%Y],%r

[FFimm8]

[FFimm8] - r (FFimm8 = FF00H + 00H to FFH)