@Override
    public int getAddress(Identifier var, int size)
        throws Exception {
        addressRecord a = usedMem.get(var);
        if(a != null) {
            if(a.size != size) {
                throw new Exception("varaible accessed as different size than expected");
            }
            return a.address;
        }
        // Globals are allocated at negative offsets
        freeAddress = freeAddress - size;
        usedMem.put(var, new addressRecord(freeAddress, size));
        return freeAddress;
    }