Answer To: CS413 Lab 1 ARM Program using Auto-Indexing - ADD Objective: The objective of this lab is to have...
Gaurav answered on Sep 07 2021
@ ARM Auto-Indexing to access array elements and to do nested subroutine calls
.globl main
.data
Array_1: .word 1, -6, -3, 78, -61, 142, 36, -711, 9, 131
Array_2: .word 2, -13, 3, 69, 0, -149, 34, 542, -9, 100
Array_3: .space 40
welcome_msg: .asciz "Welcome, CS413 Lab 1\nSum of array numbers\n"
prompt: .asciz "To display signed numbers in Array three\nEnter sign value [+, -, 0] : "
arr_1: .asciz "Array 1 :"
arr_2: .asciz "Array 2 :"
arr_3: .asciz "Array 3 :"
output: .asciz "Array values with the sign :"
int_str: .asciz "%5d"
newline: .asciz "\n"
char: .asciz "%c"
sign: .byte 1
.text
main:
PUSH {R4, R5, R6, LR} @ save registers and return address because it'll be corrupted while execueting
LDR R1, =Array_1
LDR R2, =Array_2
LDR R3, =Array_3 @ address of the arrays
@ Loop through all integers in array 1 & 2, add and store it in array 3
MOV R4, #10 @ number of element
sum_loop:
LDR R0, [R1], #4 @ get integers...