FANDOM


Arm-chip

Some important things to note about ARM instructions:

  • Apart from the Load and Store commands all instructions are performed on registers. ie access to memory is by these commands only.
  • All instructions can have relevant condition codes appended as a suffix.
  • All instructions can have an 'S' suffix which means update flags. ie any command without an 'S' wil not affect any flags.
  • The most common structure of an ARM instruction is:

Code {condition}{S} dest, operand1, operand2

where the destination and operand1 are registers and operand2 may be a register or a number.

Note the ARM description given below is for the early versions which had a 26bit PC, processors from the ARM6 onwards used a 32bit PC with a separate status register. Although the ARM6 and 7 had a 26bit mode as the Acorn machines RISC OS did not support 32bit addressing; consequently for the purposes of programming 90's machines the model below will do.  The first version to be fully 32bit was RiscOS 5 in the Iyonix in 2002 well after Acorn's demise.

The Crib sheet below can be downloaded in Word format from the Crib Sheets page.

 

CPU Model

 

 

R0-R13

 

14 x 32 bit Registers

 

 

 

 

 

R14

 

Link Register

N

Z

C

V

I

F

 

R15

 

S1

S0

PC (26bit) and Status(8bit)

 

 

 

 

 

Status Flags

 

Logic Operators

 

User

 

OpCode

Description

Store

F

FIRQ

 

 Operand2

Operand3

Operand1

I

IRQ

 

AND

Rx

Rx

Rx

V

Overflow

 

ORR

Rx

Rx

Rx

C

Carry

 

EOR

Rx

Rx

Rx

Z

 Zero

 

 

 

 

 

 

N

 Negative 

 

NOT

Operand

 

 

 

 

 

Condition Codes

 

 Code

Flags

Description

EQ

Z Set

equal

NE

Z Clear

not equal

CS

C Set

unsigned higher or same

CC

C Clear

unsigned lower

MI

N Set

negative

PL

N Clear

positive or zero

VS

V Set

overflow

VC

V Clear

no overflow

HI

C Set or Z Clear

unsigned higher

LS

C Clear or Z Set

unsigned lower or same

GE

N equals V

greater or equal

LT

N not equal to V

less than

GT

Z Clear AND (N equals V)

greater than

LE

Z Set OR (N not equal to V)

less than or equal

AL

-

Always

NV

-

Never

 

 

Branch Instructions

Branch

Branch with link

BEQ

Branch if Equal

BLEQ

 

 

 

 

 

As Branch but with link ie the current value of R15 is stored in R14 so the program can return. Use for subroutines  

BNE

Branch if Not Equal

BLNE

BVS

Branch if Overflow Set

BLVS

BVC

Branch if Overflow Clear

BLVC

BHI

Branch if Higher

BLHI

BLS

Branch if Lower or the Same

BLLS

BPL

Branch if Plus

BLPL

BMI

Branch if Minus

BLMI

BCS

Branch if Carry Set

BLCS

BCC

Branch if Carry Clear

BLCC

BGE

Branch if Greater than or Equal

BLGE

BGT

Branch if Greater Than

BLGT

BLE

Branch if Less than or Equal

BLLE

BLT

Branch if Less Than

BLLT