Question: Print the values in an array in ARM Assembly. You may use the SWI_PrInt and SWI_PrChr instructions. Here is a start to the code just
Print the values in an array in ARM Assembly. You may use the SWI_PrInt and SWI_PrChr instructions. Here is a start to the code just need print_array finished
@ Print the array LDR R2, =_Data LDR R1, =Data SUB R2, R2, R1 STMFD SP!, {R2} @ Push length of list STMFD SP!, {R1} @ Push address of list BL print_array ADD SP, SP, #8 BL PrintLF PrintLF: /* ------------------------------------------------------- Prints the line feed character ( ) ------------------------------------------------------- Uses: R0 - set to ' ' (SWI_PrChr automatically prints to stdout) ------------------------------------------------------- */ STMFD SP!, {R0, LR} MOV R0, #' ' @ Define the line feed character SWI SWI_PrChr @ Print the character to Stdout LDMFD SP!, {R0, PC} print_array: /* ------------------------------------------------------- Prints all integer values comma-separated in an array of bytes. (i.e. 2,4,7,1,6,...) with no trailing comma. Parameters passed on stack: Address of list Length of lis */
CODE HERE
.data Data: .byte 4,5,9,0,8,0,8,7,1 @ The list of data _Data: @ End of list address .end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
