🛣️

Path tracing

TypeQuiz 3 Material
  1. PC points initial location x30F6. PC = 30F6
  1. 1110 = LEA, LEA R1, #-3
    1. Add incremented PC and offset
    1. R1 = 30F7 + FFFD(-3) = 30F4
    1. R1 = 30F4, PC = 30F7
  1. 0001 = ADD, ADD R2, R1, #14
    1. R1 = 30F4, R2 = 30F4 + 000E = 3012
    1. PC = 30F8(increment), R2 = 3012, R1 = 30F4
  1. 0011 = ST, ST R2, #-5
    1. stores the contents of R2 at PC -5
    1. PC = 30F9, address = 30F9 - #5 = 30F4
    1. Content at Mem(30F4) = 3012(value of R2), PC = 30F9
  1. 0101 = AND, AND R2, R2, #0
    1. R2 = 0, PC = 30FA
  1. 0001 = ADD, ADD R2, R2, #5
    1. PC = 30FB
    1. R2 = 0
    1. R2 = R2 + 5 = 0 + 5 = 5
  1. 0111 = STR, STR R2, R1, 14
    1. PC = 30FC
    1. R1 = 30F4, Address = 30F4 + #14 = 3102
    1. Content at 3102 = 5
    1. R2 = 5
  1. 1010 = LDI, LDI R3, #-9
    1. PC = 30FD + #-9 = 30F4
    1. Content at 30F4 = 3102, 3102 is the operand address
    1. Content at 3012 = 5, R3 = 5, PC = 30FD