10 OUT 0,3:OUT&H32,0:OUT&H33,0 20 A=&H20:FORI=0TO2:OUTA,0:OUTA+1,5:OUTA+2,0:OUTA+3,5:A=A+6:NEXTI 30 CALL TURBO ON 40 FORI=0TO255 50 R=(IAND&B11100000)/8:IFI<192THENR=R+&H80 60 G=(IAND&B00011100) 70 B=(IAND&B00000011)*8 80 OUT8,R:OUT9,G:OUT10,B:OUT11,I 90 NEXTI 100 CALL TURBO OFF 110 OUT0,3+16:OUT4,0:OUT5,0:OUT6,0 120 X0=0:FORY=0TO511:Y0=511-Y 130 CALL TURBO ON 140 A=0:FORX=0TO511:A=A+1:IFA=256THENA=1 150 OUT 1,A:NEXTX 160 CALL TURBO OFF 170 GOSUB240 180 Y0=Y0+1:OUT1,0:NEXTY 190 CALL TURBO OFF 200 Y0=0:FORI=0TO511:X0=511-I:GOSUB240:IFIMOD2=1THENY0=Y0+1 210 NEXTI 220 IFA=0THENOUT0,3+16:A=1ELSEOUT0,3:A=0 230 GOTO 200 240 XH=X0\256:XL=X0MOD256 250 YH=Y0\256:YL=Y0MOD256 260 IF(INP(8)AND1)=0THEN260 265 IF(INP(8)AND1)=1THEN265 270 OUT2,XH:OUT&H32,XL:OUT2,YH:OUT&H33,YL 280 REM IF(INP(8)AND1)=0THEN280 290 RETURN 295 REM ==== TEST PROGRAMS 300 PRINTINP(8)AND&B00000001:GOTO 300 310 FORI=0TO64:PRINTRIGHT$("00"+HEX$(I),2)+":"+RIGHT$("00"+HEX$(INP(I)),2)+" "; 320 IF(IMOD4)=3THENPRINT"" 330 NEXTI