Hcs08 Instr Summary
Hcs08 Instr Summary
0 = Bit forced to 0
1 = Bit forced to 1
↕ = Bit set or cleared according to results of operation
U = Undefined after the operation
Machine coding notation
dd = Low-order 8 bits of a direct address 0x0000–0x00FF (high byte assumed to be 0x00)
ee = Upper 8 bits of 16-bit offset
ff = Lower 8 bits of 16-bit offset or 8-bit offset
ii = One byte of immediate data
jj = High-order byte of a 16-bit immediate data value
kk = Low-order byte of a 16-bit immediate data value
hh = High-order byte of 16-bit extended address
ll = Low-order byte of 16-bit extended address
pg = Page
rr = Relative offset
Source form
Everything in the source forms columns, except expressions in italic characters, is literal information that
must appear in the assembly source file exactly as shown. The initial 3- to 5-letter mnemonic is always a
literal expression. All commas, pound signs (#), parentheses, and plus signs (+) are literal characters.
n — Any label or expression that evaluates to a single integer in the range 0–7
opr8i — Any label or expression that evaluates to an 8-bit immediate value
opr16i — Any label or expression that evaluates to a 16-bit immediate value
opr8a — Any label or expression that evaluates to an 8-bit value. The instruction treats this 8-bit
value as the low order 8 bits of an address in the direct page of the 64-Kbyte address
space (0x00xx).
opr16a — Any label or expression that evaluates to a 16-bit value. The instruction treats this
value as an address in the 64-Kbyte address space.
oprx8 — Any label or expression that evaluates to an unsigned 8-bit value, used for indexed
addressing
oprx16 — Any label or expression that evaluates to a 16-bit value. Because the HCS08 has a
16-bit address bus, this can be either a signed or an unsigned value.
page — Any label or expression that evaluates to a valid bank number for the PPAGE register.
For a 128-Kbyte deravative, any value between 0 and 7 is valid.
rel — Any label or expression that refers to an address that is within –128 to +127 locations
from the next address after the last byte of object code for the current instruction. The
assembler will calculate the 8-bit signed offset and include it in the object code for this
instruction.
Address modes
INH = Inherent (no operands)
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
DIR (b0) 11 dd 5
DIR (b1) 13 dd 5
DIR (b2) 15 dd 5
BCLR n,opr8a Clear Bit n in Memory Mn ← 0 – – – – – – DIR (b3)
DIR (b4)
17
19
dd
dd
5
5
DIR (b5) 1B dd 5
DIR (b6) 1D dd 5
DIR (b7) 1F dd 5
Branch if Carry Bit Set
BCS rel (Same as BLO) Branch if (C) = 1 – – – – – – REL 25 rr 3
BIH rel Branch if IRQ Pin High Branch if IRQ pin = 1 – – – – – – REL 2F rr 3
BIL rel Branch if IRQ Pin Low Branch if IRQ pin = 0 – – – – – – REL 2E rr 3
BIT #opr8i IMM A5 ii 2
BIT opr8a DIR B5 dd 3
BIT opr16a EXT C5 hh ll 4
(A) & (M)
BIT oprx16,X ↕ – IX2 D5 ee ff 4
BIT oprx8,X Bit Test (CCR Updated but Operands 0 – – ↕ IX1 E5 ff 3
Not Changed)
BIT ,X IX F5 3
BIT oprx16,SP SP2 9ED5 ee ff 5
BIT oprx8,SP SP1 9EE5 ff 4
Branch if Less Than
BLE rel or Equal To Branch if (Z) | (N ⊕ V) = 1 – – – – – – REL 93 rr 3
(Signed Operands)
Branch if Lower
BLO rel (Same as BCS) Branch if (C) = 1 – – – – – – REL 25 rr 3
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
DIR (b0) 01 dd rr 5
DIR (b1) 03 dd rr 5
DIR (b2) 05 dd rr 5
Branch if Bit n in Memory
BRCLR n,opr8a,rel Clear Branch if (Mn) = 0 – – – – – ↕ DIR (b3)
DIR (b4)
07
09
dd
dd
rr
rr
5
5
DIR (b5) 0B dd rr 5
DIR (b6) 0D dd rr 5
DIR (b7) 0F dd rr 5
BRN rel Branch Never Uses 3 Bus Cycles – – – – – – REL 21 rr 3
DIR (b0) 00 dd rr 5
DIR (b1) 02 dd rr 5
DIR (b2) 04 dd rr 5
Branch if Bit n in Memory
BRSET n,opr8a,rel Set Branch if (Mn) = 1 – – – – – ↕ DIR (b3)
DIR (b4)
06
08
dd
dd
rr
rr
5
5
DIR (b5) 0A dd rr 5
DIR (b6) 0C dd rr 5
DIR (b7) 0E dd rr 5
DIR (b0) 10 dd 5
DIR (b1) 12 dd 5
DIR (b2) 14 dd 5
BSET n,opr8a Set Bit n in Memory Mn ← 1 – – – – – – DIR (b3)
DIR (b4)
16
18
dd
dd
5
5
DIR (b5) 1A dd 5
DIR (b6) 1C dd 5
DIR (b7) 1E dd 5
PC ← (PC) + 0x0002
push (PCL); SP ← (SP) – 0x0001
BSR rel Branch to Subroutine push (PCH); SP ← (SP) – 0x0001 – – – – – – REL AD rr 5
PC ← (PC) + rel
PC ← PC + 4
Push (PCL); SP ← (SP) – 0x0001
Push (PCH); SP ← (SP) – 0x0001
Push (PPAGE); SP ← (SP) – 0x0001 – – – – – – EXT
CALL page, opr16a Call Subroutine AC pghll 8
PPAGE ← page
PC ← Unconditional Address
CBEQ opr8a,rel Branch if (A) = (M) DIR 31 dd rr 5
CBEQA #opr8i,rel Branch if (A) = (M) IMM 41 ii rr 4
CBEQX #opr8i,rel Compare and Branch if Branch if (X) = (M) IMM 51 ii rr 4
CBEQ oprx8,X+,rel Equal Branch if (A) = (M) – – – – – – IX1+ 61 ff rr 5
CBEQ ,X+,rel Branch if (A) = (M) IX+ 71 rr 5
CBEQ oprx8,SP,rel Branch if (A) = (M) SP1 9E61 ff rr 6
CLC Clear Carry Bit C←0 – – – – – 0 INH 98 1
CLI Clear Interrupt Mask Bit I←0 – – 0 – – – INH 9A 1
CLR opr8a M ← 0x00 DIR 3F dd 5
CLRA A ← 0x00 INH 4F 1
CLRX X ← 0x00 INH 5F 1
CLRH Clear H ← 0x00 0 – – 0 1 – INH 8C 1
CLR oprx8,X M ← 0x00 IX1 6F ff 5
CLR ,X M ← 0x00 IX 7F 4
CLR oprx8,SP M ← 0x00 SP1 9E6F ff 6
CMP #opr8i IMM A1 ii 2
CMP opr8a DIR B1 dd 3
CMP opr16a EXT C1 hh ll 4
(A) – (M)
CMP oprx16,X Compare Accumulator IX2 D1 ee ff 4
(CCR Updated But Operands Not ↕ – – ↕ ↕ ↕ IX1
CMP oprx8,X with Memory E1 ff 3
Changed)
CMP ,X IX F1 3
CMP oprx16,SP SP2 9ED1 ee ff 5
CMP oprx8,SP SP1 9EE1 ff 4
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C
Bus Cycles1
Effect
Operand
Address
Opcode
on CCR
Mode
Source
Operation Description
Form
V H I N Z C