Sender: JiLiu (紀柳~~Short Day Fan), Board: DOS
Title: Display Current Time
Posted at: BBS Shuimu Tsinghua Station (Mon May 19 17:17:33 2003), forwarded
I just looked through some of my old programs
and found that this one was written very short and compact
so I'm posting it here for everyone to see
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 ,al
inc bx
in al,71h
and al,0fh
add al,30h
mov ,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
--
※ Source: ·BBS Shuimu Tsinghua Station smth.org·
(This article was copied using the S-Term article copy script)
==================================================
Title: Display Current Time
Posted at: BBS Shuimu Tsinghua Station (Mon May 19 17:17:33 2003), forwarded
I just looked through some of my old programs
and found that this one was written very short and compact
so I'm posting it here for everyone to see
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 ,al
inc bx
in al,71h
and al,0fh
add al,30h
mov ,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
--
※ Source: ·BBS Shuimu Tsinghua Station smth.org·
(This article was copied using the S-Term article copy script)
==================================================
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
