TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: BARRY BLOCK
from: JAMES VAHN
date: 1997-05-22 16:52:00
subject: Re: diffuse.asm

From: jvahn@short.circuit.com (James Vahn)
Barry Block wrote:
> Hello all, I asked for a timer routine with better resolution than 1/18
> sec.
        mov cx, 5
delay:  out 4Fh, al
        loop delay
> In the meantime I rewrote the program and renamed it to something more
> appropriate. Anyone want to share a screen clearing routine?
This only works properly in the Northern Hemisphere.
;----------------------------------------------------------------
; Spiral.asm - Author unknown. 
.model tiny
.code
public  _Spiral
start:
call _Spiral
mov ax,4C00h
int 21h
_Spiral proc far
push    ax bx cx dx es ds si di
push    cs
pop     ds
mov     ax,0B800h
mov     es,ax                           ;Set ES = Screen
mov     word ptr ds:[Spiral_Count],0Ch
mov     word ptr ds:[Starting_Point],0D0h
Spiral_Loop:
mov     ax,ds:[Starting_Point]
mov     ds:[Step_Count],ax
One_Step_Loop:
mov     word ptr ds:[Horiz_Line_Length],39h
mov     word ptr ds:[Vert_Line_Length],1
mov     di,798h
mov     ax,ds:[Spiral_Count]
mov     ds:[Line_Count],ax
Move_Horiz_Line_Left:
mov     cx,ds:[Horiz_Line_Length]
dec     cx
push    ds
push    es
pop     ds
mov     si,di
add     si,2
cld
rep     movsw
pop     ds
mov     cx,ds:[Vert_Line_Length]
push    ds
push    es
pop     ds
mov     si,di
sub     si,0A0h
mov     ax,0A2h
cld
Move_Vert_Line_Up:
movsw
sub     di,ax
sub     si,ax
loop    Move_Vert_Line_Up
Move_Horiz_Line_Right:
pop     ds
mov     cx,ds:[Horiz_Line_Length]
push    ds
push    es
pop     ds
mov     si,di
sub     si,2
std
rep     movsw
pop     ds
mov     cx,ds:[Vert_Line_Length]
inc     cx
push    ds
push    es
pop     ds
mov     si,di
add     si,0a0h
mov     ax,0A2h
std
Move_Vert_Line_Down:
movsw
add     di,ax
add     si,ax
loop Move_Vert_Line_Down
pop     ds
add     word ptr ds:[Horiz_Line_Length],2
add     word ptr ds:[Vert_Line_Length],2
dec     word ptr ds:[Line_Count]
jnz     Move_Horiz_Line_Left
dec     word ptr ds:[Step_Count]
jz      Done_One_Spiral
jmp     One_Step_Loop
Done_One_Spiral:
sub     word ptr ds:[Starting_Point],8
dec     word ptr ds:[Spiral_Count]
jz      Done_Spiral
jmp     Spiral_Loop
Done_Spiral:
pop     di si ds es dx cx bx ax
ret
Starting_Point          dw      ?
Spiral_Count            dw      ?
Horiz_Line_Length       dw      ?
Vert_Line_Length        dw      ?
Step_Count              dw      ?
Line_Count              dw      ?
endp _Spiral
end start
...  The Moon is Full
--- ifmail v.2.10-tx8.2
---------------
* Origin: (jvahn@short.circuit.com) (1:346/15.1)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.