Example #1
0
def cb_deref_imm_reg(tokens):
    if len(tokens) == 1:
        return AstMem(tokens[0], 32)
    elif len(tokens) == 2:
        return AstMem(tokens[1] + tokens[0], 32)
    else:
        raise NotImplementedError('len(tokens) > 2')
Example #2
0
def cb_regreg(tokens):
    assert len(tokens) == 2
    result = AstMem(tokens[0] + tokens[1], 32)
    return result
Example #3
0
def cb_postinc(tokens):
    assert len(tokens) == 1
    result = AstMem(AstOp('postinc', tokens[0]), 32)
    return result
Example #4
0
def cb_predec(tokens):
    assert len(tokens) == 1
    result = AstMem(AstOp('predec', tokens[0]), 32)
    return result
Example #5
0
def cb_deref_mem(tokens):
    assert len(tokens) == 1
    result = AstMem(tokens[0], 32)
    return result
Example #6
0
def cb_deref_off(tokens):
    assert len(tokens) == 2
    result = AstMem(tokens[1] + tokens[0], 16)
    return result
Example #7
0
def cb_deref_nooff(tokens):
    assert len(tokens) == 1
    result = AstMem(tokens[0], 16)
    return result
Example #8
0
def cb_deref_nooff(tokens):
    if len(tokens) != 3:
        raise NotImplementedError("TODO")
    return AstMem(tokens[1], 32)
Example #9
0
def cb_deref(tokens):
    if len(tokens) != 4:
        raise NotImplementedError("TODO")
    return AstMem(tokens[2] + tokens[0], 32)