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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!