Question
Arm assembly language 1- Create a new version of l05_t01.s named l05_t02.s that counts the values in the list and displays the count in r4,
Arm assembly language
1- Create a new version of l05_t01.s named l05_t02.s that counts the values in the list and displays the count in r4, and displays the number of bytes in the list in r5.
Can you determine the number of bytes in the list without using the loop?
l05_t01.s:
/* ------------------------------------------------------- list_demo.s A simple list demo program. Traverses all elements of an integer list. R0: temp storage of value in list R2: address of start of list R3: address of end of list ------------------------------------------------------- */ .org 0x1000 // Start at memory location 1000 .text // Code section .global _start _start:
LDR R2, =Data // Store address of start of list LDR R3, =_Data // Store address of end of list MOV R1, #0 // Initialize sum to zero
Loop: LDR R0, [R2], #4 // Read address with post-increment (R0 = *R2, R2 += 4) ADD R1, R1, R0 // Add value to sum CMP R3, R2 // Compare current address with end of list BNE Loop // If not at end, continue
// Display sum // Add your own code here to display the sum in R1
_stop: B _stop
.data .align Data: .word 4,5,-9,0,3,0,8,-7,12 // The list of data _Data: // End of list address
.end
2- Create a new version of l05_t02.s named l05_t03.s calculates the minimum and maximum values in the list, and displays them to r6 and r7 respectively. Use conditional execution to determine the minimum and maximum values.
Note: initialize the minimum and maximum values to the first value in the list. You may assume the list has at least two values.
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