Wednesday, 7 March 2012

Masm program to check a given year is leap year or not

printmsg macro msg mov ah,09h lea dx,msg int 21h endm printnum macro nu mov dl,nu add dl,30h mov ah,02h int 21h endm calcnum macro regx mov ax,regx mov bl,100 div bl mov dh,ah aam mov bl,al printnum ah printnum bl mov al,dh aam mov bl,al printnum ah printnum bl endm data segment n db,0000 n1 db ,0000 msg1 db 0ah,0dh,"Enter a year$" msg2 db 0ah,0dh,"Leap year$" msg3 db 0ah,0dh,"Not leap year$" msg4 db 0ah,0dh,"$" data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax printmsg msg1 mov ah,01h int 21h sub al,30h mov ah,00 mov...

Page 1 of 2712345Next
Twitter Delicious Facebook Digg Stumbleupon Favorites More