Question: In this program you are to simulate a 2-pass assembler in C++. The input to this program is an assembly language program (see the handout

In this program you are to simulate a 2-pass assembler in C++. The input to this program is an assembly language program (see the handout on SMC 68000) and the output should include a symbol table and the machine code version of the input. You have to echo the input. Do file I/O You are implementing two classical algorithms (Fig. 6.1 & Fig 6.2) INPUT ORG MOVE #79, $00002000 TRAP #1 MOVEDO, S00002004STORE DO IN LOCATION Y MOVE S00002000, DO FETCH VARIABLE I FOR THE AD ADD MOVE DO, S00002002 ADDI #18,$00002002 ADD 18 TOX TRAP #2 TRAP END S00000500 READLN (Y), INPUT INTO DO LOOP1 S00002004, DOADD Y+ STORE THE SUM IN X LOOP2 PRINTX STOP #0 OUTPUT Address 00000500 33FC Machine code Operands Instructions 4F MOVE #79, $00002000 SYMBOL TABLE LABEL 1 ADDRESS LABEL 2 ADDRESS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
