Assembler: remove restrictions on some operands
This commit is contained in:
parent
c6b820cc8b
commit
b9c432a9b4
17
asm.py
17
asm.py
|
@ -87,10 +87,7 @@ class ASM(SimpleNamespace):
|
|||
else:
|
||||
return (0x1a, arg.disp)
|
||||
else:
|
||||
if (sp, is_a) not in (('inc', True), ('dec', False)):
|
||||
raise SyntaxError()
|
||||
else:
|
||||
return (0x18, None)
|
||||
return (0x18, None)
|
||||
elif arg.reg in ('PC', 'EX'):
|
||||
raise SyntaxError()
|
||||
else:
|
||||
|
@ -270,8 +267,8 @@ def exprlist_expr(p):
|
|||
def arg_a_arg(p):
|
||||
return p[0]
|
||||
|
||||
@pg.production("arg_a : POP")
|
||||
def arg_a_pop(p):
|
||||
@pg.production("arg : POP")
|
||||
def arg_pop(p):
|
||||
return Indirect(reg='SP', disp=0, sp='inc')
|
||||
|
||||
@pg.production("arg_a : SBO REG ADD ADD SBC")
|
||||
|
@ -284,12 +281,12 @@ def arg_a_pop_explicit(p):
|
|||
def arg_b_arg(p):
|
||||
return p[0]
|
||||
|
||||
@pg.production("arg_b : PUSH")
|
||||
def arg_b_push(p):
|
||||
@pg.production("arg : PUSH")
|
||||
def arg_push(p):
|
||||
return Indirect(reg='SP', disp=0, sp='dec')
|
||||
|
||||
@pg.production("arg_b : SBO SUBTRACT SUBTRACT REG SBC")
|
||||
def arg_b_push_explicit(p):
|
||||
@pg.production("arg : SBO SUBTRACT SUBTRACT REG SBC")
|
||||
def arg_push_explicit(p):
|
||||
if p[3].getstr().upper() != 'SP':
|
||||
raise SyntaxError()
|
||||
return Indirect(reg='SP', disp=0, sp='dec')
|
||||
|
|
Loading…
Reference in New Issue