CMP (8 bit, set flags according to subtraction result)

January 6, 2021 ยท View on GitHub

Opcode

76543210Notes
01001rNot valid when r = 1

Operation

F <- Flags[T - Reg8[r]]
PC <- PC + 1

Assembler syntax examples

CMP T,F
CMP C

CMP (8 bit, set flags according to subtraction result)

Opcode

76543210
10101r

Operation

PC <- PC + 1
Reg8[r] <- Flags[Reg8[r] - Code[PC]]
PC <- PC + 1

Assembler syntax examples

CMP T,42
CMP H,-87

CMP (16 bit, set flags according to subtraction result)

Opcode

76543210Notes
110011rNot valid when r = 0

Operation

F <- Flags[FT - Reg16[r]]
PC <- PC + 1

Assembler syntax examples

CMP FT,BC
CMP HL