Question
Assembly Language - using Mips in Mars Checks if a user-entered int between 0 & 255 (inclusive) is less than 32 & displays 0 if
Assembly Language - using Mips in Mars
Checks if a user-entered int between 0 & 255 (inclusive) is less than 32 & displays 0 if so, otherwise (32 or higher) displays 1.
############################ data segment ################################ .data legend1: .asciiz "0: less than 32 " legend2: .asciiz "1: 32 or higher " inPrompt: .asciiz "Enter an integer between 0 and 255: " outLab: .asciiz "It is " ############################ code segment ################################ .text .globl main main: li $v0, 4 la $a0, legend1 syscall # print legend line 1 la $a0, legend2 syscall # print legend line 2 la $a0, inPrompt syscall # print input prompt li $v0, 5 syscall # read input integer li $v0, 4 la $a0, outLab # print outLab line 4 syscall
Write NO MORE THAN 14 lines of code that involve using # ONLY the following: # - syscall # - syscall supporting instructions (e.g.: li to load $v0) # - instruction to make a saved copy # - bit manipulating instructions (ANDing, ORing, XORing, # NORing and shifting - only whatever that are needed) # so that the program will work just like the sample runs # shown at the bottom. # You MUST test your completed program for AT LEAST the # test cases shown (and include the result in hardcopy).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started