Is it still alive?
Posted: Thu Dec 04, 2008 1:15 am
The last version of 6502 EhBASIC on Lee's website is 2.09, dated 2005. Is the project still under development? Any plans? Has the website moved?
Code: Select all
TK_DOKE = TK_POKE+1 ; DOKE token
TK_CALL = TK_DOKE+1 ; CALL token
TK_DO = TK_CALL+1 ; DO token
TK_LOOP = TK_DO+1 ; LOOP tokenCode: Select all
TK_DOKE = TK_POKE+1 ; DOKE token
TK_CALL = TK_DOKE+1 ; CALL token
TK_PLOT = TK_CALL+1 ; PLOT token new command entry
TK_DO = TK_PLOT+1 ; DO token modified entry
TK_LOOP = TK_DO+1 ; LOOP tokenCode: Select all
.word LAB_POKE-1 ; POKE
.word LAB_DOKE-1 ; DOKE
.word LAB_CALL-1 ; CALL
.word LAB_DO-1 ; DOCode: Select all
.word LAB_POKE-1 ; POKE
.word LAB_DOKE-1 ; DOKE
.word LAB_PLOT-1 ; PLOT new command
.word LAB_CALL-1 ; CALL
.word LAB_DO-1 ; DOCode: Select all
LBB_PI
.byte "I",TK_PI ; PI
LBB_POKE
.byte "OKE",TK_POKE ; POKECode: Select all
LBB_PI
.byte "I",TK_PI ; PI
LBB_PLOT
.byte "LOT",TK_PLOT ; PLOT new command keyword
LBB_POKE
.byte "OKE",TK_POKE ; POKECode: Select all
.byte 4,'P'
.word LBB_POKE ; POKE
.byte 4,'D'
.word LBB_DOKE ; DOKE
.byte 4,'C'
.word LBB_CALL ; CALL
.byte 2,'D'
.word LBB_DO ; DOCode: Select all
.byte 4,'P'
.word LBB_POKE ; POKE
.byte 4,'D'
.word LBB_DOKE ; DOKE
.byte 4,'P' ; new keyword length and first character
.word LBB_PLOT ; PLOT new keyword pointer
.byte 4,'C'
.word LBB_CALL ; CALL
.byte 2,'D'
.word LBB_DO ; DOCode: Select all
10 DIM S$(10),I(10)
20 SP=10:IP=10
30 SP=SP-1:S$(SP)="HELLO WORLD"
40 GOSUB 100:REM SP=10, I=9 AT THIS POINT
50 PRINT "THE LENGTH OF THE STRING IS:";I(IP)
60 IP=IP+1:END
100 IP=IP-1:I(IP)=LEN(S$(SP)):SP=SP+1:RETURN
Code: Select all
10 DIM I(30):REM a simple stack of integers (effectively infinite depth)
11 IP=29:REM Integer stack pointer
...
999 REM A trivial addition example
1000 I(IP+1)=I(IP+1)+I(IP):IP=IP+1:RETURN
1999 REM ( a b c -- z -z ) compute the quadratic formula
2000 T = (-(I(IP+1)) + sqrt((I(IP+1))**2 - 4*(I(IP+2))*(I(IP)))) / 2*(I(IP+2))
2010 I(IP+2)=T:I(IP+1)=-T:IP=IP+1:RETURN
Code: Select all
100 IP=IP-3
110 I(IP+2)=(a)
120 I(IP+1)=(b)
130 I(IP)=(c)
140 GOSUB 2000
150 REM I(IP) contains -z, I(IP+1) contains +z
Code: Select all
10 DIM S$(100),I(100):REM THE STACKS
20 SP=100:IP=100:REM THE STACK POINTERS
30 REM FIND THE LENGTH OF A STRING.
40 SP=SP-1:S$(SP)="HELLO WORLD!"
50 GOSUB 1000
60 PRINT "THE LENGTH OF THE STRING IS: ";I(IP)
70 IP=IP+1
80 END
1000 REM JUST TO PROVE IT CAN BE DONE, WE FIND
1001 REM THE LENGTH OF THE STRING THE HARD WAY:
1002 REM RECURSIVELY!
1003 REM THIS IMPLEMENTS THE FOLLOWING EQUATIONS:
1004 REM LEN "" = 0
1005 REM LEN S = 1+(LEN (TAIL S))
1010 IF S$(SP)="" THEN IP=IP-1:I(IP)=0:SP=SP+1:RETURN
1020 SP=SP-1:S$(SP)=MID$(S$(SP+1),1):GOSUB 1000
1030 I(IP)=I(IP)+1:RETURN