Hello all, I asked for a timer routine with better resolution than 1/18 sec.
In the meantime I rewrote the program and renamed it to something more
appropriate. Anyone want to share a screen clearing routine?
===cut===
;Diffuse.com v1 - Barry Block 5-97 - assemble w/A86
;slowly fills a mode3 screen with space characters, black on black (CLS)
;this version adds moving the cursor to top left corner.
mode3 equ 0B800h
srn_end equ 0BFD0h
space_on_black equ 0720h
first_pass equ 512
delay equ 1
mov ax,mode3
mov es,ax ;screen seg.
mov dx,first_pass ;hold data for di increments
L1: xor di,di
call timer
mov ax,dx
shr ax,1
mov dx,ax
cmp ax,1 ;di must be even
ja L2
xor ax,ax ;last pass
L2: add di,ax
cmp di,srn_end
ja L3
push ax
mov ax,space_on_black
stosw
pop ax
jmp short L2
L3: cmp ax,0
ja L1
xor bh,bh ;cursor to top left corner, page 0
xor dx,dx
mov ah,2
int 10h ;set cursor
int 20h ;exit program
;-------------------------------
timer: ;Wait CX clock ticks
push ds
mov cx,delay ;X/18 second
mov ax,40h ;point DS to BIOS
mov ds,ax
_wait: mov ax,ds:[6Ch] ;get low word of tick counter
wait1: cmp ax,ds:[6Ch] ;wait for it to change
je wait1
loop _wait ;count CX changes
pop ds
ret
===cut===
Kind regards, Barry
--- Terminate 4.00/Pro
---------------
* Origin: EBO-BBS A'dam +31-20-6002828 (2:280/901.42)
|