; 0,0 1000,0 0 (256) ; +--------+ 224 \|/ 32 ; | | 192 -|- 64 ; | | 160 /|\ 96 ; | | 128 ; +--------+ ; 1000,0 1000,1000 #msg I am a chicken shit!! #def turret_deg #def turret_dir mov turret_deg, 0 ;0=left, 1=right mov turret_dir, 0 opo 18, 1 ;Overburn... Yeah!!! opo 11, 100 ;set throttle to 100% call 3000 ;call subroutine 3000 mov ax ;ax = 0 call 2000 ;call subroutine 2000 (Turn to ax) :1 call 4000 ;check # of robot's left.. Fire if only 2 left int 2 ;Sets EX,FX registers equal to X,Y coordinates. cmp fx, 100 ;compares fx with 100 opo 11, 100 ;set throttle to 100% jae 1 ;jumps to 1 while y pos > 100 mov ax, 64 ;ax = 64 call 2000 ;call subroutine 2000 (Turn to ax) :2 call 4000 ;check # of robot's left.. Fire if only 2 left int 2 ;Sets EX,FX registers equal to X,Y coordinates. cmp ex, 900 ;compares ex with 900 opo 11, 100 ;set throttle to 100% jbe 2 ;jump to label 2 if ex was <= 900 mov ax, 128 ;ax = 128, Were gonna go down call 2000 ;call subroutine 2000 (Turn to ax) :3 call 4000 ;check # of robot's left.. Fire if only 2 left int 2 ;Sets EX,FX registers equal to X,Y coordinates. cmp fx, 900 ;compares fx with 900 opo 11, 100 ;set throttle to 100% jbe 3 ;jumps to 3 while y pos <= 900 mov ax, 192 ;ax = 192, Were gonna go left!! call 2000 ;call subroutine 2000 (Turn to ax) :4 call 4000 ;check # of robot's left.. Fire if only 2 left int 2 ;Sets EX,FX registers equal to X,Y coordinates. cmp ex, 100 ;compares ex with 100 opo 11, 100 ;set throttle to 100% jae 4 ;jumps to 4 while y pos >= 100 mov ax ;ax = 0, Were gonna go up!! call 2000 ;call subroutine 2000 (Turn to ax) jmp 1 ;course-setting subroutine ;set course to heading in AX. :2000 mov bx, @1 ; get current course-setting sub ax, bx ; get number of degrees to turn. opo 11, 100 ;set throttle to 100% opo 14, ax ; turn! ret ;reeeturn to sender!!! ; If the robot starts up near the edges then this subroutine ; will try to move it out... :3000 int 2 ;Sets EX,FX registers equal to X,Y coordinates. cmp ex, 900 ;compares ex with 900 jae 3001 ;jump to label 3001 if ex was >= 900 cmp ex, 100 jbe 3002 jmp 3003 ;else jump to label 3002 :3001 mov ax, 192 call 2000 opo 11, 100 ;set throttle to 100% jmp 3003 :3002 mov ax, 64 opo 11, 100 ;set throttle to 100% call 2000 :3003 cmp fx, 900 ;compares fx with 900 jae 3004 ;jump to label 3004 if fx was >= 900 cmp fx, 100 ;compares fx with 100 jbe 3005 ;jump to label 3005 if fx was <= 100 jmp 3006 ;else jump to label 3006 ;JAE JAE N Jumps to label N if last compare was >= ;JBE JBE N Jumps to label N if last compare was <= :3004 mov ax call 2000 opo 11, 100 ;set throttle to 100% jmp 3006 :3005 mov ax, 128 opo 11, 100 ;set throttle to 100% call 2000 :3006 ret ;checks if only one enemy left... If so, it tries to target and destroy ;it.. :4000 mov ax, 1 int 3 ;int 10 ; Info about game... ; DX=Total number of robots active, ; EX=Match number, ; FX=Number of matches ;cmp dx, 3 ; If more than one enemy left.. ;jgr 4010 ; Then jump to 4010 ; Only one enemy left... Let's see if we can take it out!! ipo 2, ax ; Returns current heat-level [0 - 500] cmp ax, 300 ; If heat level is above 200.. jgr 4010 ; Don't try to attack opo 18, 0 ; Speed off... opo 17, 4 ; Set scan arc with... ipo 7, ax ; Returns range to nearest target in scan arc cmp ax, 1000 ; Enemies logner than 1500m away does not exist.. jgr 4001 ; Jump to 4010 if distance is > 1500m ipo 8, ax ; Returns accuracy of scan opo 12, ax ; rotate turret ax degrees.. ;opo 15, -1 ; fire! opo 15, ax ; hmmm... ;opo 15, 1 ; I'm not gonna tell you what this does.. jmp 4010 ; End this NOW!! :4001 cmp turret_deg, 1 jbe 4003 cmp turret_deg, 128 ; If turret_deg is 128 or more.. jae 4002 ; Jump to label 4003 cmp turret_dir, 1 jeq 4002 jmp 4003 :4002 mov turret_dir, 1 sub turret_deg, 6 opo 13, turret_deg ; Rotate turret.. jmp 4010 :4003 opo 13, turret_deg ; Rotate turret.. add turret_deg, 6 ; Guess... mov turret_dir, 0 :4010 ret #END 02/17/97 You can put whatever you want after the program by using the #END compiler directive, since the compiler stops compiling at that point.