CHAPTER 4: INSTRUCTION SET

SUB %r,[%ir]

Subtract location [ir reg.] from r reg.

 

 

 

 

 

1 cycle

Function: r ← r - [ir]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

register (A or B).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Code:

Mnemonic

MSB

 

 

 

 

 

 

 

 

 

 

 

LSB

 

 

 

SUB %A,[%X]

 

1

 

1

 

0

0

0

0

1

1

0

0

0

0

 

0

1860H

 

 

SUB %A,[%Y]

 

1

 

1

 

0

0

0

0

1

1

0

0

0

1

 

0

1862H

 

 

SUB %B,[%X]

 

1

 

1

 

0

0

0

0

1

1

0

0

1

0

 

0

1864H

 

 

SUB %B,[%Y]

 

1

 

1

 

0

0

0

0

1

1

0

0

1

1

 

0

1866H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flags:

E

I

 

C

 

Z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Mode:

Src: Register indirect

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dst: Register direct

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Extended addressing: Valid

 

 

 

 

 

 

 

 

 

 

 

 

 

Extended

LDB

%EXT,imm8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

operation: SUB

%r,[%X]

 

r

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

 

LDB

%EXT,imm8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB

%r,[%Y]

 

r

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

SUB %r,[%ir]+

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

1 cycle

Function: r ←

r - [ir], ir ←

ir + 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

register (A or B). Then increments the ir register (X or Y). The flags change due to the operation

 

result of the r register and the increment result of the ir register does not affect the flags.

 

Code:

Mnemonic

 

MSB

 

 

 

 

 

 

 

 

 

 

LSB

 

 

 

SUB %A,[%X]+

 

1

 

1

0

0

0

0

1

1

0

0

0

0

 

1

1861H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB %A,[%Y]+

 

1

 

1

0

0

0

0

1

1

0

0

0

1

 

1

1863H

 

 

SUB %B,[%X]+

 

1

 

1

0

0

0

0

1

1

0

0

1

0

 

1

1865H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB %B,[%Y]+

 

1

 

1

0

0

0

0

1

1

0

0

1

1

 

1

1867H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flags:

E

 

I

C

 

 

Z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Mode:

Src: Register indirect

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dst: Register direct

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Extended addressing: Invalid

 

 

 

 

 

 

 

 

 

 

 

 

 

136

EPSON

S1C63000 CORE CPU MANUAL