genExpStore(node, new Reg16("r24", null));
}
public void visitIfStatement(IfStatement node)
{
Label l1 = new Label();
Label l2 = new Label();
Label l3 = new Label();
this.out.println("");
this.out.println(" #### if statement");
if(node.getExp() != null)
node.getExp().accept(this);
this.out.println("");
this.out.println(" # load condition and branch if false");
Reg16 reg = genExpLoad(node.getExp(), 24);
this.out.println(" #load zero into reg");
this.out.println(" ldi r25, 0");
this.out.println("");
this.out.println(" #use cp to set SREG");
this.out.println(" cp " + reg.lo8 + ", r25");
this.out.println(" #WANT breq " + l1.toString());
this.out.println(" brne " + l2.toString());
this.out.println(" jmp " + l1.toString());
this.out.println("");
this.out.println(" # then label for if");
this.out.println(l2.toString() + ":");
if(node.getThenStatement() != null)
node.getThenStatement().accept(this);
this.out.println(" jmp " + l3.toString());
this.out.println("");
this.out.println(" # else label for if");
this.out.println(l1.toString() + ":");
if(node.getElseStatement() != null)
node.getElseStatement().accept(this);
this.out.println("");
this.out.println(" # done label for if");
this.out.println(l3.toString() + ":");
}