Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program to prompt a user to enter a number. Then display a menu of choic

ID: 3696576 • Letter: W

Question

Write a program to prompt a user to enter a number. Then display a menu of choices for the user to select as follows: Please choose one of the following options: 1. Print the number in binary separating each nibble with a space. 2. Same as option #1, but with leading zeros removed. 3. Print the number in binary in reverse order. 4. Print one particular nibble 5. Enter in a new number 6. Quit the program.

This needs to be in assembly language. saved as an .m file. I'll gladly take some help without the complete answer.

Explanation / Answer

.model small

.stack 100h

.data

menu db "Please select a choice:",

     db "1. Print the number in binary separating each nibble with a space. "

     db "2. leading zeros removed "

     db "3. Binary number in reverse order"

     db "4.Only one particular nibble"

     db "5.Enter new number"

     db "6. Exit",'$'

.code

start:

;INITIALIZE DATA SEGMENT.

mov ax, @data

mov ds, ax

call clear_screen     

call display_menu   

;WAIT FOR ANY KEY.   

mov ah, 7

int 21h

;FINISH PROGRAM.

mov ax, 4c00h

int 21h

;---------------------------------------------

display_menu proc

mov dx, offset menu

mov ah, 9

int 21h

ret

display_menu endp

clear_screen proc

mov ah, 0

mov al, 3

int 10H

ret

clear_screen endp

end start

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote