Question: 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 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 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 addingsubtracting line numbers. Therefore,
the text will read "the $pc points to line", which is correct, as opposed to "the $ contains the
address of line", which would be incorrect.
Start with the program as written by the programmer. Note that there are branch
statements. Only these 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 to Initial releasePseudo Code
#global main
#register int ifor i; i ; iif i printEven number: i
#
text
globl main
main# $so iBeginForLoop:slt $t $s $t addi $t $zero, div $s$t seq $t $t la $a 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 This will help you get started. Also remember the ASCII table in Ch Also please comment and screenshot the code and output please
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
