arm processor instruction set - github pages · 2020. 4. 16. · assistant professor, dept. of ece...

24
ARM Processor – Instruction Set By Harish V. Mekali Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set

Upload: others

Post on 12-Dec-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

ARM Processor – Instruction Set

By

Harish V. Mekali

Assistant Professor, Dept. of ECE

BMSCE, Bangalore - 19

Lecture on ARM7 Instruction set

Page 2: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Register Organization - CPSR

05-01-2017 ARM Processors - Instruction Set 2

Page 3: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Condition Mnemonics

05-01-2017 ARM Processors - Instruction Set 3

Fig : Condition mnemonics that can be added to basic instructions

Page 4: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Instruction Set & Processor State

05-01-2017 ARM Processors - Instruction Set 4

Page 5: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Instruction set

05-01-2017 ARM Processors - Instruction Set 5

Classification of instructions

1. Data Processing Instruction

- Data movement , Arithmetic, Logical, Comparison, Multiply

2. Branch instructions

3. Load – store instructions

- Single register, Multiple register, Stack operations, Swap

4. Software interrupt instructions

5. Program Status Register instructions

Page 6: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Data Processing Instructions

05-01-2017 ARM Processors - Instruction Set 6

- Most of the data processing instructions can process one operand using

barrel shifter

Data movement instructions

- “S” suffix with MOVE operations can update the C, Z, N flags in CPSR

- “N” can be register or immediate data

- Example : MOV instruction without and with barrel shifter operations

Page 7: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Barrel Shifter Operations

05-01-2017 ARM Processors - Instruction Set 7

Page 8: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Arithmetic Instructions

05-01-2017 ARM Processors - Instruction Set 8

- “N” is the result of shift operation

- Example :

Page 9: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Logical Instructions

05-01-2017 ARM Processors - Instruction Set 9

- Updates CPSR only if suffix “S” is added and logical instructions

can also use barrel shifter in the same way as MOVE and

arithmetic

- Example :

Page 10: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Comparison Instructions

05-01-2017 ARM Processors - Instruction Set 10

- Updates CPSR only without affecting the register content and this

can be used in conditional execution

- TST is logical AND and TEQ is a logical XOR operation

- Example :

Page 11: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Multiply Instructions

05-01-2017 ARM Processors - Instruction Set 11

- Example :

Page 12: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Branch Instructions

05-01-2017 ARM Processors - Instruction Set 12

- Address label is stored with instruction as a PC relative offset and it must

be approximately 32 MB

- BX and BLX are primarily used for branch to and from Thumb code . “T”

bit in CPSR is updated by least significant bit of branch register

Page 13: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Branch Instructions

05-01-2017 ARM Processors - Instruction Set 13

- Example :

Page 14: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Load and Store Instructions

05-01-2017 ARM Processors - Instruction Set 14

Page 15: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Load and Store Instructions

05-01-2017 ARM Processors - Instruction Set 15

Page 16: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Load and Store Instructions

05-01-2017 ARM Processors - Instruction Set 16

Page 17: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Load and Store Instructions

05-01-2017 ARM Processors - Instruction Set 17

Page 18: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Swap Instructions

05-01-2017 ARM Processors - Instruction Set 18

- Its an atomic operation – It reads and writes location in the same bus operation preventing any other instruction from reading and writing to the location until it completes

Page 19: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Program Status Register Instructions

05-01-2017 ARM Processors - Instruction Set 19

- CPSR_<fields> refer to Control (C) , Extension (x) , Status (s) , Flags (f)

Page 20: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Coprocessor Instructions

05-01-2017 ARM Processors - Instruction Set 20

- “cp” field in the syntax refer to coprocessor number p0 to p15. - “opcode” field refer to operation to take place on coprocessor -

Page 21: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Thank you

05-01-2017 ARM Processors - Instruction Set 21

Page 22: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

Harish V. Mekali

Assistant Professor, Dept. of ECE, BMSCE

[email protected] / [email protected]

+91-9538765141

http://harishvmekali.blogspot.in/p/technology.html

05-01-2017 ARM Processors - Instruction Set 22

Page 23: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

I acknowledge and appreciate ARM University Program(AUP)

and ARM Embedded Systems pvt. Ltd. for their continuous

support.

05-01-2017 ARM Processors - Instruction Set 23

Page 24: ARM Processor Instruction Set - GitHub Pages · 2020. 4. 16. · Assistant Professor, Dept. of ECE BMSCE, Bangalore - 19 Lecture on ARM7 Instruction set . Register Organization -

05-01-2017 ARM Processors - Instruction Set 24

References

Video lectures : 1. Mr. Chrish Shore, ARM Training Manager, UK The ARM University Program, ARM Architecture Fundamentals ( https://www.youtube.com/watch?v=7LqPJGnBPMM ) 2. Dr. Santanu Chaudhury, Dept. of Electrical Engineering, IIT Delhi Lecture - 5 ARM : ( https://www.youtube.com/watch?v=4VRtujwa_b8 ) Website : 3. http://infocenter.arm.com/help/index.jsp Textbooks: 1. ARM system developers guide, Andrew N Sloss, Dominic Symes and Chris

Wright, Elsevier, Morgan Kaufman publishers, 2008. 2. ARM System-on-Chip Architecture, Steve Furber, Second Edition,

Pearson, 2015