Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer in Arm Copy the contents of l03_t03.s into the CPUlator. Rewrite the program so that LED_BITS is stored in a memory location rather
Please answer in Arm
Copy the contents of l03_t03.s into the CPUlator. Rewrite the program so that LED_BITS is stored in a memory location rather than defined with an .equ, and add a memory location named DELAY_TIME that stores the delay time 200000000 rather than defining it in the body of the program.
Alter these values in memory, and compile and run the program again. What effects do your changes have?
l03_t03.s: */ // Constants .equ TIMER, 0xfffec600 .equ LEDS, 0xff200000 .equ LED_BITS, 0x0F0F0F0F .org 0x1000 // Start at memory location 1000 .text // Code section .global _start _start: LDR R0, =LEDS // LEDs base address LDR R1, =TIMER // private timer base address LDR R2, =LED_BITS // value to set LEDs LDR R3, =200000000 // timeout = 1/(200 MHz) x 200x10^6 = 1 sec STR R3, [R1] // write timeout to timer load register MOV R3, #0b011 // set bits: mode = 1 (auto), enable = 1 STR R3, [R1, #0x8] // write to timer control register LOOP: STR R2, [R0] // load the LEDs WAIT: LDR R3, [R1, #0xC] // read timer status CMP R3, #0 BEQ WAIT // wait for timer to expire STR R3, [R1, #0xC] // reset timer flag bit ROR R2, #1 // rotate the LED bits B LOOP .end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started