SlideShare a Scribd company logo
MODULE 5
ARM INSTUCTION SET
SYLLABUS
 Introduction to the ARM Instruction Set : Data Processing Instructions
Branch Instructions, Software Interrupt Instructions, Program Status Register
Instructions, Coprocessor Instructions, Loading Constants,
Simple programming exercises.
 ARM instructions process data held in registers and memory is accessed only with load and
store instructions
 »ARM instructions commonly take two or three operands For instance, the ADD instruction
below adds the two values stored in registers r1 and r2 (the source registers). It writes the
result to register r3(the destination register)
ARM instructions classified as—data processing instructions, branch instructions, load-store
instructions, software interrupt instruction ,and program status register instructions
 DATA PROCESSING INSTRUCTIONS
The data processing instructions manipulate data within registers.They are—move
instructions, arithmetic instructions, logical instructions, comparison instructions, and
multiply instructions
Most data processing instructions can process one of their operands using the barrel
shifter
If you use the suffix on a data processing instruction, then it updates the flags in the cpsr
 Move and logical operations update the carry flag C, negative flag N ,and zero flag Z
The C flag is set from the result of the barrelshift as the last bit shifted out
 The N flag is set to bit 31 of the result
 The Z flag is set if the result is zero
 MOVe Instructions:
 Move instruction copies N into a destination register Rd, where N is a register or
immediate value This instruction is useful for setting initial values and transferring
data between registers
Example: This example shows a simple move instruction. The MOV instruction takes the
contents of register r5 and copies them into register r7, in this case, taking the value
5,and over writing the value 8 in register r7
 PREr5 = 5
 r7 = 8
MOVr7, r5; let r7 = r5
POST r5 = 5
r7 = 5
 Barrel Shifter:
 In above Example, we showed a MOV instruction where N is a simple register
 But N can be more than just a register or immediate value; it can also be a
register Rm that has been preprocessed by the barrel shifter prior to being used
by a data processing instruction
 Data processing instructions are processed with in the arithmetic logic
unit(ALU)
 A unique and powerful feature of the ARM processor is the ability to shift the
32-bit binary pattern in one of the source registers left or right by a specific
number of positions before it enters the ALU
Pre-processing or shift occurs within the cycle time of the instruction This shift increases the
power and flexibility of many data processing operations
This is particularly useful for loading constants into a register and achieving fast multiplies or
division by a power of 2
»There are data processing instructions that do not use the barrelshift, For example, the
MUL(multiply),CLZ(countleading zeros),and QADD(signed saturated 32-bit add)instructions
 Figure shows the data flow between the ALU and the barrel
shifter.
 Register Rn enters the ALU without any pre- processing of
registers.
 We apply a logical shift left (LSL) to register Rm before
moving it to the destination register. This is the same as
applying the standard C language shift operator « to the
register.
 The MOV instruction copies the shift operator result N into register Rd.
N represents the result of the LSL operation described in the following Table.

PRE r5 = 5, r7 = 8
MOV r7, r5, LSL #2 ; let r7 = r5*4 = (r5 << 2)
 POST r5 = 5
 r7 = 20
 Pre r2=4, r3=6
 Mov r3,r2,lsl#1
 Post r3=8
 Example: This example of a MOVS instruction shifts register r1 left by one bit. This multiplies
register r1 by a value 21. As you can see, the C flag is updated in the cpsr because the S suffix is
present in the instruction mnemonic.
 PRE cpsr = nzcvqiFt_USER
 r0 = 0x00000000
 r1 = 0x80000004
MOVS r0, r1, LSL #1
 POST cpsr = nzCvqiFt_USER
 r0 = 0x00000008
 r1 = 0x80000004

 2.pre cpsr=nzcvqiFt_user
 R0=0x00000000
 R1=0x70000003
 Movs r0,r1,lsl#1
 0111 0000 0000 0000 0000 0000 0000 0011
 R0= 0xe0000006
Table: Barrel Shifter Operation Syntax for data Processing Instructions
The following Table lists the syntax for the different barrel shift operations
available on data processing instructions. The second operand N can be an
immediate constant preceded by #, a register value Rm, or the value of Rm
processed by a shift.
 Arithmetic Instructions:
 Example: The following simple subtract instruction subtracts a value stored in register r2 from a value stored in register r1.
The result is stored in register r0.
 PRE r0 = 0x00000000
 r1 = 0x00000002 r2 = 0x00000001
 SUB r0, r1, r2
 R0=r1-r2
 00000002-00000001
 POST r0 = 0x00000001


 Example: The following reverse subtract instruction (RSB) subtracts r1 from the constant value #0, writing the result to r0. You
can use this instruction to negate numbers.
 PRE r0 = 0x00000000
 r1 = 0x00000077 0000 0000 0000 0000 0000 0000 0111 0111
 1111 1111 1111 1111 1111 1111 1000 1000
 1
 1111 1111 1111 1111 1111 1111 1000 1001
 RSB r0, r1, #0 ; Rd = 0x0 - r1
 R0=0-r1
 POST r0 = -r1 = 0xffffff89
 Pre r0=0x00000000
 R1=0x00000067
 Rsb r0,r1,#0
 Example: The SUBS instruction is useful for decrementing loop counters. In this
example, we subtract the immediate value one from the value one stored in
register r1. The result value zero is written to register r1. The cpsr is updated with
the ZC flags being set.
 PRE cpsr = nzcvqiFt_USER
 r1 = 0x00000001
 SUBS r1, r1, #1
 POST cpsr = nZCvqiFt_USER r1 = 0x00000000
 Using the Barrel Shifter with Arithmetic Instructions:
 Example: Register r1 is first shifted one location to the left to give the value of twice r1. The ADD instruction
then adds the result of the barrel shift operation to register r1. The final result transferred into register r0 is
equal to three times the value stored in register r1.
 PRE r0 = 0x00000000
 r1 = 0x00000005
 ADD r0, r1, r1, LSL #1
 R0=r1+(r1x2)
 POST r0 = 0x0000000f
 r1 = 0x00000005
 R1=0x00000004
 Add r0,r1,r1,lsl#1
 R0=0x0000000C
 Logical Instructions:
 Example: This example shows a logical OR operation between registers r1 and r2.
Register r0 holds the result.
 PRE r0 = 0x00000000
 r1 = 0x02040608 r2 = 0x10305070
ORR r0, r1, r2
R0= R1 OR R2
 POST r0 = 0x12345678
 02040608 = 0000 0010 0000 0100 0000 0110 0000 1000
 10305070 = 00010000 0011 0000 0101 0000 0111 0000
 0R OPERATION= 0001001000110100 0101 0110 0111 1000
 R0=0X 12345678
AND R0,R1,R2
 Example: This example shows a more complicated logical instruction called BIC, which
carries out a logical bit clear.
 PRE r1 = 0b1111
 r2 = 0b0101
 BIC r0, r1, r2
 R0= R1 AND (NOT R2)
 R2= 0B0101
 NOT R2=0b1010
 RO= 0B1111 AND 0B1010
 R0=0B1010
 POST r0 = 0b1010
 This is equivalent to – Rd = Rn AND NOT (N)
 1111
 1010
 1010
 Comparison Instructions:
 Example: This example shows a CMP comparison instruction. You can see that both
registers, r0 and r9, are equal before executing the instruction. The value of the Z
flag prior to execution is 0 and is represented by a lowercase z. After execution
the Z flag changes to 1 or an uppercase Z. This change indicates equality.
 PRE cpsr = nzcvqiFt_USER
r0 = 4
r9 = 4
CMP r0, r9
POST cpsr = nZcvqiFt_USER
 Multiply Instructions:
 Example: This example shows a simple multiply instruction that multiplies registers r1
and r2 together and places the result into register r0. In this example, register r1 is
equal to the value 2, and r2 is equal to
 The result, 4, is then placed into register r0.
 PRE r0 = 0x00000000
 r1 = 0x00000005 r2 = 0x00000005
MUL r0, r1, r2 ;
r0 = r1*r2
 POST r0 = 0x00000004
 r1 = 0x00000002 r2 = 0x00000002
 BRANCH INSTRUCTIONS:
 LOAD-STORE INSTRUCTIONS:
 Single-Register Transfer:
 Multiple-Register Transfer:
 Swap Instruction:
 Pre mem32[0x9000]= 0x12345678
 R0=0x00000000
 R1=0x11112222
 R2=0x00009000
 Swp r0,r1,[r2]
 Transfer the value of r1 and r2
 R1=0x00009000
 R2=0x11112222
 Transfer the value of [r2] to mem32 and prev mem32 is stored in dest ro
 Post mem32[0x9000]=0x11112222
 r0=0x12345678
 Pre mem 32[0x8400]=0x22223333
 R0=0x00000000
 R1=0x34343434
 R2=0x55553333
 Swp r0,r1,[r2]
 Post mem32[0x8400]=0x34343434
 Ro=0x22223333
 R1=0x55553333
 R2=0x34343434
 SOFTWARE INTERRUPT INSTRUCTION:
 PROGRAM STATUS REGISTER INSTRUCTIONS:
 Coprocessor Instructions:
 LOADING CONSTANTS:

More Related Content

Similar to module 5.1.pptx

ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
eklavya0304
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
Karthik Vivek
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
CHENAGANIMEGHANA
 
Microprocessors and microcontrollers
Microprocessors and microcontrollers Microprocessors and microcontrollers
Microprocessors and microcontrollers durga_sekar
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching materialJohn Williams
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
Shail Modi
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
Karthik Vivek
 
Computer Architecture Assignment Help
Computer Architecture Assignment HelpComputer Architecture Assignment Help
Computer Architecture Assignment Help
Architecture Assignment Help
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent vijaydeepakg
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
Manju Badiger
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTS
ssuser2b759d
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
ARM inst set part 2
ARM inst set part 2ARM inst set part 2
ARM inst set part 2
Karthik Vivek
 
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
hwbloom142
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary janicetiong
 
Arm assembly language programming
Arm assembly language programmingArm assembly language programming
Arm assembly language programming
v Kalairajan
 
16201104.ppt
16201104.ppt16201104.ppt
16201104.ppt
yibe5
 

Similar to module 5.1.pptx (20)

ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdfARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
ARMbuilt-inshift_2a6f2cdd75038e8c46c6d481aac833ec.pdf
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
UNIT 2 ERTS.ppt
UNIT 2 ERTS.pptUNIT 2 ERTS.ppt
UNIT 2 ERTS.ppt
 
Microprocessors and microcontrollers
Microprocessors and microcontrollers Microprocessors and microcontrollers
Microprocessors and microcontrollers
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm chap 3 last
Arm chap 3 lastArm chap 3 last
Arm chap 3 last
 
Microcontroller instruction set
Microcontroller instruction setMicrocontroller instruction set
Microcontroller instruction set
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Computer Architecture Assignment Help
Computer Architecture Assignment HelpComputer Architecture Assignment Help
Computer Architecture Assignment Help
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTS
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
ARM inst set part 2
ARM inst set part 2ARM inst set part 2
ARM inst set part 2
 
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
Figure 9-15 Block Diagram for a single-Cycle Computer Manually simulate the s...
 
OptimizingARM
OptimizingARMOptimizingARM
OptimizingARM
 
Instruction set summary
Instruction set summary Instruction set summary
Instruction set summary
 
Arm assembly language programming
Arm assembly language programmingArm assembly language programming
Arm assembly language programming
 
16201104.ppt
16201104.ppt16201104.ppt
16201104.ppt
 

More from Dr. Thippeswamy S.

Bacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.pptBacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.ppt
Dr. Thippeswamy S.
 
Seven QC Tools New approach.pptx
Seven QC Tools New approach.pptxSeven QC Tools New approach.pptx
Seven QC Tools New approach.pptx
Dr. Thippeswamy S.
 
Soil Erosion.pptx
Soil Erosion.pptxSoil Erosion.pptx
Soil Erosion.pptx
Dr. Thippeswamy S.
 
Database Normalization.pptx
Database Normalization.pptxDatabase Normalization.pptx
Database Normalization.pptx
Dr. Thippeswamy S.
 
cloudapplications.pptx
cloudapplications.pptxcloudapplications.pptx
cloudapplications.pptx
Dr. Thippeswamy S.
 
12575474.ppt
12575474.ppt12575474.ppt
12575474.ppt
Dr. Thippeswamy S.
 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
Dr. Thippeswamy S.
 
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptxdeploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
Dr. Thippeswamy S.
 
DBMS.pptx
DBMS.pptxDBMS.pptx
Normalization DBMS.ppt
Normalization DBMS.pptNormalization DBMS.ppt
Normalization DBMS.ppt
Dr. Thippeswamy S.
 
Normalization Alg.ppt
Normalization Alg.pptNormalization Alg.ppt
Normalization Alg.ppt
Dr. Thippeswamy S.
 
introduction to matlab.pptx
introduction to matlab.pptxintroduction to matlab.pptx
introduction to matlab.pptx
Dr. Thippeswamy S.
 
Conceptual Data Modeling
Conceptual Data ModelingConceptual Data Modeling
Conceptual Data Modeling
Dr. Thippeswamy S.
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
Dr. Thippeswamy S.
 
Chp-1.pptx
Chp-1.pptxChp-1.pptx
Chp-1.pptx
Dr. Thippeswamy S.
 
Mod-2.pptx
Mod-2.pptxMod-2.pptx
Mod-2.pptx
Dr. Thippeswamy S.
 
module 5.pptx
module 5.pptxmodule 5.pptx
module 5.pptx
Dr. Thippeswamy S.
 
Module 2 (1).pptx
Module 2 (1).pptxModule 2 (1).pptx
Module 2 (1).pptx
Dr. Thippeswamy S.
 
23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf
Dr. Thippeswamy S.
 

More from Dr. Thippeswamy S. (19)

Bacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.pptBacterial Examination of Water of different sources.ppt
Bacterial Examination of Water of different sources.ppt
 
Seven QC Tools New approach.pptx
Seven QC Tools New approach.pptxSeven QC Tools New approach.pptx
Seven QC Tools New approach.pptx
 
Soil Erosion.pptx
Soil Erosion.pptxSoil Erosion.pptx
Soil Erosion.pptx
 
Database Normalization.pptx
Database Normalization.pptxDatabase Normalization.pptx
Database Normalization.pptx
 
cloudapplications.pptx
cloudapplications.pptxcloudapplications.pptx
cloudapplications.pptx
 
12575474.ppt
12575474.ppt12575474.ppt
12575474.ppt
 
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
djypllh5r1gjbaekxgwv-signature-cc6692615bbc55079760b9b0c6636bc58ec509cd0446cb...
 
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptxdeploymentmodelsofcloudcomputing-230211123637-08174981.pptx
deploymentmodelsofcloudcomputing-230211123637-08174981.pptx
 
DBMS.pptx
DBMS.pptxDBMS.pptx
DBMS.pptx
 
Normalization DBMS.ppt
Normalization DBMS.pptNormalization DBMS.ppt
Normalization DBMS.ppt
 
Normalization Alg.ppt
Normalization Alg.pptNormalization Alg.ppt
Normalization Alg.ppt
 
introduction to matlab.pptx
introduction to matlab.pptxintroduction to matlab.pptx
introduction to matlab.pptx
 
Conceptual Data Modeling
Conceptual Data ModelingConceptual Data Modeling
Conceptual Data Modeling
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Chp-1.pptx
Chp-1.pptxChp-1.pptx
Chp-1.pptx
 
Mod-2.pptx
Mod-2.pptxMod-2.pptx
Mod-2.pptx
 
module 5.pptx
module 5.pptxmodule 5.pptx
module 5.pptx
 
Module 2 (1).pptx
Module 2 (1).pptxModule 2 (1).pptx
Module 2 (1).pptx
 
23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf23. Journal of Mycology and Plant pathology.pdf
23. Journal of Mycology and Plant pathology.pdf
 

Recently uploaded

Fresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptxFresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
SriSurya50
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
scholarhattraining
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

Fresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptxFresher’s Quiz 2023 at GMC Nizamabad.pptx
Fresher’s Quiz 2023 at GMC Nizamabad.pptx
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
MERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDFMERN Stack Developer Roadmap By ScholarHat PDF
MERN Stack Developer Roadmap By ScholarHat PDF
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

module 5.1.pptx

  • 2. SYLLABUS  Introduction to the ARM Instruction Set : Data Processing Instructions Branch Instructions, Software Interrupt Instructions, Program Status Register Instructions, Coprocessor Instructions, Loading Constants, Simple programming exercises.
  • 3.  ARM instructions process data held in registers and memory is accessed only with load and store instructions  »ARM instructions commonly take two or three operands For instance, the ADD instruction below adds the two values stored in registers r1 and r2 (the source registers). It writes the result to register r3(the destination register) ARM instructions classified as—data processing instructions, branch instructions, load-store instructions, software interrupt instruction ,and program status register instructions
  • 4.
  • 5.  DATA PROCESSING INSTRUCTIONS The data processing instructions manipulate data within registers.They are—move instructions, arithmetic instructions, logical instructions, comparison instructions, and multiply instructions Most data processing instructions can process one of their operands using the barrel shifter If you use the suffix on a data processing instruction, then it updates the flags in the cpsr  Move and logical operations update the carry flag C, negative flag N ,and zero flag Z The C flag is set from the result of the barrelshift as the last bit shifted out  The N flag is set to bit 31 of the result  The Z flag is set if the result is zero
  • 6.  MOVe Instructions:  Move instruction copies N into a destination register Rd, where N is a register or immediate value This instruction is useful for setting initial values and transferring data between registers Example: This example shows a simple move instruction. The MOV instruction takes the contents of register r5 and copies them into register r7, in this case, taking the value 5,and over writing the value 8 in register r7
  • 7.  PREr5 = 5  r7 = 8 MOVr7, r5; let r7 = r5 POST r5 = 5 r7 = 5  Barrel Shifter:  In above Example, we showed a MOV instruction where N is a simple register  But N can be more than just a register or immediate value; it can also be a register Rm that has been preprocessed by the barrel shifter prior to being used by a data processing instruction  Data processing instructions are processed with in the arithmetic logic unit(ALU)  A unique and powerful feature of the ARM processor is the ability to shift the 32-bit binary pattern in one of the source registers left or right by a specific number of positions before it enters the ALU
  • 8. Pre-processing or shift occurs within the cycle time of the instruction This shift increases the power and flexibility of many data processing operations This is particularly useful for loading constants into a register and achieving fast multiplies or division by a power of 2 »There are data processing instructions that do not use the barrelshift, For example, the MUL(multiply),CLZ(countleading zeros),and QADD(signed saturated 32-bit add)instructions
  • 9.  Figure shows the data flow between the ALU and the barrel shifter.  Register Rn enters the ALU without any pre- processing of registers.  We apply a logical shift left (LSL) to register Rm before moving it to the destination register. This is the same as applying the standard C language shift operator « to the register.
  • 10.  The MOV instruction copies the shift operator result N into register Rd. N represents the result of the LSL operation described in the following Table. 
  • 11. PRE r5 = 5, r7 = 8 MOV r7, r5, LSL #2 ; let r7 = r5*4 = (r5 << 2)  POST r5 = 5  r7 = 20  Pre r2=4, r3=6  Mov r3,r2,lsl#1  Post r3=8
  • 12.
  • 13.  Example: This example of a MOVS instruction shifts register r1 left by one bit. This multiplies register r1 by a value 21. As you can see, the C flag is updated in the cpsr because the S suffix is present in the instruction mnemonic.  PRE cpsr = nzcvqiFt_USER  r0 = 0x00000000  r1 = 0x80000004 MOVS r0, r1, LSL #1  POST cpsr = nzCvqiFt_USER  r0 = 0x00000008  r1 = 0x80000004   2.pre cpsr=nzcvqiFt_user  R0=0x00000000  R1=0x70000003  Movs r0,r1,lsl#1  0111 0000 0000 0000 0000 0000 0000 0011  R0= 0xe0000006
  • 14. Table: Barrel Shifter Operation Syntax for data Processing Instructions The following Table lists the syntax for the different barrel shift operations available on data processing instructions. The second operand N can be an immediate constant preceded by #, a register value Rm, or the value of Rm processed by a shift.
  • 16.  Example: The following simple subtract instruction subtracts a value stored in register r2 from a value stored in register r1. The result is stored in register r0.  PRE r0 = 0x00000000  r1 = 0x00000002 r2 = 0x00000001  SUB r0, r1, r2  R0=r1-r2  00000002-00000001  POST r0 = 0x00000001    Example: The following reverse subtract instruction (RSB) subtracts r1 from the constant value #0, writing the result to r0. You can use this instruction to negate numbers.  PRE r0 = 0x00000000  r1 = 0x00000077 0000 0000 0000 0000 0000 0000 0111 0111  1111 1111 1111 1111 1111 1111 1000 1000  1  1111 1111 1111 1111 1111 1111 1000 1001  RSB r0, r1, #0 ; Rd = 0x0 - r1  R0=0-r1  POST r0 = -r1 = 0xffffff89
  • 17.  Pre r0=0x00000000  R1=0x00000067  Rsb r0,r1,#0
  • 18.  Example: The SUBS instruction is useful for decrementing loop counters. In this example, we subtract the immediate value one from the value one stored in register r1. The result value zero is written to register r1. The cpsr is updated with the ZC flags being set.  PRE cpsr = nzcvqiFt_USER  r1 = 0x00000001  SUBS r1, r1, #1  POST cpsr = nZCvqiFt_USER r1 = 0x00000000
  • 19.  Using the Barrel Shifter with Arithmetic Instructions:  Example: Register r1 is first shifted one location to the left to give the value of twice r1. The ADD instruction then adds the result of the barrel shift operation to register r1. The final result transferred into register r0 is equal to three times the value stored in register r1.  PRE r0 = 0x00000000  r1 = 0x00000005  ADD r0, r1, r1, LSL #1  R0=r1+(r1x2)  POST r0 = 0x0000000f  r1 = 0x00000005  R1=0x00000004  Add r0,r1,r1,lsl#1  R0=0x0000000C
  • 21.  Example: This example shows a logical OR operation between registers r1 and r2. Register r0 holds the result.  PRE r0 = 0x00000000  r1 = 0x02040608 r2 = 0x10305070 ORR r0, r1, r2 R0= R1 OR R2  POST r0 = 0x12345678  02040608 = 0000 0010 0000 0100 0000 0110 0000 1000  10305070 = 00010000 0011 0000 0101 0000 0111 0000  0R OPERATION= 0001001000110100 0101 0110 0111 1000  R0=0X 12345678 AND R0,R1,R2
  • 22.  Example: This example shows a more complicated logical instruction called BIC, which carries out a logical bit clear.  PRE r1 = 0b1111  r2 = 0b0101  BIC r0, r1, r2  R0= R1 AND (NOT R2)  R2= 0B0101  NOT R2=0b1010  RO= 0B1111 AND 0B1010  R0=0B1010  POST r0 = 0b1010  This is equivalent to – Rd = Rn AND NOT (N)  1111  1010  1010
  • 24.  Example: This example shows a CMP comparison instruction. You can see that both registers, r0 and r9, are equal before executing the instruction. The value of the Z flag prior to execution is 0 and is represented by a lowercase z. After execution the Z flag changes to 1 or an uppercase Z. This change indicates equality.  PRE cpsr = nzcvqiFt_USER r0 = 4 r9 = 4 CMP r0, r9 POST cpsr = nZcvqiFt_USER
  • 26.
  • 27.  Example: This example shows a simple multiply instruction that multiplies registers r1 and r2 together and places the result into register r0. In this example, register r1 is equal to the value 2, and r2 is equal to  The result, 4, is then placed into register r0.  PRE r0 = 0x00000000  r1 = 0x00000005 r2 = 0x00000005 MUL r0, r1, r2 ; r0 = r1*r2  POST r0 = 0x00000004  r1 = 0x00000002 r2 = 0x00000002
  • 29.  LOAD-STORE INSTRUCTIONS:  Single-Register Transfer:
  • 30.
  • 33.  Pre mem32[0x9000]= 0x12345678  R0=0x00000000  R1=0x11112222  R2=0x00009000  Swp r0,r1,[r2]  Transfer the value of r1 and r2  R1=0x00009000  R2=0x11112222  Transfer the value of [r2] to mem32 and prev mem32 is stored in dest ro  Post mem32[0x9000]=0x11112222  r0=0x12345678
  • 34.  Pre mem 32[0x8400]=0x22223333  R0=0x00000000  R1=0x34343434  R2=0x55553333  Swp r0,r1,[r2]  Post mem32[0x8400]=0x34343434  Ro=0x22223333  R1=0x55553333  R2=0x34343434
  • 35.  SOFTWARE INTERRUPT INSTRUCTION:
  • 36.  PROGRAM STATUS REGISTER INSTRUCTIONS: