BASIC on the 6502 badge

As if it weren’t nerdy enough, the 6502 40th Anniversary Computer Badge runs Lee Davison’s EhBASIC. There are 1024 whole bytes free for your programs, so it’s not exactly spacious. It’s got useful floating point support, though:

Yup, that’s the second most boring BASIC example program, after the quadratic root finder.

100 REM HERON ROOTS
110 EP=0.0001
120 INPUT "X";X
130 N=1:RN=X/2
140 PRINT"COUNT","ROOT","DELTA":PRINT"======","======","======"
150 DE=ABS(RN*RN-X)
160 PRINT N,RN,DE
170 RN=(RN+X/RN)/2
180 N=N+1
190 IF DE>EP THEN GOTO 150

Leave a Reply

Your email address will not be published. Required fields are marked *