Question: Part2: Using the second s program as a reference, and use the same steps to edit, assemble, link, run, and debug the new program. -
Part2: Using the second s program as a reference, and use the same steps to edit, assemble, link, run, and debug the new program. - Write a program that calculates the following expression: Register = val2 + 9 + val3 - vall Assume that vall, val2, and val3 are 32-bit integer memory variables. . Besides, Vall, val2 and val3 are integers. Assign val2=11, val3=16, vall=6. . Register could be any of the Arm general purpose registers . Use the debugger to verify the result in the memories and the Register. Report the Register value in hex (as shown in the debugger) name your program a arithmetic2.s Assemble, Link, run, and debug the program Report what you see or observe (include screenshots and snippets) 2. Type the following in the terminal window, along with the file name: nano seconds Note: Control-w writes the file (save): control-x exits the editor 3. Write the following program using nano and save it (control-w) a second program: c = a + b section.data a: .word 2 a 32-bit variable a in memory b: .word 5 @ 32-bit variable b in memory c.word O a 32-bit variable e in memory .section .text globl start start: Idr rl. a load the memory address of a intor! Idr rl, [rl] a load the value a into rl Idr r2. =b a load the memory address of b into r2 Idr r2. [12] a load the value b into r2 addrl, rl, r2 @ addrl to r2 and store into rl Idr r2. c a load the memory address of cintor2 str rl, [12] @ store rl into memory c mov 17, #1 sve NO end @ Program Termination: exit syscall @ Program Termination: wake kernel 4. To assemble the file, type the following command: Part2: Using the second s program as a reference, and use the same steps to edit, assemble, link, run, and debug the new program. - Write a program that calculates the following expression: Register = val2 + 9 + val3 - vall Assume that vall, val2, and val3 are 32-bit integer memory variables. . Besides, Vall, val2 and val3 are integers. Assign val2=11, val3=16, vall=6. . Register could be any of the Arm general purpose registers . Use the debugger to verify the result in the memories and the Register. Report the Register value in hex (as shown in the debugger) name your program a arithmetic2.s Assemble, Link, run, and debug the program Report what you see or observe (include screenshots and snippets) 2. Type the following in the terminal window, along with the file name: nano seconds Note: Control-w writes the file (save): control-x exits the editor 3. Write the following program using nano and save it (control-w) a second program: c = a + b section.data a: .word 2 a 32-bit variable a in memory b: .word 5 @ 32-bit variable b in memory c.word O a 32-bit variable e in memory .section .text globl start start: Idr rl. a load the memory address of a intor! Idr rl, [rl] a load the value a into rl Idr r2. =b a load the memory address of b into r2 Idr r2. [12] a load the value b into r2 addrl, rl, r2 @ addrl to r2 and store into rl Idr r2. c a load the memory address of cintor2 str rl, [12] @ store rl into memory c mov 17, #1 sve NO end @ Program Termination: exit syscall @ Program Termination: wake kernel 4. To assemble the file, type the following command
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
