Question: .macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print in Integer- .macro PrintNumber(%format, %NoInReg) li $v0, %format

.macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print in Integer- .macro.data x: .byte 0 y: byte 0 ************** Main Program here .text Main: PrintText Message(Statement: Statement: Recode the above program to compute the area of a circular disk: A = r. Here, r is

.macro Reading Number li $v0, 5 # Code to read integer syscall .end_macro Macro to Print in Integer- .macro PrintNumber(%format, %NoInReg) li $v0, %format # Code to read integer move $20, %NoInReg syscall .end_macro Macro to Print Text Message. # .macro PrintTextMessage(%Mess) .data Text: .asciiz %Mess space 120 .text li $v0, 4 # Code to print text message la $a0, Text syscall .end macro .data x: .byte 0 y: byte 0 ************** Main Program here .text Main: PrintText Message(" Welcome to Assembly Language Programming... !") Repeat: PrintText Message(" Enter value for x =") ReadingNumber # Reading integer #x is updated with integer #x is loaded into $t1 # Multiplying St1 by 2 sb $v0, x lb St1, x sll St1, St1, 1 PrintTextMessage(" Value of 2x=") *** PrintNumber(1, St1) addi $t1, St1, 10 # 2x + 10 sb St1, y # Update value of y PrintTextMessage(" Value of y=(2x+10)= ") PrintNumber(1, St1) j Repeat # Goto Label "Repeat' Statement: Statement: Recode the above program to compute the area of a circular disk: A = r. Here, r is radius of the circular disk. Code:

Step by Step Solution

3.38 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The provided code is a basic MIPS assembly language program that reads an integer performs some calculations and prints messages and numbers To recode ... View full answer

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 Programming Questions!