标题: 显示当前时间的小程序的源代码
[打印本页]
作者: ko20010214
时间: 2003-6-1 00:00
标题: 显示当前时间的小程序的源代码
发信人: JiLiu (紀柳~~短天扇), 信区: DOS
标 题: 显示当前时间
发信站: BBS 水木清华站 (Mon May 19 17:17:33 2003), 转信
刚才把以前的程序翻了翻
发现这个编得很短小
拿出来晒晒
data segment
string db 4 dup(?),"-",2 dup(?),"-",2 dup(?)," ",2 dup(?),":",2
dup(?),":",2 dup(?),0dh,0ah,"$"
data ends
code segment
assume cs:code,ds:data
doo macro n
mov al,n
out 70h,al
in al,71h
and al,0f0h
shr al,cl
add al,30h
mov [bx],al
inc bx
in al,71h
and al,0fh
add al,30h
mov [bx],al
inc bx
endm
main proc
mov ax,data
mov ds,ax
mov bx,offset string
mov cl,4
doo 32h
doo 9
inc bx
doo 8
inc bx
doo 7
inc bx
doo 4
inc bx
doo 2
inc bx
doo 0
mov dx,offset string
mov ah,9
int 21h
mov ax,4c00h
int 21h
main endp
code ends
end main
--
※ 来源:·BBS 水木清华站 smth.org·[FROM: 61.167.60.3]
(本文采用S-Term文章拷贝脚本拷贝)
==================================================