I was given the following MARIE instruction set and told to output what the symbol table was for the first pass, and the result in the AC. The problem is, I don't even think this is possible:
Hex
Address Label Instruction
100 Start, LOAD A
101 ADD B
102 STORE D
103 CLEAR
104 OUTPUT
105 ADDI D
106 STORE B
107 HALT
108 A, HEX 00FC
I just don't see how we can ADD B
when the label isn't declared below, and the fact that to ADDI D
, we'd need to have the actual value stored in B. Otherwise the assembler will do the first pass, not find a label associated for B after the instructions, and then keep looping trying to add B to the AC, store it in D, add the pointer associated with D to the AC, and going back to store B.
I'd appreciate any info or pointers (no pun intended) on what I may be missing here.