1

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.

Armani
  • 23
  • 1
  • 6
  • 1
    this is node an instruction set, it's a piece of code. You're right when you say this code will not assemble without an error, but I think this is not the question here. in 2 step assemblers, the first pass often only collects all label-address relations, wouldn't find B and D, and complain about this in the 2nd pass, or at the latest when trying to link – Tommylee2k Nov 22 '17 at 09:57

0 Answers0