Exemple #1
0
  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();
  }
Exemple #2
0
  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;
  }
Exemple #3
0
 private void ioreg(String name, int offset) {
   constants.put(name.toLowerCase(), new Integer(offset));
 }
Exemple #4
0
 private void constant(String name, int value) {
   constants.put(name.toLowerCase(), new Integer(value));
 }
Exemple #5
0
  public void addRegisterName(String name, AbstractToken reg) {
    LegacyRegister register = LegacyRegister.getRegisterByName(reg.image);
    if (register == null) ERROR.UnknownRegister(reg);

    definitions.put(labelName(name), register);
  }
Exemple #6
0
 public void addVariable(String name, int value) {
   constants.put(labelName(name), new Integer(value));
 }
Exemple #7
0
 // <label>
 public void addLabel(AbstractToken name) {
   Item.Label li = new Item.Label(segment, name);
   addItem(li);
   labels.put(name.image.toLowerCase(), li);
 }