Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Atmel ARM7TDMI datasheet.1999.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
1.45 Mб
Скачать

Instruction Set Summary

Format summary

The ARM instruction set formats are shown below.

Figure 10. ARM Instruction Set Formats

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10

9

8

7

6

 

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data Processing /

Cond

0

0

I

Opcode

S

 

Rn

 

 

Rd

 

 

 

 

 

Operand 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PSR Transfer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Multiply

Cond

0

0

0

0

0

0

A

S

 

Rd

 

 

Rn

 

 

Rs

 

1

 

0

 

0

1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Multiply Long

Cond

0

0

0

0

1

U

A

S

 

RdHi

 

 

RdLo

 

 

Rn

 

1

 

0

 

0

1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Single Data Swap

Cond

0

0

0

1

0

B

0

0

 

Rn

 

 

Rd

 

0

0

0

0

1

 

0

 

0

1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Branch and Exchange

Cond

0

0

0

1

0

0

1

0

1

1

1

1

1

1

1

1

1

1

1

1

0

 

0

 

0

1

 

Rn

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Halfword Data Transfer:

Cond

0

0

0

P

U

0

W

L

 

Rn

 

 

Rd

 

0

0

0

0

1

S

H

1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

register offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Halfword Data Transfer:

Cond

0

0

0

P

U

1

W

L

 

Rn

 

 

Rd

 

 

Offset

1

 

S

H

1

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

immediate offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Single Data Transfer

Cond

0

1

I

P

U

B

W

L

 

Rn

 

 

Rd

 

 

 

 

 

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Undefined

Cond

0

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Block Data Transfer

Cond

1

0

0

P

U

S

W

L

 

Rn

 

 

 

 

 

 

Register List

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Branch

Cond

1

0

1

L

 

 

 

 

 

 

 

 

 

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coprocessor Data

Cond

1

1

0

P

U

N

W

L

 

Rn

 

 

CRd

 

 

CP#

 

 

 

 

 

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Transfer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coprocessor Data

Cond

1

1

1

0

CP Opc

 

CRn

 

 

CRd

 

 

CP#

 

 

CP

 

0

 

CRm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Coprocessor Register

Cond

1

1

1

0

CP Opc

L

 

CRn

 

 

Rd

 

 

CP#

 

 

CP

 

1

 

CRm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Transfer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Software Interrupt

Cond

1

1

1

1

 

 

 

 

 

 

 

 

Ignored by processor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10

9

8

7

6

 

5

4

3

2

1

0

 

Note: Some instruction codes are not defined but do not cause the Undefined instruction trap to be taken, for instance a Multiply instruction with bit 6 changed to a 1. These instructions should not be used, as their action may change in future ARM implementations.

28 Instruction Set

 

 

 

Instruction Set

 

 

 

Instruction summary

 

 

 

 

Table 5. The ARM Instruction Set

 

 

 

 

 

 

 

 

Mnemonic

Instruction

Action

 

See Page

ADC

Add with carry

Rd := Rn + Op2 + Carry

 

34

ADD

Add

Rd := Rn + Op2

 

34

AND

AND

Rd := Rn AND Op2

 

34

B

Branch

R15 := address

 

32

BIC

Bit Clear

Rd := Rn AND NOT Op2

 

34

BL

Branch with Link

R14 := R15, R15 := address

 

32

BX

Branch and Exchange

R15 := Rn,

 

31

 

 

T bit := Rn[0]

 

 

CDP

Coprocesor Data Processing

(Coprocessor-specific)

 

66

CMN

Compare Negative

CPSR flags := Rn + Op2

 

34

CMP

Compare

CPSR flags := Rn - Op2

 

34

EOR

Exclusive OR

Rd := (Rn AND NOT Op2)

 

34

 

 

OR (op2 AND NOT Rn)

 

 

LDC

Load coprocessor from memory

Coprocessor load

 

68

LDM

Load multiple registers

Stack manipulation (Pop)

 

56

LDR

Load register from memory

Rd := (address)

 

48, 52

MCR

Move CPU register to

cRn := rRn {<op>cRm}

 

70

 

coprocessor register

 

 

 

MLA

Multiply Accumulate

Rd := (Rm * Rs) + Rn

 

44, 46

MOV

Move register or constant

Rd : = Op2

 

34

MRC

Move from coprocessor

Rn := cRn {<op>cRm}

 

70

 

register to CPU register

 

 

 

MRS

Move PSR status/flags to

Rn := PSR

 

40

 

register

 

 

 

MSR

Move register to PSR

PSR := Rm

 

40

 

status/flags

 

 

 

MUL

Multiply

Rd := Rm * Rs

 

44, 46

MVN

Move negative register

Rd := 0xFFFFFFFF EOR Op2

 

34

ORR

OR

Rd := Rn OR Op2

 

34

RSB

Reverse Subtract

Rd := Op2 - Rn

 

34

RSC

Reverse Subtract with Carry

Rd := Op2 - Rn - 1 + Carry

 

34

SBC

Subtract with Carry

Rd := Rn - Op2 - 1 + Carry

 

34

STC

Store coprocessor register to mem-

address := CRn

 

68

 

ory

 

 

 

STM

Store Multiple

Stack manipulation (Push)

 

56

STR

Store register to memory

<address> := Rd

 

48, 52

SUB

Subtract

Rd := Rn - Op2

 

34

SWI

Software Interrupt

OS call

 

64

SWP

Swap register with memory

Rd := [Rn], [Rn] := Rm

 

62

TEQ

Test bitwise equality

CPSR flags := Rn EOR Op2

 

34

TST

Test bits

CPSR flags := Rn AND Op2

 

34

29

Соседние файлы в предмете Электротехника