0100 ;SERVO.ASM 1/27/96›0110 ;BY BOB WOOLLEY ATARI CLASSICS›0120 ;›0130 ;›0140 *=$600›0150 ;›0160 ;BASIC CALL..SET UP VBI›0170 ;›0180 PLA ;REQUIRED BY BASIC USR()›0190 LDY #$40 ;VECTORS VBI TO $640›0200 LDX #$06›0210 LDA #$07›0220 JSR $E45C›0230 ;›0240 LDA #$30 ;SETS J/S PORTS TO›0250 STA $D302 ;OUTPUT›0260 LDA #$FF›0270 STA $D300›0280 LDA #$3C›0290 STA $D302›0300 RTS›0310 ;›0320 ;›0330 *=$640›0340 ;›0350 ;VBI..WRITE TO SERVO›0360 ;›0370 LDA #$FF ;ALL PINS TO 1›0380 STA $D300›0390 ;›0400 LDY #$C0 ;DELAY FOR .5MS›0410 LPY DEY›0420 BNE LPY›0430 ;›0440 LDX #$00 ;CONSECUTIVE LOAD›0450 LP1 LDA $8000,X ;FROM $8000›0460 STA $D300 ;TO J/S PORT›0470 NOP ;INCREASES RANGE›0480 INX ;NEXT BYTE›0490 BNE LP1›0500 ;›0510 LDA $06FF ;FLAG $8000 UPDATE›0520 BNE RETN›0530 JSR $0681 ;DO UPDATE›0540 INC $06FF ;RESET FLAG›0550 RETN JMP $E462;END VBI›0560 ;›0570 ;›0580 *=$680›0590 ;›0600 ;UPDATE BIT MAP›0610 ;›0620 LDA #$00;ZERO $8000-$80FF›0630 TAX›0640 LP2 STA $8000,X›0650 DEX›0660 BNE LP2›0670 ;›0680 LDY #$07 ;STORE CONTROL BYTES›0690 LDA #$01 ;STARTING WITH BIT 0›0700 STA $06FE; BIT INDEX›0710 LP3 LDX $6C0,Y ;STOP ADDRESS›0720 JSR STORE›0730 ASL $06FE ;NEXT BIT›0740 DEY; NEW CONTROL BYTE›0750 BPL LP3›0760 RTS›0770 ;›0780 STORE›0790 LP4 LDA $7FFF,X;GET CURRENT BYTE›0800 ORA $06FE ;UPDATE THE BIT›0810 STA $7FFF,X ;STORE NEW BYTE›0820 DEX ;NEXT BYTE›0830 BNE LP4 ;UNTIL AT $8000›0840 RTS ;DONE›0850 ;›0860 ;›0870 *=$6C0›0880 ;SERVO CONTROL BYTES (ARBITRARY)›0890 .BYTE $80,$40,$20,$10›0900 .BYTE $08,$04,$02,$01›0910 ;›0920 .END›