SlideShare a Scribd company logo
1 of 38
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.pdfeklavya0304
 
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 setShail Modi
 
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.pptManju Badiger
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTSssuser2b759d
 
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 programmingv Kalairajan
 
16201104.ppt
16201104.ppt16201104.ppt
16201104.pptyibe5
 

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.

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

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

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: