Calculator Community > ASM
Compiled language for BASIC programmers
J_Walker87:
Okay, thanks for the routine.
Also, for anyone who cares, this is how the program to compile math expressions works:
Example: Compile "2+3*4-X" to assembly (Note: X is a variable, and all math is 8 bit for simplicity. Also there's no order of operations or parentheses. I think this is fine though since I'm aiming for compiler simplicity.)
The expression compiler would produce the following code, but in hex format:
--- Code: ---ld a,2
add a,3
ld b,4
call MulAB ;MulAB is a multiply routine label
ld hl,X ;X is a label for the variable X
sub (hl)
--- End code ---
Let me know if I can improve this somehow.
Navigation
[0] Message Index
[*] Previous page
Go to full version