SlideShare a Scribd company logo
1 of 16
1 write an ALP for addition two 64 bit numbers . 
AREA ADDTIN,CODE 
ENTRY 
ldr r0,=value1 
ldr r1,[r0] 
ldr r2,[r0,#4] 
ldr r0,=value2 
ldr r3,[r0] 
ldr r4,[r0,#4] 
adds r6,r2,r4 
adc r5,r1,r3 
ldr r0,=result 
str r5,[r0] 
str r6,[r0,#4] 
swi &11 
value1 dcd &BBBBBBBB,&AAAAAAAA 
value2 dcd &CCCCCCCC,&FFFFFFFF 
result dcd &0
2 write an ALP for addition two 32 bits numbers . 
AREA ADDTIN,CODE 
ENTRY 
ldr r0,=value1 
ldr r1,[r0] 
ldr r0,=value2 
ldr r2,[r0] 
adds r3,r2,r1 
value1 dcd &BBBBBBBB 
value2 dcd &CCCCCCCC 
end
;/*Program to find smallest of N numbers*/ 
AREA arr,code 
ENTRY 
main 
ldr r0,=data1 
ldr r3,=0x40000000 
ldr r4,=0x05 ;//length of loop 
ldr r1,[r0],#04 
sub r4,r4,#01 
back 
ldr r2,[r0] 
cmp r1,r2 
bls less ;// branch on low 
mov r1,r2 
less 
add r0,r0,#04 
sub r4,r4,#01 
cmp r4,#00 
bne back 
str r1,[r3] ;// smallest value stored in memory location 
stop b stop 
AREA data,code 
data1 dcd &64,&05,&96,&10,&65 
END
;/*Program to find largest of N numbers*/ 
AREA arr,code 
ENTRY 
main 
ldr r0,=data1 
ldr r3,=0x40000000 
ldr r4,=0x05 ;//length of loop 
ldr r1,[r0],#04 
sub r4,r4,#01 
back 
ldr r2,[r0] 
cmp r1,r2 
bhs large ;// branch on low 
mov r1,r2 
large 
add r0,r0,#04 
sub r4,r4,#01 
cmp r4,#00 
bne back 
str r1,[r3] ;// smallest value stored in memory location 
stop b stop 
AREA data,code 
data1 dcd &64,&05,&9,&00,&65 
END
;/*Program to convert Hex to ascii*/ 
AREA arr,code 
entry 
main 
ldr r0,=value1 
ldr r1,[r0] 
mov r2,r1 
cmp r1,#0x09 
bhi grt 
add r1,r1,#0x30 ;//add 30 if data <9 
bl nxt1 
grt 
add r1,r1,#0x37 ;//add 37h if data>9 
nxt1 
ldr r4,=0x40000000 
str r1,[r4] 
stop b stop 
AREA data,code 
value1 dcd &07 
END
;/*Program to convert Ascii to hex*/ 
AREA arr,code 
entry 
main 
ldr r0,=value1 
ldr r1,[r0] 
mov r2,r1 
cmp r1,#0x39 
bhi grt 
sub r1,r1,#0x30 ;//SUB 30 if data <39 
bl nxt1 
grt 
sub r1,r1,#0x37 ;//SUB 37h if data>39 
nxt1 
ldr r4,=0x40000000 
str r1,[r4] 
stop b stop 
AREA data,code 
value1 dcd &41 
END
;/*Progarm to generate N Fibonic numbers*/ 
AREA arr,code 
ENTRY 
main 
ldr r0,=value 
ldr r1,[r0] 
ldr r2,=0x40000000 ;/*memory location fibonic series*/ 
ldr r9,=0x02 
ldr r3,=0x00 
mov r6,r2 
str r3,[r2],#04 
add r3,r3,#01 
mov r7,r2 
str r3,[r2],#04 
back 
ldr r4,[r6],#04 
ldr r5,[r7],#04 
add r5,r4,r5 
str r5,[r2],#04 
add r9,r9,#01 
cmp r9,r1 
BNE back 
stopb stop 
AREA data,code
value dcd &0a ;/* here ten fibonic numbers are ganerated*/ 
END
;//* To find the factorial of a given number using subroutine*// 
AREA arr,code 
ENTRY 
main 
ldr r0,=value 
bl fact ;// call subroutine fact 
ldr r1,=0x40000000 
str r5,[r1] 
stop b stop 
AREA data,code 
value dcd &0a 
fact 
mov r6,r14 
ldr r2,[r0] 
cmp r2,#00 
beq END1 
mov r3,r2 
loop 
sub r2,r2,#01 
cmp r2,#00 
mulne r3,r2,r3 
bne loop 
mov r5,r3 
bl END2
END1 
ldr r5,=0x01 
END2 
mov PC,r6 ;// return to main program. 
END
;//* To find the multiplication of two 32 bit number *// 
AREA ADDTIN,CODE 
ENTRY 
ldr r0,value1 
ldr r1,value2 
umull r4,r3,r1,r0 
value1 dcd &BBBBBBBB 
value2 dcd &CCCCCCCC 
end

More Related Content

What's hot

8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
Dr.YNM
 

What's hot (20)

ARM CORTEX M3 PPT
ARM CORTEX M3 PPTARM CORTEX M3 PPT
ARM CORTEX M3 PPT
 
Lect 2 ARM processor architecture
Lect 2 ARM processor architectureLect 2 ARM processor architecture
Lect 2 ARM processor architecture
 
Introduction to pic microcontroller
Introduction to pic microcontrollerIntroduction to pic microcontroller
Introduction to pic microcontroller
 
Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer model
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
 
ARM- Programmer's Model
ARM- Programmer's ModelARM- Programmer's Model
ARM- Programmer's Model
 
Introduction to ARM LPC2148
Introduction to ARM LPC2148Introduction to ARM LPC2148
Introduction to ARM LPC2148
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architecture
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb Instruction
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Arm7 Interfacing examples
Arm7   Interfacing examples Arm7   Interfacing examples
Arm7 Interfacing examples
 
Unit 3 mpmc
Unit 3 mpmcUnit 3 mpmc
Unit 3 mpmc
 
Module 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and ProgrammingModule 2 ARM CORTEX M3 Instruction Set and Programming
Module 2 ARM CORTEX M3 Instruction Set and Programming
 
8051 memory
8051 memory8051 memory
8051 memory
 
RISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set ComputingRISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set Computing
 
ARM architcture
ARM architcture ARM architcture
ARM architcture
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 

Viewers also liked

Programming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded SystemsProgramming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded Systems
joshparrish13
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
anishgoel
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
John Williams
 
Assignment of pseudo code
Assignment of pseudo codeAssignment of pseudo code
Assignment of pseudo code
Burhan Chaudhry
 

Viewers also liked (20)

Programming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded SystemsProgramming The Arm Microprocessor For Embedded Systems
Programming The Arm Microprocessor For Embedded Systems
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
 
Ppt
PptPpt
Ppt
 
Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)Timer counter in arm7(lpc2148)
Timer counter in arm7(lpc2148)
 
ARM Processor Tutorial
ARM Processor Tutorial ARM Processor Tutorial
ARM Processor Tutorial
 
Embedded c lab and keil c manual
Embedded  c  lab  and keil c  manualEmbedded  c  lab  and keil c  manual
Embedded c lab and keil c manual
 
Smart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSMSmart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSM
 
Arm teaching material
Arm teaching materialArm teaching material
Arm teaching material
 
Arm architecture
Arm architectureArm architecture
Arm architecture
 
ARM procedure calling conventions and recursion
ARM procedure calling conventions and recursionARM procedure calling conventions and recursion
ARM procedure calling conventions and recursion
 
Arm processor
Arm processorArm processor
Arm processor
 
Analog to Digital converter in ARM
Analog to Digital converter in ARMAnalog to Digital converter in ARM
Analog to Digital converter in ARM
 
Introduction to ARM
Introduction to ARMIntroduction to ARM
Introduction to ARM
 
PIPELINE INTERRUPTS
PIPELINE INTERRUPTSPIPELINE INTERRUPTS
PIPELINE INTERRUPTS
 
Arm7 architecture
Arm7 architectureArm7 architecture
Arm7 architecture
 
Unit ii arm7 thumb
Unit ii arm7 thumbUnit ii arm7 thumb
Unit ii arm7 thumb
 
Assignment of pseudo code
Assignment of pseudo codeAssignment of pseudo code
Assignment of pseudo code
 
Arm assembly language by Bournemouth Unversity
Arm assembly language by Bournemouth UnversityArm assembly language by Bournemouth Unversity
Arm assembly language by Bournemouth Unversity
 

Similar to ARM lab programs

Translate the following CC++ code into MIPS Assembly Codevoid ch.pdf
Translate the following CC++ code into MIPS Assembly Codevoid ch.pdfTranslate the following CC++ code into MIPS Assembly Codevoid ch.pdf
Translate the following CC++ code into MIPS Assembly Codevoid ch.pdf
fcsondhiindia
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
bolovv
 

Similar to ARM lab programs (20)

ARM inst set part 2
ARM inst set part 2ARM inst set part 2
ARM inst set part 2
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Unit vi
Unit viUnit vi
Unit vi
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Lathe Spindle Sensor
Lathe Spindle SensorLathe Spindle Sensor
Lathe Spindle Sensor
 
Module 2 PPT of ES.pptx
Module 2 PPT of ES.pptxModule 2 PPT of ES.pptx
Module 2 PPT of ES.pptx
 
15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5
 
Lec2.ppt
Lec2.pptLec2.ppt
Lec2.ppt
 
커널코드분석 20140621(head.s restart)
커널코드분석 20140621(head.s restart)커널코드분석 20140621(head.s restart)
커널코드분석 20140621(head.s restart)
 
Ch2 arm-1
Ch2 arm-1Ch2 arm-1
Ch2 arm-1
 
ch2-arm-1.ppt
ch2-arm-1.pptch2-arm-1.ppt
ch2-arm-1.ppt
 
Translate the following CC++ code into MIPS Assembly Codevoid ch.pdf
Translate the following CC++ code into MIPS Assembly Codevoid ch.pdfTranslate the following CC++ code into MIPS Assembly Codevoid ch.pdf
Translate the following CC++ code into MIPS Assembly Codevoid ch.pdf
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 
assembly
assemblyassembly
assembly
 
Ch9a
Ch9aCh9a
Ch9a
 
Arm (2)
Arm (2)Arm (2)
Arm (2)
 
Avr instruction set
Avr instruction setAvr instruction set
Avr instruction set
 
Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014Advanced Techniques: Size | Pebble Developer Retreat 2014
Advanced Techniques: Size | Pebble Developer Retreat 2014
 
L3_Representing Instructions in the Computer.pptx
L3_Representing Instructions in the Computer.pptxL3_Representing Instructions in the Computer.pptx
L3_Representing Instructions in the Computer.pptx
 
S emb t4-arch_cpu
S emb t4-arch_cpuS emb t4-arch_cpu
S emb t4-arch_cpu
 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Recently uploaded (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 

ARM lab programs

  • 1. 1 write an ALP for addition two 64 bit numbers . AREA ADDTIN,CODE ENTRY ldr r0,=value1 ldr r1,[r0] ldr r2,[r0,#4] ldr r0,=value2 ldr r3,[r0] ldr r4,[r0,#4] adds r6,r2,r4 adc r5,r1,r3 ldr r0,=result str r5,[r0] str r6,[r0,#4] swi &11 value1 dcd &BBBBBBBB,&AAAAAAAA value2 dcd &CCCCCCCC,&FFFFFFFF result dcd &0
  • 2. 2 write an ALP for addition two 32 bits numbers . AREA ADDTIN,CODE ENTRY ldr r0,=value1 ldr r1,[r0] ldr r0,=value2 ldr r2,[r0] adds r3,r2,r1 value1 dcd &BBBBBBBB value2 dcd &CCCCCCCC end
  • 3.
  • 4. ;/*Program to find smallest of N numbers*/ AREA arr,code ENTRY main ldr r0,=data1 ldr r3,=0x40000000 ldr r4,=0x05 ;//length of loop ldr r1,[r0],#04 sub r4,r4,#01 back ldr r2,[r0] cmp r1,r2 bls less ;// branch on low mov r1,r2 less add r0,r0,#04 sub r4,r4,#01 cmp r4,#00 bne back str r1,[r3] ;// smallest value stored in memory location stop b stop AREA data,code data1 dcd &64,&05,&96,&10,&65 END
  • 5.
  • 6. ;/*Program to find largest of N numbers*/ AREA arr,code ENTRY main ldr r0,=data1 ldr r3,=0x40000000 ldr r4,=0x05 ;//length of loop ldr r1,[r0],#04 sub r4,r4,#01 back ldr r2,[r0] cmp r1,r2 bhs large ;// branch on low mov r1,r2 large add r0,r0,#04 sub r4,r4,#01 cmp r4,#00 bne back str r1,[r3] ;// smallest value stored in memory location stop b stop AREA data,code data1 dcd &64,&05,&9,&00,&65 END
  • 7.
  • 8. ;/*Program to convert Hex to ascii*/ AREA arr,code entry main ldr r0,=value1 ldr r1,[r0] mov r2,r1 cmp r1,#0x09 bhi grt add r1,r1,#0x30 ;//add 30 if data <9 bl nxt1 grt add r1,r1,#0x37 ;//add 37h if data>9 nxt1 ldr r4,=0x40000000 str r1,[r4] stop b stop AREA data,code value1 dcd &07 END
  • 9.
  • 10. ;/*Program to convert Ascii to hex*/ AREA arr,code entry main ldr r0,=value1 ldr r1,[r0] mov r2,r1 cmp r1,#0x39 bhi grt sub r1,r1,#0x30 ;//SUB 30 if data <39 bl nxt1 grt sub r1,r1,#0x37 ;//SUB 37h if data>39 nxt1 ldr r4,=0x40000000 str r1,[r4] stop b stop AREA data,code value1 dcd &41 END
  • 11.
  • 12. ;/*Progarm to generate N Fibonic numbers*/ AREA arr,code ENTRY main ldr r0,=value ldr r1,[r0] ldr r2,=0x40000000 ;/*memory location fibonic series*/ ldr r9,=0x02 ldr r3,=0x00 mov r6,r2 str r3,[r2],#04 add r3,r3,#01 mov r7,r2 str r3,[r2],#04 back ldr r4,[r6],#04 ldr r5,[r7],#04 add r5,r4,r5 str r5,[r2],#04 add r9,r9,#01 cmp r9,r1 BNE back stopb stop AREA data,code
  • 13. value dcd &0a ;/* here ten fibonic numbers are ganerated*/ END
  • 14. ;//* To find the factorial of a given number using subroutine*// AREA arr,code ENTRY main ldr r0,=value bl fact ;// call subroutine fact ldr r1,=0x40000000 str r5,[r1] stop b stop AREA data,code value dcd &0a fact mov r6,r14 ldr r2,[r0] cmp r2,#00 beq END1 mov r3,r2 loop sub r2,r2,#01 cmp r2,#00 mulne r3,r2,r3 bne loop mov r5,r3 bl END2
  • 15. END1 ldr r5,=0x01 END2 mov PC,r6 ;// return to main program. END
  • 16. ;//* To find the multiplication of two 32 bit number *// AREA ADDTIN,CODE ENTRY ldr r0,value1 ldr r1,value2 umull r4,r3,r1,r0 value1 dcd &BBBBBBBB value2 dcd &CCCCCCCC end