; my first sonar using robot #config scanner=0 ; frees 5 points #config engine=3 ; uses 1 point #config weapon=2 ; uses 1 point #config heatsinks=5 ; uses 3 points #msg You can't escape me! mov ax 1 int 3 opo 17 24 !main opo 11 100 ; keep on rollin ipo 16 ax ; read from sonar cmp ax -1 ; is there a target jle !notarg ; no target !targ mov cx ax ; cx=ax mov ex @1 ; get desired heading sub ax ex ; ?? opo 13 ax ; turn gun opo 14 ax ; turn ipo 7 dx ; scan cmp dx 2000 ; target? jge !main mov ax 24 mpy ax @3 sar ax 1 opo 12 ax mov ex @3 sal ex 2 opo 15 ex ; fire opo 15 ex ; fire opo 15 ex ; fire sar dx 1 jmp !main !notarg ipo 10 ax ; random number and ax 255 ; ax= 0 to 255 opo 14 ax ; turn ax jmp !main ; keep working