3 INSTRUCTION SET

DEC Mn

Decrement memory

 

 

 

 

 

 

 

 

 

Source Format:

DEC Mn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operation:

M(n3 to n0)

M(n3 to n0) - 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

1

 

1

1

1

0

1

1

1

n3

n2

n1

n0

 

F70H to F7FH

 

MSB

 

 

 

 

 

 

 

LSB

 

 

 

 

 

Type:

IV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Cycles:

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

C – Set if a borrow is generated; otherwise, reset.

 

 

 

 

Z – Set if the result is zero; otherwise, reset.

 

 

 

 

 

 

D – Not affected

 

 

 

 

 

 

 

 

 

 

I

– Not affected

 

 

 

 

 

 

 

 

 

Description:

Decrements the contents of the data memory location addressed by Mn by 1.

Example:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DEC M0

 

DEC M2

 

DEC M0FH

 

Memory (00H)

1001

 

 

1000

 

 

1000

 

1000

 

 

Memory (02H)

0000

 

 

0000

 

 

1111

 

1111

 

 

Memory (0FH)

0001

 

 

0001

 

 

0001

 

0000

 

 

C flag

1

 

 

0

 

 

1

 

0

 

 

Z flag

0

 

 

0

 

 

0

 

1

 

DEC SP

Decrement stack pointer

 

Source Format:

DEC SP

 

Operation:

SP

SP - 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

1

 

1

 

1

1

1

1

0

0

1

0

1

1

 

FCBH

 

MSB

 

 

 

 

 

 

 

 

 

 

LSB

 

Type:

VI

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Cycles:

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

C – Not affected

 

 

Z – Not affected

 

 

D – Not affected

 

 

I

– Not affected

 

Description: Decrements the contents of the stack pointer by 1. This operation does not affect the flags.

Example:

 

DEC SP

 

Memory (SP)

1011 0001

1011 0000

 

C flag

0

0

 

Z flag

1

1

38

EPSON

S1C6200/6200A CORE CPU MANUAL