Pretty cool
I had made a BASIC/ASM de-tokenizer for this kind of project a while back, which I think you might want to see. The syntax to use it is basically as follows:
Code: [command name](param1,param2,[...])
So a sec() command would look like this:
Code: SEC(π)
Here is the code for it, it might be useful for this project...
Code: Input "",Str1
{0->L1
{1,6,10,15,22,25,28,31,35,40,44->L2
inString("GAMMAQUADCUBICQUARTICCOTSECCSCZETABCONVBETAISPRIME",sub(Str1,1,~1+inString(Str1,"(
Ans=L2
sum(AnscumSum(binomcdf(10,0->N
If N
augment(DeltaList(L2),{7
expr("{"+sub(Str1,Ans(N)+2,length(Str1)-Ans(N)-1->L1
Asm(prgmTOVARS
The input string is in Str1, L2 contains the index to the command name in the list of commands. It searches for the command in the list, then a number is stored to N based off the result (0 is the first command, 1 is the 2nd and so on)
It then grabs the parameters part of Str1 and stores them as elements in L1.
TOVARS just stores the values of L1 to system variables (first element gets stored to A, 2nd element to B and so on)
Here is the code for TOVARS (adapted for the CE from tibasicdev):
Code: call _ZeroOP1
ld a,$AA
ld ($8479),a
rst 10h
jr nc,$+17
ld a,$40
ld b,$1B
ld hl,$86EC
inc a
ld (hl),a
inc hl
djnz $-3
ld de,$86EA
inc de
inc de
push de
call _RclAns
cp $01
ret nz
ld a,(de)
cp $1B
jr c,$+4
ld a,$1B
ex de,hl
inc hl
inc hl
ld b,a
pop de
ld a,(de)
inc de
push de
push bc
push hl
push af
call _ZeroOP1
pop af
ld ($8479),a
rst 10h
jr nc,$+5
call _CreateReal
pop hl
ld bc,$0009
ldir
pop bc
djnz $-27
pop de
ret
Here it is compiled:
Code: CD8403023EAA32798400D7300F3E40061B21EC86003C772310FB11EA86001313D5CD500F02FE01C01AFE1B38023E1BEB232347D11A13D5C5E5F5CD840302F132798400D73003CD340502E101090000EDB0C110E3D1C9
This way, you know what command was called (N) and what parameters were passed (A,B,C,[...]).