Answer To: Introduction Your task for this lab is to write a program that extends the simulation of the ARM...
Swapnil answered on Nov 01 2021
95124/code.txt
100 512 0 0 0
104 24 0 0 0
108 22 0 0 0
200 ADDI X0, XZR, #100
204 LDUR X9, [X0, #0]
208 SUBI SP, SP, #8
212 STUR X0, [SP, #0]
216 ADDI X0, X0, #4
220 LDUR X10, [X0, #4]
224 ADD X9, X9, X10
228 SUBI SP, SP, #800
95124/code1.txt
100 256 0 0 0 0
104 0 0 0 0 0
108 16 0 0 0 0
200 ADDI X3, XZR, #100
204 LDUR X1, [X3, #0]
208 LDUR X2, [X3, #8]
212 SUBI SP, SP, #16
216 STUR X2, [SP, #8]
220 STUR X1, [SP, #0]
224 BL 248
228 LDUR X2, [SP, #0]
232 LDUR X3, [SP, #8]
236 ADDI SP, SP, #16
240 STUR X1, [SP, #0]
244 BR XZR
248 ADD X1, XZR, XZR
252 LDUR X2, [SP, #0]
256 LDUR X3, [SP, #8]
260 SUB X2, X2, X3
264 ADDI X1, X1, #1
268 CBZ X2, 276, 0
272 B 260, 0, 0
276 BR LR, 0, 0
95124/output.txt
INSTRUCTION: ADDI X3, XZR, #100
Registers:
X3 = 100 SP = 1192 LR = 0 PC = 204
Stack:
1192 :
INSTRUCTION: LDUR X1, [X3, #0]
Registers:
X1 = 256 X3 = 100 SP = 1192 LR = 0 PC = 208
Stack:
1192 :
INSTRUCTION: LDUR X2, [X3, #8]
Registers:
X1 = 256 X2 = 16 X3 = 100 SP = 1192 LR = 0 PC = 212
Stack:
1192 :
INSTRUCTION: SUBI SP, SP, #16
Registers:
X1 = 256 X2 = 16 X3 = 100 SP = 1176 LR = 0 PC = 216
Stack:
1192 :
1184 :
1176 :
INSTRUCTION: STUR X2, [SP, #8]
Registers:
X1 = 256 X2 = 16 X3 = 100 SP = 1176 LR = 0 PC = 220
Stack:
1192 :
1184 : 16
1176 :
INSTRUCTION: STUR X1, [SP, #0]
Registers:
X1 = 256 X2 = 16 X3 = 100 SP = 1176 LR = 0 PC = 224
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: BL 248
, [SP, #0]
Registers:
X1 = 256 X2 = 16 X3 = 100 SP = 1176 LR = 228 PC = 248
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADD X1, XZR, XZR
Registers:
X2 = 16 X3 = 100 SP = 1176 LR = 228 PC = 252
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: LDUR X2, [SP, #0]
Registers:
X2 = 256 X3 = 100 SP = 1176 LR = 228 PC = 256
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: LDUR X3, [SP, #8]
Registers:
X2 = 256 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X2 = 240 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 1 X2 = 240 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 1 X2 = 240 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 1 X2 = 240 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 1 X2 = 224 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 2 X2 = 224 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 2 X2 = 224 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 2 X2 = 224 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 2 X2 = 208 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 3 X2 = 208 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 3 X2 = 208 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 3 X2 = 208 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 3 X2 = 192 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 4 X2 = 192 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 4 X2 = 192 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 4 X2 = 192 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 4 X2 = 176 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 5 X2 = 176 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 5 X2 = 176 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 5 X2 = 176 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 5 X2 = 160 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 6 X2 = 160 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 6 X2 = 160 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 6 X2 = 160 X3 = 16 SP = 1176 LR = 228 PC = 260
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: SUB X2, X2, X3
Registers:
X1 = 6 X2 = 144 X3 = 16 SP = 1176 LR = 228 PC = 264
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: ADDI X1, X1, #1
Registers:
X1 = 7 X2 = 144 X3 = 16 SP = 1176 LR = 228 PC = 268
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: CBZ X2, 276, 0
Registers:
X1 = 7 X2 = 144 X3 = 16 SP = 1176 LR = 228 PC = 272
Stack:
1192 :
1184 : 16
1176 : 256
INSTRUCTION: B 260, 0, 0
Registers:
X1 = 7 X2 = 144 X3 = 16 SP = 1176 LR = 228...