goldenz 0 Newbie Poster

STDOUT equ 01h

get_date equ 02ah
get_time equ 02ch
write_handle equ 040h
terminate equ 04ch

DOSINT macro function, subfunction
IFB <subfunction>
mov ah,(function AND 0ffh)
ELSE
mov ax,(function SHL 8) OR (subfunction AND 0ffh)
ENDIF
int 21h
endm
Delay macro
local ulang
local ulang2
push cx
mov cx,50000
ulang:
push cx
mov cx,0
ulang2 :
call show date
loop ulang2
pop cx
loop ulang
pop cx
endm

MODEL tiny
.CODE
main proc far
.STARTUP
delay 50000
.EXIT 0
main endp
showdate proc
push ax bx cx dx
DOSINT get_date
push cx
push dx

;day of week
mov dx, offset dayname
mov cx,3
call WriteKalimat

;bulan
pop ax
push ax
mov al,ah
mov dx, offset monthname - 3
mov cx,3
call WriteKalimat

;the day of the month
pop ax
call WriteNumber
call WriteSpasi

;Jam
DOSINT get_time


push dx
push cx
mov al,ch
call WriteNumber
call WriteKoma

;menit
pop ax
call WriteNumber
call WriteKoma

;detik
pop ax
mov al,ah
call WriteNumber
call WriteSpasi

;tahun(century first)
pop ax
xor dx,dx
mov cx,100
div cx
push dx
call WriteNumber

;tahun (year within century)
pop ax
call WriteNumber
mov dx,offset newline
call cetak1
pop dx cx bx ax
ret
showdate endp
WriteKalimat proc
mul cl
add dx,ax
call cetak2
WriteKalimat endp
WriteSpasi proc
mov dx,offset spacechar
WriteSpasi endp
cetak1 proc
mov cx,1
cetak1 endp
cetak2 proc
mov bx,STDOUT
DOSINT write_handle
ret
cetak2 endp
WriteKoma proc
mov dx,offset colonchar
jmp cetak1
WriteKoma endp
WriteNumber proc
xor ah,ah
mov cl,10
div cl
or ax,3030h
push ds
push ax
mov dx,ss
mov ds,dx
mov dx,sp
mov cx,2
call cetak2
pop bx
pop ds
ret
WriteNumber endp
dayname db "SunMonTueWedThuFriSat"
monthname db "JanFebMarAprMayJunJulAugSepOctNovDec"
spacechar db " "
colonchar db ":"
newline db 0ah

end


the problem is how can i make the looping always on the top so it looks like it tick...i think make a clearscreen by i don't know how??plis help me on this way...tq a lot..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.