Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have an assembly language assignment. I need to explain what the code above is doing. Could you please explain what the code above is

image text in transcribed

I have an assembly language assignment. I need to explain what the code above is doing. Could you please explain what the code above is doing line by line? Please explain as much detail as possible.

***** ************ 2 2 i Program PracticeLab.s 3 ; Clear memory locations 0x2000.0400 - 0x2000.041F, 4 ; then load these locations with consecutive numbers starting 5 i with 00 6 ; 'CONST' is the number of locations operated on. 7 ; 'FIRST' is the address of first memory address. 8 ***** ******* *** 9 10 ************ 11 ; EQU Directives 12 ; These directives do not allocate memory 13 ;***********wwwwwwwwwww*************** 14 ; SYMBOL DIRECTIVE VALUE COMMENT 15 16 FIRST EQU 0x20000400 17 CONST EQU Ox20 18 19 i Program section 20 *** 21 LABEL DIRECTIVE VALUE COMMENT 22 AREA main, READONLY, CODE 23 THUMB 24 EXPORT main 25 26 27 LDR R1,=FIRST ; Initialize registers 28 MOV RO,#0x00 i 29 LDR R2, CONST i 30 loop1 STRB RO, (R1] ; Clear memory 31 ADD R1, R1, #1 ; Increment address 32 SUBS R2, R2, #1 ; Decrement contant 33 BNE loopl 34 LDR R1,=FIRST ; Reset address 35 LDR R2,=CONST ; Reset constant 36 loop2 STRE RO, [R] ; Store value in memory 37 ADD RO, RO, #1 i Increment value 38 ADD RI, R1, #1 ; Increment address 39 SUBS R2, R2, #1 i Decrement contant 40 BNE loop2 41 done WFI ; Infinite loop to 42 B done ; end program 43 ****** ***** 44 ; End of the program section 45 *************************** ** 46 ; LABEL DIRECTIVE VALUE 47 END 48 _main COMMENT

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions