10 REM FROM COMPUTE 4/84 PG 152 20 REM ENTERED IN CUON LIBRARY BY SAM BARRETT 100 PRINT"[147]TAPE OR DISK (T/D)?"; 105 GETB$:IFB$=""THEN105 110 IFB$<>"T"ANDB$<>"D"THEN105 120 PRINTB$:PRINT"SAVE OR LOAD (S/L)?"; 125 GETA$:IFA$=""THEN125 130 IFA$<>"S"ANDA$<>"L"THEN125 140 PRINTA$:INPUT"FILENAME";F$ 144 INPUT"STARTING ADDRESS";X:AH=INT(X/256):AL=X-AH*256 147 IFB$="D"THEN500 150 IFA$="L"THEN300 159 REM TAPE SAVE 160 INPUT"END ADDRESS";X:X=X+1:BH=INT(X/256):BL=X-BH*256 190 GOSUB400:POKE251,AL:POKE252,AH 200 POKE780,251:POKE781,BL:POKE782,BH:SYS65496:GOTO330 299 REM TAPE LOAD 300 GOSUB400 310 POKE780,0:POKE781,AL:POKE782,AH:SYS65493 320 IF(ST AND 48)THENPRINT"?LOAD":PRINT"ERROR" 330 CLOSE1:END 399 REM OPEN TAPE CHANNEL 400 L=LEN(F$):POKE183,L:S=256*PEEK(50)+PEEK(49) 410 FORX=1TOL:POKES+X-1,ASC(MID$(F$,X,1)):NEXT 420 POKE780,1:POKE781,1:POKE782,0:SYS65466 430 POKE780,L:POKE781,PEEK(49):POKE782,PEEK(50):SYS65469 440 POKE157,128:RETURN 500 IFA$="L"THEN700 529 REM DISK SAVE 530 INPUT"END ADDRESS";X:X=X+1:BH=INT(X/256):BL=X-BH*256 540 OPEN15,8,15,"I0" 550 OPEN3,8,1,"0:"+F$+",P,W" 560 INPUT#15,EN,EM$,ET,ES 570 IFEN=0THEN650 580 IFEN<>63THENPRINTEN;EM$;ET;ES:GOTO760 590 PRINT"FILE EXISTS. REPLACE (Y/N)?"; 600 GETA$:IFA$=""THEN600 610 PRINTA$:IFA$<>"Y"THEN760 620 PRINT#15,"S0:"+F$+",P,W" 630 CLOSE15:CLOSE3:GOTO540 650 POKE157,128:POKE251,AL:POKE252,AH 660 POKE780,251:POKE781,BL:POKE782,BH:SYS65496:GOTO760 699 REM DISK LOAD 700 OPEN15,8,15,"I0" 710 OPEN3,8,0,"0:"+F$+",P,R" 720 INPUT#15,EN,EM$,ET,ES 730 IFENTHENPRINTEN;EM$;ET;ES:GOTO760 750 POKE157,128:POKE185,0:POKE780,0:POKE781,AL:POKE782,AH:SYS65493 760 CLOSE3:CLOSE15:END