It now 'chains' operators, i.e. A*B+3, instead of the seperate routines for A*B and A+3 for example. Out of the 14 booleans/operators (+ - * / or xor and -> => <= > < = !=) I've finished 10. I only need >= <= > < to do, and after that, I'm ready with parsing such string (yet without functions). I haven't implemented auto-opt yet, but I will definitely do. Here is an example of what it can do:
String = A+4*B/(1-C)+3
Output =
- Code: Select all
ld a, ($D05301) ; B
add a, a
add a, a
push af
ld a, 1
ld hl, $D05302 ; C
sub a, (hl)
pop hl
ld l, 1
mlt hl
call _DivHLByA
ld a, l
ld hl, $D05300 ; A
add a, (hl)
add a, 3
ret