这是一个判断某一年是否为润年的程序,运行可执行程序Ifleap.exe后,输入具体的年份,可输出是本年是否为闰年的提示信息。微机原理课程设计_判断闰年程序_汇编课程设计代码:data segment ;定义数据段infon db 0dh,0ah,''Please input a year: $''Y db 0dh,0ah,''This is a leap year! $''N db 0dh,0ah,''This is not a leap year! $''w dw 0buf db 8db ?db 8 dup(?)data endsstack segment stackdb 200 dup(0)stack endscode segmentassume ds:data,ss:stack,cs:codestart:mov ax,datamov ds,axlea dx,infon ;在屏幕上显示提示信息mov ah,9int 21hlea dx,buf ;从键盘输入年份字符串mov ah,10int 21hmov cl, [buf+1]lea di,buf+2call datacatecall ifyearsjc a1lea dx,nmov ah,9int 21hjmp exita1: lea dx,ymov ah,9int 21hexit: mov ah,4chint 21h datacate proc near;push cx;dec cxlea si,buf+2tt1: inc siloop tt1;lea si,cx[di]pop cxmov dh,30hmov bl,10mov ax,1l1: push axsub byte ptr [si],dhmul byte ptr [si]add w,axpop axmul bldec siloop l1retdatacate endpifyears proc nearpush bxpush cxpush dxmov ax,wmov cx,axmov dx,0mov bx,4div bxcmp dx,0jnz lab1mov ax,cxmov bx,100div bxcmp dx,0jnz lab2mov ax,cxmov bx,400div bxcmp dx,0jz lab2lab1: clcjmp lab3lab2: stclab3: pop dxpop cxpop bxretifyears endpcode endsend start