This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Miscellaneous Instructions

Miscellaneous instructions

Table of Contents

1 - NOP No Operation

76543210
0000000000
Opcode Matrix
NOP
OP
NOP
0014
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Special

2 - CPL Invert Accumulator

\(A \longleftarrow \overline{A}\)

76543210
001011112F
Flags Affected
Flags
---h--n-
hset
nset
Opcode Matrix
CPL
OP
CPL
2F14
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register

3 - NEG Negate Accumulator (two's compliment)

\(A \longleftarrow 0 - A\)

76543210
11101101ED
0100010044
Flags Affected
Flags
sz-h-p/vnc
sset if result is negative
zset if result is 0
hset if borrow from bit 4
p/vset if Accumulator was 0x80 before operation
nset
cset if Accumulator was not 0x00 before operation
Opcode Matrix
NEG
OP
NEG
ED4424
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register

4 - HALT the cpu

76543210
0111011076
Opcode Matrix
HALT
OP
HALT
7614
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Special

5 - CCF Compliment Carry Flag

Invert Carry Flag

\(CY \longleftarrow \overline{CY}\)

76543210
001111113F
Flags Affected
Flags
---h---c
hprevious carry is copied
cset if C was 0, reset if C was 1
Opcode Matrix
CCF
OP
CCF
3F14
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register

6 - SCF Set Carry Flag

Set Carry Flag

\(CY \longleftarrow 1\)

76543210
0011011137
Flags Affected
Flags
---h--nc
hreset
nreset
cset
Opcode Matrix
CPLNEGCCFSCF
OP
CPL
2F14
NEG
ED4424
CCF
3F14
SCF
3714
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register

7 - DI EI Interrupt enable

Enable/Disable interrupts
76543210
 
\(IFF \longleftarrow 0\)
DI
11110011
 
\(IFF \longleftarrow 1\)
EI
11111011
Opcode Matrix
EIDI
OP
EI
FB14
DI
F314
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Interrupt

8 - IM Interrupt Mode

Select interrupt mode
76543210
11101101ED
010QQ110

Note: Only modes 0, 1 and 2 are valid for IM n.

Opcode Matrix
IM0IM1IM2
OP
IM0
ED4628
IM1
ED5628
IM2
ED5E28
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Interrupt

9 - DAA

Adjust accumulator for BCD addition and subtraction operations

\(@\)

76543210
0010011127
Flags Affected
Flags
-z-h-p/v-c
zSet if Accumulator is 0
hVaries
p/vSet if Accumulator parity is even, reset if odd
cVaries
Opcode Matrix
DAA
OP
DAA
2714
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register