Answer to Question #158731 in Assembler for Fareeha Nadeem

Question #158731

Generate a program to proof that the square root of 30 is 900 using NASM Simulator (DOSBox), Briefly explain the steps of your program execution.



1
Expert's answer
2021-01-27T09:36:18-0500

; ml p.asm

.model small

.stack 64h

.data

           msg db "The square root of 900 is 30", 13,10,'$'

 

.code

           mov ax, @data

           mov ds, ax

 

           mov bx, 30     ; bx=30

           mov ax, 900   ; al=900

           div bl              ; result = 900/30

           cmp ax, bx      ; compare result and bx=30

           jnz final          ; if square root of 900 !=30

                                   ; else

           lea dx, msg     ; "The square root of 900 is 30"

           mov ah, 09h   ; print string

           int 21h

 

final:

           mov ah, 04ch ; exit

           int 21h

end

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS