Question: The following code reads from variable N, adds 10, and stores the result in variable M. Both variables are 8-bit unsigned. The C implementation of
The following code reads from variable N, adds 10, and stores the result in variable M. Both variables are 8-bit unsigned. The C implementation of the assembly code is:
M = N +10
LDR R3, =N ; R3 = &N (R3 points to N)
LDRB R1, [R3] ; R1 = N ADD R0, R1, #10 ; R0 = N + 10
LDR R2, =M ; R2 = &M (R2 points to M)
STRB R0, [R2] ; M = N +10
Modify the program given above, so it operates on unsigned 16-bit variables.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
