;********************************************************
TITLE 显示系统时间
;********************************************************
;********************************************************
;程序运行平台说明
.386
.MODEL FLAT,STDCALL
OPTION CASEMAP:NONE
;********************************************************
;********************************************************
;文件包含
INCLUDE Irvine32.inc
;********************************************************
;********************************************************
;数据类型定义
SYSTEMTIME1 STRUCT
wYear WORD ?
wMonth WORD ?
wDayOfWeek WORD ?
wDay WORD ?
wHour WORD ?
wSecond WORD ?
wMilliseconds WORD ?
SYSTEMTIME1 ENDS
;********************************************************
;********************************************************
;数据段定义
.DATA
sYsTime SYSTEMTIME <>
strDis byte "现在是",0
strYear BYTE "年",0
strMonth BYTE "月",0
strDay BYTE "日",0
;********************************************************
;********************************************************
;代码段定义
.CODE
main proc
invoke GetLocalTime,addr sYsTime
xor eax,eax
mov edx,offset strDis
call WriteString
movzx eax,sYsTime.wYear
call WriteInt
mov edx,offset strYear
call WriteString
movzx eax,sYsTime.wMonth
call WriteInt
mov edx,offset strMonth
call WriteString
movzx eax,sYsTime.wDay
call WriteInt
mov edx,offset strDay
call WriteString
call Crlf
exit
main endp
end main
;********************************************************
宏的定义和使用
;****************************************************
TITLE 汇编中宏的使用
;****************************************************
;****************************************************
;程序平台说明
.386
.MODEL FLAT,STDCALL
OPTION CASEMAP:NONE
;****************************************************
;****************************************************
;文件包含
INCLUDE Irvine32.inc
;****************************************************
;****************************************************
;宏定义的使用
sample MACRO hehe
mov edx,hehe
call WriteString
ENDM
;****************************************************
;****************************************************
;数据段定义
.DATA
str1 byte "This sample output",0dh,0ah,0
;****************************************************
;****************************************************
;代码段定义
.CODE
main proc
mov eax,offset str1
sample eax
ret
main endp
end main
;****************************************************