MAC283 Quiz NO 2 and first Practice for the Final Exam

Submit your work via email by today at 10 PM to prof@dpeled.com

1. What is the logic of the program? What does it do? Explain in details.

2. What will be displayed on the screen ?


.model small
.386
.stack 100h
.data
nono db 8
c db 0
bsd db 0
x db "Enter anu Key ", 13, 10 ,"$"
.code

main proc
mov AX,@data
mov ds, ax

mov dx,offset x
call gssm
call y
mov bsd, al
mov c, 0
mm:

shr bsd, 1
jc short jjj

inc c
jjj:
dec nono
jnz mm
mov dl, c
shr c, 1
jc short start1
call z
start1:
mov ax, 4c00h
int 21h
y proc
uuu:
mov ah, 1
int 21h
cmp al, 58
js uuu
cmp al, 65
jns uuu
ret
y endp
z proc
mov ah, 6
add dl, 48
int 21h
ret
z endp


gssm proc
mov ah, 9
int 21h
ret
gssm endp
main endp
end main