Assemblers are programs to translate an assembly file into a specific machine language. Most of the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 code(HEX 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 (R-type) ADDI, ANDI, SLL (I-Type) BEQ, BNE (1-type) J (J-type) 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 0x00400000 For example consider the following source code .text again: add show: addi andi x1: beq bne sll j $11, $12, $23 $8,$7,-1234 $3,$7,127 $8,$10, show $4,$6,x1 $17,$18,4 again the corresponding output file should contain the following Address and Code columns (only) Codc Basic Address 0x00400000 0x01975030 Add $11,$13,531 0x00400004 0x20e8fb2e addi $8,$7,-1234 0x00400008 0x30e3007fandi $3,$7,127 0x0040000c 0x110afffdbeq $8,$10,-3 0x00400010 0x14860000 bne $4, $6,0 0x00100011 0x00130900 811 $17,410,4 0x00400018 0x08100000j 0x00400000 3: Again: Add 3: show: addi 4: andi 5: beg 6: bne 7: x1: 811 8: j $11,$12,931 $8,$7,-1234 $3,$7,127 $8, $10, show $4,$6,x1 $17,410,4 again 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 code(HEX 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 (R-type) ADDI, ANDI, SLL (I-Type) BEQ, BNE (1-type) J (J-type) 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 0x00400000 For example consider the following source code .text again: add show: addi andi x1: beq bne sll j $11, $12, $23 $8,$7,-1234 $3,$7,127 $8,$10, show $4,$6,x1 $17,$18,4 again the corresponding output file should contain the following Address and Code columns (only) Codc Basic Address 0x00400000 0x01975030 Add $11,$13,531 0x00400004 0x20e8fb2e addi $8,$7,-1234 0x00400008 0x30e3007fandi $3,$7,127 0x0040000c 0x110afffdbeq $8,$10,-3 0x00400010 0x14860000 bne $4, $6,0 0x00100011 0x00130900 811 $17,410,4 0x00400018 0x08100000j 0x00400000 3: Again: Add 3: show: addi 4: andi 5: beg 6: bne 7: x1: 811 8: j $11,$12,931 $8,$7,-1234 $3,$7,127 $8, $10, show $4,$6,x1 $17,410,4 again
Expert Answer:
Answer rating: 100% (QA)
The image contains text that describes a project to create a simple assembler program for the MIPS a... View the full answer
Related Book For
Auditing and Assurance services an integrated approach
ISBN: 978-0132575959
14th Edition
Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
The common stock of Fido Corporation was trading at $45 per share on October 15, 2010. A year later, on October 15, 2011, it was trading at $80 per share. On this date, Fidos board of directors...
-
Weights of respondents were recorded as part of the California Health Interview Survey. The last digits of weights from 50 randomly selected respondents are listed below. 5 0 1 0 2 0 5 0 5 0 3 8 5 0...
-
In a bit of good news for male students, American men have closed the gap with women on life span, according to a USA Today article. Male life expectancy attained a record 75.2 years, and womens...
-
A scientist studies how the number of coyotes in San Diego County has changed over the last decade. Is this a population-level study, a community-level study, or an ecosystem-level study? Defend your...
-
Wamser Companys standard labor cost per unit of output is $20 (2 hours _ $10 per hour). During August, the company incurs 2,100 hours of direct labor at an hourly cost of $10.50 per hour in making...
-
ROA is 50 percent; the net profit margin is 10 percent; average total assets are $1,000,000; and the total asset turnover ratio is 5. What are net sales?
-
. For each of the specifications below give a state machine for the sequential circuit. Be sure to: o minimize the number of states in your machine, o draw the state diagram, and o identify the...
-
Solve for x. 17x+7=15 -4x Round your answer to the nearest thousandth. Do not round any intermediate computations.
-
Ali makes garments that are very popular. Units sold are anticipated as: Monthly Unit Sales October 1100 November 3,150 December 5,500 January 4,500 Total units sold 14,250 If seasonal production is...
-
If i weigh 130 pounds and i ate a dunkin donutsboston kreme donut (270 kcal) - how many miles do i have to run to burn off the energyequivalent to the donut? please show all work with units so i can...
-
1. Which social media marketing platform do you think is the most effective tool for marketing nowadays? Explain why? 2. When is the best date and time to launch a poster introducing a new footwear...
-
Mike leases a new pickup by paying $3200 up front and $259 a month over three years. The lease also stipulates he will be charged $0.15 per mile for every mile over 36,000. If he puts 39,928 miles on...
-
In its 2021 annual report to shareholders, Health Foods, Inc., disclosed the following information about some of its indebtedness: The fair value of convertible subordinated debentures is estimated...
-
Before the 1973 oil embargo and subsequent increases in the price of crude oil, gasoline usage in the United States had grown at a seasonally adjusted rate of 0.57 percent per month, with a standard...
-
State the six transaction-related audit objectives.
-
Multiple Choice Questions The following questions deal with liability under the 1933 and 1934 securities acts. Choose the best response. a. Major, Major, & Sharpe, CPAs, are the auditors of MacLain...
-
Identify the primary specific objectives that must be incorporated into the design of audit tests under the Single Audit Act.
-
Reconsider the data of Problem 31. Data from Problem 31 The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is...
-
The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is $20,000. Based on a future worth analysis, which...
-
Identify collinearity and explain its consequences for least squares estimation.
Study smarter with the SolutionInn App