判断某一年是否为闰年
2014-04-26 17:49
190 查看
; 判断某一年是否为闰年,是则eax=1,否eax=0 ; ; author: wangguolaing ; date: revised 4/14 .386 .MODEL FLAT INCLUDE io.h includelib Kernel32.lib ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD cr EQU 0dh Lf EQU 0ah .STACK 4096 .DATA prompt BYTE cr,Lf,'Plase enter a year :',cr,Lf,Lf,0 number BYTE 16 DUP(?) year DWORD ? Leapyear BYTE 'The year is a leap year',cr,Lf,Lf,0 Commonyear 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 quit common : output Commonyear quit: INVOKE ExitProcess, 0 ; exit with return code 0 PUBLIC _start ; make entry point public END ; end of source code
相关文章推荐
- 汇编语言无效指令错误概述
- 汇编语言超浓缩教程
- 初学汇编语言的几个练习题
- 汇编语言的Hello world程序
- 麻省理工大学XV6操作系统赏析(用户态的实用工具)
- 汇编语言 之 除法溢出问题
- 汇编语言王爽 实验10.1
- 汇编语言 课程设计2 之时间设置改进篇
- 汇编常用命令-修改主板生产日期
- Win32汇编基础
- 运算符重载时到底发生了什么?【DEBUG】
- C++中全局变量、静态变量、自动变量的在内存中的位置【DEBUG】
- c++类的反汇编代码的实现【DEBUG】
- C++ 动态内存的分配与释放反汇编代码【DEBUG】
- C++结构体在汇编语言中的实现(局部变量)【DEBUG】
- Uboot详细启动流程
- 微机原理复习--8250
- 如何用各种编程语言杀死一条龙
- 64位Win7如何使用debug
- { char *p,s[6];int n