Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is a really old book so assistance from an experience coder would be preferable. I need assistance in writing this pass 1 assembler in
this is a really old book so assistance from an experience coder would be preferable. I need assistance in writing this pass 1 assembler in C. I'm currently working on it in Linux and I can't quite get the hashing to display correctly. the output should look like somewhat like the image above the book. Will Rate. thanks in advance.
address Symbol Value LENGTH 100C ROREC 1000 4547 4600 00030000 00xxXXXX KEXXEXR 20130 ZERO 1006 0100 1810063048- 12 WRREC 201F 1000 0ice BUFFER CLOOP 2012 are d Of semb Pass 1: read first input line if OROODE STARTthen tand save #10PERAND] as starting address initialize LOOCTR write line to intermediate tile read next input line n F to starting address 18-21 and fif START) initialize LOCCTR to begin while oFcODE END' do if this is not a comment line then begin if there is a symbol in the LABEL field then begin search sYMIAB for LABEL if found then ng tools g and riai set error flag (duplicate symbol) else insert (LABEL. LOCCTR) into SYMPAB and (if symbol) search oPTAB for OPCODE if found then else if OPCODE= 'WORD' then else if OPCODE'RESW' then else if OPCODE RESB, then else if OPCODE 'BYTE' then add 3 finstruction length) to LOCCTR add 3 to LOOCTR add 3 * # [OPERAND) to LOCCTR add N[OPERAND] to LOCCTR begin RES n asse the ede bler thos find length of constant in bytes add length to LOCCTR and (if BYTE) else ght b the s write last line to intermediate file set error flag (invalid operation code) end fif not a comment) write line to intermediate file read next input line end (while not END) save (LOCCTR starting address) as program length end (Pass 1) Figure 2.4(a) Algorithm for Pass 1 of assemblerStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started