FANDOM


68kchip
A full version of the Crib sheet below can be downloaded in Word format from the Crib Sheets page.







CPU Model

 

 D0-D7 (8x32 bit)

data registers

 

 

 

 

A0-A6 (7x32 bit)

addr registers

 

 

 

 

 A7

stack pointer 

 

 

 

 

 

PC (24bit)

program counter

 

 

 

 

T

*

S

*

*

I2

I1

I0

*

*

*

X

N

Z

V

C

16 bit Status

 

 

Data Operation

 

B

Byte (8 bit)

 

W

word (16 bit)

 

L

long-word (32bit)

 

Status Flags

 

Logic Operators

User

 

OpWord

Description

Store

Flags

C

Carry

 

 Operand1

Operand2

V

Overflow

 

AND

mem

Dx

Op2

N,Z,V,C

Z

Zero

 

 

Dx

mem/Dx/Ax

Op2

N,Z,V,C

N

Negative 

 

OR

mem

Dx

 Op2

N,Z,V,C

X

Extend

 

 

Dx

mem/Dx/Ax

 Op2

N,Z,V,C

System

 

EOR

Dx

mem/Dx

 Op2

N,Z,V,C

I

Interrupt  

 

 

 

 

 

 

S

State  

 

NOT

mem/Dx

 Op1

N,Z,V,C

T

Trace Mode

 

 

 

 

 

 

 

 

 

 

 

 

Addressing Rules

1. Byte operands can be accessed from either an odd or even address

2. Word and long-word operands must be accessed from an even address

 

Addressing Mode

Form

Description

Implied

Op-Word

No parameter

Immediate

Op-Word  #4BN

4BN is Data

Quick Immediate

Op-Word  #2BN

2BN is Data

Absolute long

Op-Word    4BN

4BN is memory location of Data

Absolute short

Op-Word    2BN

2BN is memory location of Data

D Register Direct

Op-Word   Dx

Dx is Data

A Register Direct

Op-Word    Ax

Dx is Data

Register Indirect

Op-Word   (Ax)

Ax is address of memory location of Data

Register Indirect - post increment

Op-Word   (Ax)+

Ax+inc is address of memory location of Data

Register Indirect - pre decrement

Op-Word -(Ax)

Ax-inc is address of memory location of Data

Register Indirect - displacement

Op-Word dis(Ax)

Ax+dis is address of memory location of Data

Register Indirect - index

Op-Word dis(Ax,ind)

Ax+dis+ind is address of memory location of Data

Program Counter Relative with displacement

Op-Word     dis

ind+PC is memory location of Data

Program Counter Relative with index

Op-Word    dis(ind)

dis+ind+PC is memory location of Data

 

dis

 B= 1

W = 2

L = 4

ind

address or data register used as index register

 

 

Addressing Mode Categories

Category

Description

Data

effective addressing mode can be used to refer to data operands.

Memory

effective addressing mode can be used  to refer to memory operands.

Control

effective addressing mode can be used  to refer to memory operands without associated size.

Alterable

effective addressing mode can be used  to refer to writable operands. 

 

Addressing Mode

Addressing Category

Data

Memory

Control

Alterable

Immediate

x

x

 

 

Absolute long

x

x

x

x

Absolute short

x

x

x

x

D Register Direct

x

x

x

x

A Register Direct

 

 

 

x

Register Indirect

x

x

x

x

Register Indirect - post increment

x

x

 

x

Register Indirect - pre decrement

x

x

 

x

Register Indirect - displacement

x

x

x

x

Register Indirect - index

x

x

x

x

Program Counter Relative with displacement

x

x

x

 

Program Counter Relative with index

x

x

 

 

 

 

Branch on Status Flag

Flag

Description

Branch if Set

Branch if Not Set

Clear

C

Carry -greater/equal

BCS

BCC

 

Z

Zero - equal

BEQ

BNE

-

V

Overflow - signed arithmetic

BVS

BVC

 

N

Negative - high bit

BMI

BPL

-

 

Branch 

Flag Test

Branch 

Flag Test

BGT

Z AND(N EOR V)=0

BLE

Z AND(N EOR V)=1

BLT

N EOR V =1

BHI

C AND Z = 0

BGE

N EOR V =0

BLS

C OR Z = 1

Shift and Rotation (B,W or L)

 

OpWord

Action

 

ASL/LSL

 

Arithmetic/Logical Shift Left Dx or memory location bits shifted out go into C and X flags.

 

 

C

<

 

<

0

 

X

 

 

 

 

 

 

OpWord

Action

 

ASR/LSR

 

 

Arithmetic/Logical Shift Right Accumulator or memory location bits shifted out go into C and X flags.

 

 

0

>

 

>

C

 

 

 

 

 

X

 

 

OpWord

Action

 

ROL

 

Rotate Left Dx or memory location  bits shifted out of one end enter the opposite end and C.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 <

 

 <

 

 C

 

 

 

 

 

 

OpWord

Action

ROR

 

Rotate Right Dx or memory location  bits shifted out of one end enter the opposite end and C.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 >

 

 >

 

 

 

 

 

 

OpWord

Action

 

ROLX

 

Rotate Left Dx or memory location bits shifted out go into C and into X before entering the opposite end.

 

 

 

 

 

 

 

 

 

 

X

 

 

 

 

 

 

 

>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 <

 

 <

 

 C

 

 

 

 

 

 

OpWord

Action

RORX

 

Rotate Right Dx or memory location bits shifted out go into C and into X before entering the opposite end.

 

 

 

 

X

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

>

 

 >