Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING MARS 4 . 5 . MIPS We have been learning about loops in Assembly language. In this project you need to write a program

USING MARS 4.5. MIPS We have been learning about loops in Assembly language. In this project you need to write a program that will print every other capital letter of the alphabet, starting with A. Chapter 7.8.4 Translating branch instructions to machine code
Now that the method of calculating the branch offsets for the branch instructions has been
explained, the following program shows an example of calculating the branch offsets in a
program. Note that in this example, the trick of dropping the last two bits of the address will be
used, so the branch offsets can be used simply by adding/subtracting line numbers. Therefore,
the text will read "the $pc points to line", which is correct, as opposed to "the $pc contains the
address of line", which would be incorrect.
Start with the program as written by the programmer. Note that there are 3 branch
statements. Only these 3 branch statements will be translated to machine code. In this case
the entire program, including comments, is included so that the reader understands the
program. However, comments are not kept when a translation to machine code is made, so
the subsequent presentations of these programs will drop the comments.Author: Charles KannPurpose: Print even numbers from 1 to 1012/29/2013- Initial releasePseudo Code
#global main()
#{register int ifor (i=1; i 11; i++)if ((i %2)==0)print("Even number: "+ i)}
#}
.text
.globl main
main# $so - iBeginForLoop:slt $t0, $s0, $t0 addi $t0, $zero, 2 div $s0,$t0 seq $t0, $t0,0 la $a0, result jal PrintInt Odd: b BeginForLoopjal Exit
.data.include "utils.asm"
For example, your output would start: A C E G I ...
There is an example of a for loop in Ch 7.8.4. This will help you get started. Also remember the ASCII table in Ch 1.3. Also please comment and screenshot the code and output please
image text in transcribed

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

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions