Question: Write a MIPS Assembly program for the following if else High Level Language program ## if-else example ## Pseudo code: ## if (A > 0)
Write a MIPS Assembly program for the following if else High Level Language program
## if-else example
## Pseudo code:
## if (A > 0) then
## B= C div A
## else
## B= A + 10;
## You may use the following pseudoinstructions div with 3 registers div rd, rs, rt where quotient of rs and rt is put into rd
load immediate li rd, imm move imm into register rd
unconditional branch b label go to instruction at label
branch on less than or equal to zero blez rs, label conditionally branch to instruction at label if rs <=0
branch on equal zero beqz rs, label conditionally branch to instruction at label if rs equals 0
branch on not equal zero bnez rs, label conditionally branch to instruction at label if rs not equal to 0
move rd, rs - move register rs to rd
You may read two integers A and C from the user and print B on the console.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
