Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SIC assembler language program, in C Program. Write pass one of a two-pass assembler for the SIC assembler language program. As with Phase 1, this

SIC assembler language program, in C Program.

Write pass one of a two-pass assembler for the SIC assembler language program. As with Phase 1, this is to be written in C (not C++) and must run successfully on the Linux server.

Pass one will read each line of the source file, and begin the process of translating it to object code. (Note: it will be to your advantage to have a separate procedure handle reading, and perhaps tokenizing, the source file.) Among other things, this pass will create the symbol table.

At the end of the pass, the symbol table should be printed, showing each symbol together with its location. This pass must also recognize and handle the assembler mnemonics in addition to the directives START, END, BYTE, WORD, RESB, and RESW.

It should also be able to recognize the following types of errors (note that this is not an exhaustive list):

Duplicate labels

Illegal label (note: could specify why it is illegal, but not necessary)

Illegal operation Missing or illegal operand on data storage directive (only for BYTE, RESB, and RESW)

Missing or illegal operand on START directive

Missing or illegal operand on END directive (note: you do not need to check if the symbol is defined)

Too many symbols in source program

Program too long

After flagging an error, your assembler should continue processing the source file so that all errors are flagged in a single run. These errors will not be printed, but must be passed to the second pass of the assembler. NOTE: Your assembler should not terminate abnormally because of anything (legal or not) in the source program being assembled.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago