Question: Assemblers are programs to translate an assembly file into a specific machine language. Most of the compilers and assemblers are written in C language. Since
Assemblers are programs to translate an assembly file into a specific machine language. Most of the compilers and assemblers are written in C language. Since you are familiar with MIPS encoding syntaxes, I designed the following C project:
In this project, you will create a simple assembler program for the MIPS assembly language by using C programming language. Your program receives the source code filename for example mycode.asm translates each instruction into the machine codeHEX or Binary and stores them with their associated address in an output file with the same name as the input file but with obj extension.
For Simplicity, only consider the following MIPS instructions:
ADD, SUB, AND, OR Rtype
ADDI, ANDI, SLL IType
BEQ, BNE Itype
J Jtype
The source code in the input file can contain several instructions with different types, The target address of BEG, BNE, and J instructions are determined by labels in the source code.
The start Address of the program is x
For example consider the following source codeFor example consider the following source code
text
again: add $$$
show: addi $$
andi $$
beq $$ show
bne $$
sll $ $
j again
the corresponding output file should contain the following Address and Code columnsonly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
