## All Things Atari BASIC

[**Video Series**](https://rumble.com/playlists/AqAT-JTKuYk)

Tune in here for more resources supporting the videos in the link above.

I have a love-hate relationship with BASIC. It's easy to get started, it's difficult to maintain, and it's highly discouraged for anything of any serious complexity, or that requires good performance. However, The OSS BASICXE implementation does afford much better performance than standard Atari BASIC. 

---

**Display the ATASCII character set**

<pre class="atari">
10 GRAPHICS 0
15 DIM CHAR$(10)
20 FOR I=0 TO 252
21 IF I=125 THEN CHAR$="[CLEAR]":GOTO 45
22 IF I=155 THEN CHAR$="[RETURN]":GOTO 45
23 IF I=29 THEN CHAR$="[UNPRINTABLE]":GOTO 45
35 CHAR$=CHR$(I)
45 PRINT I;" ";CHR$(27);" ";CHAR$
50 NEXT I
60 REM USE CONTROL-1 TO PAUSE
</pre>

**Variable Name Introspection**

<pre class="atari">
100 REM PROGRAM TO PRINT THE VARIABLE NAME LIST 
105 PRINT "Before line 110"
110 DIM ARRAYNAME(1),STRINGNAME$(1)
120 REM GET THE BEGINNING OF THE LIST 
125 PRINT "Before line 130"
130 ADDRESS=PEEK(130)+PEEK(131)*256
135 PRINT "Before line 140: ";ADDRESS
140 ? CHR$(125);"VARIABLE NAME LIST"
150 REM GET CHARACTER AND TEST FOR END 
155 PRINT "Before line 160"
160 A=PEEK(ADDRESS):IF A=0 THEN END 
165 PRINT "Before line 180: ";A
170 REM PRINT CHARACTER 
180 IF A<128 THEN ? CHR$(A);:REM 210
190 ? CHR$(A-128)
200 REM GET NEXT ADDRESS AND REPEAT 
210 ADDRESS=ADDRESS+1:REM 160
</pre>

**The MYMORT1 Program from DTSS**

<pre class="atari">
1   REM  MORTGAGE COMOPUTER
2   REM  YEARLY INTEREST RATE
10  DATA  0.05
15  REM  INITIAL PRINCIPAL
20  DATA  28500
25  REM  MONTHLY PAYMENT
30  DATA  170
35  REM  STARTING MONTH AND YEAR
40  DATA  1, 1964
50  READ I, P, P1, M, Y
60  LET R = 1 + I/12
70  PRINT "YEAR", "PRINCIPAL"
80  PRINT Y, P
90  LET  P = P*R - P1
100 IF  P >= 0 THEN 120
110 LET P = 0
120 LET M = M + 1
130  IF M > 12 THEN 160
140  PRINT "       ",
150  GO TO 190
160  LET  M = 1
170  LET Y = Y + 1
180  PRINT Y,
190  PRINT INT(P)
200  IF P > 0 THEN 90
210  END

</pre>

