assume ds:data1,cs:code1
data1 segment
msg db 0ah,0dh,'enter the year$'
number db 6,0,6 dup('$')
ys db 0ah,0dh,'yes,it is a leap year$'
n db 0ah,0dh,'no,it is not a leap year$'
data1 ends
code1 segment
start:mov ax,seg data1
mov ds,ax
lea dx,msg
mov ah,09h
int 21h
lea dx,number
mov ah,0ah
int 21h
lea bx,number+4
mov ah,[bx]
mov al,[bx+1]
aad
mov bl,04h
div bl
and ah,0ffh
jz yes
lea dx,n
mov ah,09h
int 21h
jmp down
yes:lea dx,ys
mov ah,09h
int 21h
down: mov ah,4ch
int 21h
code1 ends
end start
Quiz Champion's Mastermind series - Quiz 2
-
X was born in 1892. X is known for his fantasy books. Y was called 'the
American X'. Y is also a famous fantasy writer. Movies have been made out
of X's no...
This comment has been removed by the author.
ReplyDeletelea dx,number
ReplyDeletemov ah,0ah
int 21h
lea bx,number+4
mov ah,[bx]
mov al,[bx+1]
i want to know how these instructions works
Load the no. Whatever is entered by keyboard,
DeleteRead that string
Interrupt
Whatever no. Entered add 4 more and store in bx register
Move address of bx in ah
Move address of incremented bx address to al