Question

Computer Organization

Computer Organization

Computer Organization

Computer Organization

Please I want a 100% working program so if you're not sure about it do not solve it, Thanks

I want screenshots of the program and the results as well, and would you please be kind and post the codes as a text so I can test it, Thank you so much for your helpcomplete MIPS-32 assembly language program that computes the volume of a sphere of radius R =(4/3).R). Assume that R and all

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MIPS program to find the volume of the given sphere.

Hope this helps...

Thankyou..... :)

DATA SEGMENT
R DB ?
RES DB 10 DUP ('$')
MSG1 DB "ENTER RADIUS : $"
MSG2 DB 10,13,"VOLUME : $"
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
SUB AL,30H
MOV R,AL
MOV AH,0
MUL R
MUL R
MOV DL,88
MUL DL
MOV DX,0
MOV BX,21
DIV BX
LEA SI,RES
CALL HEX2DEC
LEA DX,MSG2
MOV AH,9
INT 21H
LEA DX,RES
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
HEX2DEC PROC NEAR
MOV CX,0
MOV BX,10
LOOP1: MOV DX,0
DIV BX
ADD DL,30H
PUSH DX
INC CX
CMP AX,9
JG LOOP1
ADD AL,30H
MOV [SI],AL
LOOP2: POP AX
INC SI
MOV [SI],AL
LOOP LOOP2
RET
HEX2DEC ENDP
END START


answered by: ANURANJAN SARSAM
Add a comment
Answer #2

Here is the solution to above problem in assembly language. Please read the code comments for more information and give a thumbs up if you like the solution

ASSEMBLY CODE

DATA SEGMENT R DB ? RES DB 10 DUP('$') MSGO DB 10,13, "THE VOLUME OF THE SPHERE IS: $" #OUTPUT MSG MSGI DB "ENTER THE VALUE FOR RADIUS : $" # INPUT MSG DATA ENDS CODE SEGMENT ASSUME DS:DATA, CS:CODE START: MOV AX,DATA MOV DS,AX LEA DX,MSGI MOV AH,9 INT 21H MOV AH,1 INT 21H SUB AL,30H MOV R,AL MOV AH,0 MUL R MUL R MOV DL,88 MUL DL MOV DX,0 MOV BX,21 DIV BX LEA SI,RES CALL HEX2DEC LEA DX,MSG0 MOV AH,9 INT 21H LEA DX,RES MOV AH,9 INT 21H MOV AH,4CH INT 21H CODE ENDS 

SCREENSHOT OF OUTPUT

Add a comment
Know the answer?
Add Answer to:
Computer Organization Computer Organization Computer Organization Computer Organization Please I want a 100% working program so...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT