public int getVariable(AbstractToken tok) { String name = labelName(tok); Integer v = (Integer) constants.get(name); if (v == null) { Item.Label li = (Item.Label) labels.get(name); if (li == null) ERROR.UnknownVariable(tok); if (li.segment == programSegment && !useByteAddresses) return li.getByteAddress() >> 1; else return li.getByteAddress(); } else return v.intValue(); }
public LegacyRegister getRegister(AbstractToken tok) { String name = labelName(tok); LegacyRegister reg = LegacyRegister.getRegisterByName(name); if (reg == null) reg = (LegacyRegister) definitions.get(name); if (reg == null) ERROR.UnknownRegister(tok); return reg; }
private void ioreg(String name, int offset) { constants.put(name.toLowerCase(), new Integer(offset)); }
private void constant(String name, int value) { constants.put(name.toLowerCase(), new Integer(value)); }
public void addRegisterName(String name, AbstractToken reg) { LegacyRegister register = LegacyRegister.getRegisterByName(reg.image); if (register == null) ERROR.UnknownRegister(reg); definitions.put(labelName(name), register); }
public void addVariable(String name, int value) { constants.put(labelName(name), new Integer(value)); }
// <label> public void addLabel(AbstractToken name) { Item.Label li = new Item.Label(segment, name); addItem(li); labels.put(name.image.toLowerCase(), li); }