* Four pieces of code for Dendai Tiny BASIC that may be useful:
* a) location to disable output in my funky version of SWTBUG (this would
*    be $A00C in the normal version).  This might be desirable with...
* b) a Commodore-style GETKEY routine (BASIC 3.5, vs. the 2.0 in a C64)
* c) a method to embed ML in a REM statement.  Memory location #2438
*    ($0986) is where you are after the "1 REM ", before the data.  
*    The code is then "poked" into a safe spot at $7E00.
* d) a similar method for storing data into the array.
*
* Dave Hassler



5 REM #($7F0C)=1 WILL DISABLE ECHO (*ALL* OUTPUT) UNTIL #($7F0C)=0



10 K=$7E00:#(K)=$BD:#(K+1)=$E1:#(K+2)=$AC:#(K+3)=$39:REM 'GETKEY' STMT
20 PR"INPUT HEX DATA ONE BYTE AT A TIME, C/R TO END"
30 I=0
40 X=USR(K):IF X=13 GOTO 90
45 Y=USR(K)
50 Z=X:GOSUB 100:X=Z*16
60 Z=Y:GOSUB 100:X=X+Z
70 PR:PR X
90 END
100 IF Z>57 LET Z=Z-55:RETURN
110 Z=Z-48:RETURN


* CAN PUT 31 BYTES ON A LINE

* ANSI HOME CURSOR CODE EMBEDDED IN A REM STMT
* W=USR(X) TO EXECUTE

1 REM 861BBDE1D1865BBDE1D18648BDE1D139
10 X=$7E00
15 FOR I=2438 TO 2470 STEP2
20 Z=#(I):GOSUB 1000:Y=Z*16
25 Z=#(I+1):GOSUB 1000:Z=Z+Y
30 #(X)=Z:X=X+1
40 NEXT
900 END
1000 IF Z>57 LET Z=Z-55:RETURN
1100 Z=Z-48:RETURN


2-DIGIT DECIMAL DATA EXAMPLE

1 REM 6829010112092024815001243605
10 J=0
15 FOR I=2438 TO 2466 STEP2
20 Z=#(I):Z=Z-48:Z=Z*10
30 Y=#(I+1):Y=Y-48:Z=Z+Y
40 @(J)=Z
50 J=J+1:NEXT
100 FOR I=0TO13:PR @(I);" ";:NEXT
120 END
