;-=BOXER=-

;Jeremiah Martell  Mar-20-98
;made by Psuedo_Chaos

	mov	ax,	1	;\_Puts keepshift on
	int	3  		;/
	xor	ax,	ax	;resets ax to 0
	mov	dx,	64
	opo	17,	20	;sets scan arc

	ipo     3,      ax      ;returns current heading
        mov     bx,     255     ;\
        sub     bx,     ax      ; \_rotates tank 
        add     bx,     dx      ; \ dx is angle to move
        opo     14,     bx      ;/ 
        xor     bx,     bx      ;\_resets ax and bx to 0
   	xor     ax,     ax      ;/

:15 
        mov     cx,    7        ;sets time for straight line
:5
        opo     11,     100     ;moves
        ipo     7,      ax      ;scan
        cmp     ax,     1500    ;anything there?
        jls     2               ;if there is jump
        jgr     77
:1
        dec     cx              ;cx = cx - 1
        cmp     cx,     0       ;             \
        opo     17,     20      ;sets scan arc \_is straight part over if
        jgr     5               ;              / so then jump
        opo     14,     64      ;turn 90 degrees
;        opo     12,     32      ;turn gun with tank
        jmp     15              ;start over again
	
:2      ;shooting part
        ipo     7,      ax
        cmp     ax,     1500
        jgr     1
        ipo     8,      fx      ;get accuracy of scan
        opo     17,     4       ;reduce scan arc
        mpy     fx,     10       ;multiply accuracy by 5
        opo     12,     fx      ;rotate gun to target
        ipo     7,      ax      ;scan again
        cmp     ax,     1500
        jgr     1
        ipo     8,      ax      ;get accuracy
        opo     12,     ax
        shl     ax,             ;multiply accuracy by 2
        ipo     2,      ex
        cmp     ex,     100
        jgr     1
        opo     15,     4
        opo     15,     ax      ;shoot
        opo     15,     -4        
        jmp     1               ;go back

:77
        opo     12,     40
        jmp     1
