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

Instruction Set

Loading a word from an unknown alignment

 

 

;

enter with address in Ra (32 bits)

 

 

;

uses Rb, Rc; result in Rd.

 

 

;

Note d must be less than c e.g. 0,1

 

 

;

 

BIC

Rb,Ra,#3

;

get word aligned address

LDMIA

Rb,{Rd,Rc}

;

get 64 bits containing answer

AND

Rb,Ra,#3

;

correction factor in bytes

MOVS

Rb,Rb,LSL#3

;

...now in bits and test if aligned

MOVNE

Rd,Rd,LSR Rb

;

produce bottom of result word

 

 

;

(if not aligned)

RSBNE

Rb,Rb,#32

;

get other shift amount

ORRNE

Rd,Rd,Rc,LSL Rb;

combine two halves to get result

75

76 Instruction Set

This chapter describes the THUMB instruction set.

Thumb

Instruction Set

77

Format Summary

The THUMB instruction set formats are shown in the following figure.

Figure 38. THUMB Instruction Set Formats

 

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

Op

 

Offset5

 

 

 

Rs

 

 

Rd

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

1

1

I

Op

Rn/offset3

 

Rs

 

 

Rd

 

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

1

Op

 

Rd

 

 

 

 

 

Offset8

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

0

0

0

 

Op

 

 

 

Rs

 

 

Rd

 

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

0

0

1

Op

H1

H2

 

Rs/Hs

 

Rd/Hd

 

 

 

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

0

1

 

Rd

 

 

 

 

 

Word8

 

 

 

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

1

L

B

0

 

Ro

 

 

 

Rb

 

 

Rd

 

 

 

 

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

0

1

H

S

1

 

Ro

 

 

 

Rb

 

 

Rd

 

 

 

 

 

 

 

 

 

9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

1

1

B

L

 

Offset5

 

 

 

Rb

 

 

Rd

 

 

 

 

 

 

 

 

 

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

0

0

L

 

Offset5

 

 

 

Rb

 

 

Rd

 

11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

0

1

L

 

Rd

 

 

 

 

 

Word8

 

 

 

12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

1

0

SP

 

Rd

 

 

 

 

 

Word8

 

 

 

13

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

1

1

0

0

0

0

S

 

 

 

SWord7

 

 

14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

1

1

L

1

0

R

 

 

 

 

Rlist

 

 

 

15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

0

0

L

 

Rb

 

 

 

 

 

Rlist

 

 

 

16

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

0

1

 

Cond

 

 

 

 

 

Soffset8

 

 

17

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

0

1

1

1

1

1

 

 

 

 

Value8

 

 

 

18

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

1

0

0

 

 

 

 

 

Offset11

 

 

 

 

19

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

1

1

H

 

 

 

 

 

Offset

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Move shifted register

Add/subtract

Move/compare/add /subtract immediate

ALU operations

Hi register operations /branch exchange

PC-relative load

Load/store with register offset

Load/store sign-extended byte/halfword

Load/store with immediate offset

Load/store halfword

SP-relative load/store

Load address

Add offset to stack pointer

Push/pop registers

Multiple load/store

Conditional branch

Software Interrupt

Unconditional branch

Long branch with link

78 Instruction Set

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