Original Post
i'm writing a small compiler for a simple language right now. I've got the assembler working, so i simply need to emmit simple assembly language. Basically, the problem i have is to turn z = x * y into
set
z mul
x y
and z = 3 * x + 2 into
set
z add
mul 2
3 x
now how do i do that? For the first one i think i have an idea on how to do it, the second, however doesn't. (i'm sure i can convert from the graph to asm).