判断某一年是否为闰年

来源:互联网 发布:淘宝化妆品正品店 编辑:程序博客网 时间:2024/05/17 06:14
; 判断某一年是否为闰年,是则eax=1,否eax=0; ; author:  wangguolaing; date:  revised 4/14.386.MODEL FLATINCLUDE io.hincludelib Kernel32.libExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORDcr          EQU    0dh  Lf          EQU    0ah    .STACK      4096.DATAprompt      BYTE   cr,Lf,'Plase enter a year :',cr,Lf,Lf,0number      BYTE  16 DUP(?)year        DWORD  ?Leapyear    BYTE 'The year is a leap year',cr,Lf,Lf,0Commonyear  BYTE 'The year is a common year',cr,Lf,Lf,0.CODE_start:  output prompt  input  number,16  atod number  mov year,eax  cdq  mov ecx,4  idiv ecx  cmp edx,0  jg  common  mov eax,year  cdq  mov ecx,100  idiv ecx  cmp edx,0  je common leap  :       output Leapyear       jmp quitcommon :       output Commonyearquit:       INVOKE ExitProcess, 0   ; exit with return code 0PUBLIC _start                       ; make entry point public            END                     ; end of source code

0 0
原创粉丝点击