
	REM JUNK.BAS * PGM TO DEMONSTRATE DIRECT CONSOLE I/O
	REM          * 1110
	REM 03 02 83 * J.BUTLER

	DIM S(25)

	FOR X=1 TO 25:READ S(X):POKE 09FFFH+1,S(X):NEXT X
        COUNT=20:X9=0

10 	POKE 0A000H,0
	CALL 0A001H
	M=PEEK(0A000H) AND 127
        IF M=0 THEN 10
	IF M=8 AND LEN(M$)<1 THEN 10
	IF M=27 THEN M$="B":GOTO 20
        IF M=13 THEN 20
        IF M=8 AND LEN(M$)>0 THEN M$=LEFT$(M$,LEN(M$)-1):X9=X9-1: \
           PRINT CHR$(8);" ";CHR$(8);
        IF M<32 OR M>122 THEN 10
	REM IF M=3 THEN 20
        IF X9>COUNT THEN PRINT CHR$(7);:GOTO 20
        X9=X9+1:PRINT CHR$(M);
        M$=M$+CHR$(M):GOTO 10

20	PRINT:PRINT:PRINT M$
        PRINT "STOP":STOP

	REM DIRECT CONSOLE I/O 
        DATA 3,229,213,197,245,30,255,14,6,205,5,0,183,202,5,160,50,0
        DATA 160,241,193,209,225,201,0

	S$="DATA "
	FOR X=0A000H TO 0A018H
	M=PEEK(X):S$=S$+STR$(M)+","
	NEXT X
	S$=LEFT$(S$,LEN(S$)-1):PRINT S$:PRINT
	CREATE "JUNK.FIL" AS 1
	PRINT USING "&";#1;S$
	CLOSE 1
