China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-27 17:03
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Source code for a tiny program that displays the current time View 1,481 Replies 0
Original Poster Posted 2003-06-01 00:00 ·  中国 江西 吉安 电信
版主
★★★★
Credits 7,296
Posts 1,628
Joined 2002-10-16 12:00
23-year member
UID 10
Gender Male
Status Offline
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)
==================================================
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
Forum Jump: