    org 100h    
    
;pins         76   3
motor   equ 0010_0010b
    
main:
    mov bx,offset table
l1: mov al,[bx]       
    or al,motor
    mov dx,3bch
    out dx,al
    call time_delay
    or al,01h                                 
    out dx,al
    call time_delay  

    mov dx,2a3h
    in al,dx
    and al,1000_0000b
    jnz op

    inc bx
    cmp bx,table_end
    jle l1
    jmp main

op: dec bx
    cmp bx,table
    jge l1   
    mov bx,offset table_end
    jmp l1
         
     
table:
    db 0000_0100b
    db 1000_0000b
    db 0000_1000b
    db 0100_0000b
    
     
table_end = $   
    
    
;*************************************************************
;Name:          TIME_DELAY
;
;Author:        Dan Kohn
;
;Date:          10/30/2005
;
;Revised:       10/31/2005
;               PUSHA does not work on Toshiba XT Compatable
;               laptop. Replaced with individual push and pops.
;
;Function:      Wait for ??
;
;On Call:       NONE
;
;On Return:     All Registers Restored

time_delay: push ax         ;put all reg on stack for restore
            push bx
            push cx
            push dx
            
            mov dx,02000h

td_l1:      dec dx
            jnz td_l1
            
            pop dx            ;restore all registers
            pop cx
            pop bx
            pop ax
            RET
