; ; CIRCLES - runs in circles firing if enemy is detected. ; ; Sample robot - by Ed T. Toton III 02/04/97 #def throttle #def turn_rate #def turret mov throttle, 100 mov turn_rate, 3 ; Set turn rate to 3 degrees opo 13, 0 ; Port 13 - Set turret to 0 degrees opo 17, 4 ; Port 17 - Set scan arc to 4 degrees. ipo 10 ax ; Port 10 - Get a random number cmp ax, -1 ; is it 0 or higher? ja 1 ; if so, skip along. xor ax, ax ; ax = 0 sub ax, turn_rate ; ax = 0 - turn_rate mov turn_rate, ax ; turn_rate = ax let's turn left! :1 opo 14, turn_rate ; Port 14 - turn opo 11, throttle ; Port 11 - Throttle to 100% ipo 7, ax ; Port 7 - scan, ax=range cmp ax, 2000 ; is enemy in range? ja 10 ; if not then circle s'more jmp 20 ; if yes, now kill! :10 jmp 1 ; repeat loop :20 ; Killing phases cmp ax, 150 ; is he close? jls 30 ; if not then go to long range ; opo 15 ; Port 15 - Fire! ;long killing phase mov throttle, 100 opo 11, throttle ; Port 11 - Throttle to -100% call 40 ; heat checking call 665 ; FIRE AT WILL!! ipo 7, ax ; scanning cmp ax, 2000 ; is enemy in range? ja 10 ; if not then go circle s'more jmp 20 ; if yes, repeat kill loop ;close killing phaze :30 ; opo 15 0 ; Port 15 - Fire! cmp ax, 100 ; is he too close? call 50 call 45 ; heat checking call 667 ipo 7, ax ; scanning cmp ax, 2000 ; is enemy in range? ja 10 ; if not then go in circles s'more jmp 20 ; if yes, repeat kill loop ;heat checking long range :40 ipo 2, ax ; check the heat levels cmp ax, 100 ret ;heat checking short range :45 ipo 2, ax cmp ax, 500 ret :50 jls 60 ret :60 mov throttle, -100 opo 11, -100 ; Port 11 - Throttle to -100% ret ;long range killing shit :665 jls 666 ret :666 ipo 8 turret ; get a random number opo 15 turret ; fire w/ turret at ax ret ;close killing shit :667 jls 668 ret :668 mov ax, 1 int 4 int 8 turret ; sets accuracy of scan to opo 15 turret ; turret and fires mov ax, 0 int 4 ret #END