MOV R2, #A
MOV R3, #A+400
ADD R2, #4
CMP R2, R3
BLT LOOP
MOV R1, #0
MOV R2, #400
ADD R2, #4 ADD R1, #4
CMP R1, R2
BLT LOOP
(3 pt) Suppose you have an ISA instruction sets:
MOV, ADD, CMP and conditional JMPxx (eq, ne, lt, gt, le, ge) ... equal, not equal, less than, etc
Implement the following C program in ISA instructions with register indirect addressing.
int A[100];
for (i=0; i<100; i++) A[i] = A[i] + 4;
(3 pt) Same problem as above, but implement it with index addressing.