Question: Identify and correct the errors in the following programs in assembly arm language t01 Assign to and add contents of registers. ------------------------------------------------------- */ .org 0x1000
Identify and correct the errors in the following programs in assembly arm language
t01
Assign to and add contents of registers. ------------------------------------------------------- */ .org 0x1000 // Start at memory location 1000 .text // Code section .global _start _start: // Copy data from memory to registers LDR R3, A; LDR R0, [R3] LDR R3, B: LDR R1, [R3] ADD R2, R1, [R0] // Copy data to memory LDR R3, =Result // Assign address of Result to R3 STR R2, [R3] // Store contents of R2 to address in R3 // End program _stop: B _stop .data // Initialized data section A: .word 4 B: .word 8 .bss // Uninitialized data section Result: .space 4 // Set aside 4 bytes for result .end
t02
Copies contents of one vector to another. ------------------------------------------------------- */ .org 0x1000 // Start at memory location 1000 .text // Code section .global _start _start: .text // code section // Copy contents of first element of Vec1 to Vec2 LDR R0, =Vec1 LDR R1, =Vec2 LDR R2, [R0] STR R2, [R1] // Copy contents of second element of Vec1 to Vec2 ADD R0, R0, #2 ADD R1, R1, #2 LDR R2, [R0] STR R2, [R1] // Copy contents of second element of Vec1 to Vec2 ADD R1, R1, #4 ADD R1, R1, #4 LDR R2, [R0] STR R2, [R2] // End program _stop: B _stop .data // Initialized data section Vec1: .word 1, 2, 3 .bss // Uninitialized data section Vec2: .word 6 .end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
