Question: Help with LC3 assembly code: Hello. I have this assignment right now for the following image: I have an assembly code below right now, but
Help with LC3 assembly code:
Hello. I have this assignment right now for the following image:

I have an assembly code below right now, but I'm getting a few errors, specifically that Line 2, 4 and 10 are "Instruction references undefined label 'PC'" and "Instruction references non-addressable memory location -1." May I have some help fixing these? thank you.

.ORIG x30F6 LEA R1, PC ADD R2, R1, #14 ST R2, PC AND R2, R2, #0 ADD R2, R2, #5
LDR R2, R1, #14 LDI R2, PC .END
Code this machine language program in assembly language. Attach the assembly source code file. In-Class Assignment - Write .asm to generate this binary output Address Instruction Comments x30F6 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 R1 PC-3 = x30F4 x30F7 0 0 0 1 0 1 0 0 0 1 1 0 1 1 1 0 R2 R1 + 14 = x3102 x30F8 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 MIPC - 5] R2 M[x30F4] - *3102 x30F9 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 R20 x30FA 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 R2 R2 + 5 = 5 x30FB 0 1 1 1 0 1 0 0 0 1 0 0 1 1 1 0 M[R1+14) R2 M[x3102] 5 R3 - MIM[X30F41 R3 - M[X3102] R35 x30FC 1 0 1 0 0 1 1 1 1 1 1 1 0 1 1 1 Starting Pass 1... Pass 1-0 error(s) Starting Pass 2... Line 2: Instruction references undefined label 'PC' Line 2: Instruction references non-addressable memory location -1 Line 4: Instruction references undefined label 'PC' Line 4: Instruction references non-addressable memory location-1 Line 10: Instruction references undefined label 'PC' Line 10: Instruction references non-addressable memory location -1 Pass 2-6 error(s) Code this machine language program in assembly language. Attach the assembly source code file. In-Class Assignment - Write .asm to generate this binary output Address Instruction Comments x30F6 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 1 R1 PC-3 = x30F4 x30F7 0 0 0 1 0 1 0 0 0 1 1 0 1 1 1 0 R2 R1 + 14 = x3102 x30F8 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 MIPC - 5] R2 M[x30F4] - *3102 x30F9 0 1 0 1 0 1 0 0 1 0 1 0 0 0 0 0 R20 x30FA 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 R2 R2 + 5 = 5 x30FB 0 1 1 1 0 1 0 0 0 1 0 0 1 1 1 0 M[R1+14) R2 M[x3102] 5 R3 - MIM[X30F41 R3 - M[X3102] R35 x30FC 1 0 1 0 0 1 1 1 1 1 1 1 0 1 1 1 Starting Pass 1... Pass 1-0 error(s) Starting Pass 2... Line 2: Instruction references undefined label 'PC' Line 2: Instruction references non-addressable memory location -1 Line 4: Instruction references undefined label 'PC' Line 4: Instruction references non-addressable memory location-1 Line 10: Instruction references undefined label 'PC' Line 10: Instruction references non-addressable memory location -1 Pass 2-6 error(s)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
