Example #1
0
 private void print(String what, ASTNode where) {
   String addr = StringUtil.addrToString(segment.getCurrentAddress());
   modulePrinter.println(
       segment.getName()
           + " @ "
           + addr
           + ": "
           + what
           + " on line "
           + where.getLeftMostToken().beginLine);
 }
Example #2
0
 protected void addItem(Item i) {
   itemList.add(i);
   segment.advance(i.itemSize());
 }
Example #3
0
 // .byte directive
 public void reserveBytes(Expr e, Expr f) {
   // TODO: fill section with particular value
   int result = e.evaluate(segment.getCurrentAddress(), this);
   modulePrinter.println("reserveBytes(" + e + ") -> " + result);
   addItem(new Item.UninitializedData(segment, result));
 }
Example #4
0
 // .org directive
 public void setOrigin(Expr.Constant c) {
   int result = c.evaluate(segment.getCurrentAddress(), this);
   modulePrinter.println("setOrigin(" + c + ") -> " + result);
   segment.setOrigin(result);
 }