Skip to content

Commit 6d91e6d

Browse files
authored
Merge pull request #833 from bartsanchez/bart/move-param16-to-a-class
ref: move param16 function into a class (Bits16)
2 parents 680f447 + 775aa43 commit 6d91e6d

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/arch/z80/backend/_16bit.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,12 +1125,12 @@ def ret16(cls, ins: Quad) -> list[str]:
11251125
output.append("jp %s" % str(ins[2]))
11261126
return output
11271127

1128-
1129-
def _param16(ins: Quad) -> list[str]:
1130-
"""Pushes 16bit param into the stack"""
1131-
output = Bits16.get_oper(ins[1])
1132-
output.append("push hl")
1133-
return output
1128+
@classmethod
1129+
def param16(cls, ins: Quad) -> list[str]:
1130+
"""Pushes 16bit param into the stack"""
1131+
output = Bits16.get_oper(ins[1])
1132+
output.append("push hl")
1133+
return output
11341134

11351135

11361136
def _fparam16(ins: Quad) -> list[str]:

src/arch/z80/backend/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
Bits16,
3131
_fparam16,
3232
_jnzero16,
33-
_param16,
3433
)
3534

3635
# 32 bit bitwise operations
@@ -335,8 +334,8 @@ def _set_quad_table(self):
335334
ICInstruction.JGEZEROF: ICInfo(2, Float.jgezerof), # if X >= 0 jmp LABEL (float)
336335
ICInstruction.PARAMU8: ICInfo(1, Bits8.param8), # Push 8 bit param onto the stack
337336
ICInstruction.PARAMI8: ICInfo(1, Bits8.param8), # Push 8 bit param onto the stack
338-
ICInstruction.PARAMU16: ICInfo(1, _param16), # Push 16 bit param onto the stack
339-
ICInstruction.PARAMI16: ICInfo(1, _param16), # Push 16 bit param onto the stack
337+
ICInstruction.PARAMU16: ICInfo(1, Bits16.param16), # Push 16 bit param onto the stack
338+
ICInstruction.PARAMI16: ICInfo(1, Bits16.param16), # Push 16 bit param onto the stack
340339
ICInstruction.PARAMU32: ICInfo(1, Bits32.param32), # Push 32 bit param onto the stack
341340
ICInstruction.PARAMI32: ICInfo(1, Bits32.param32), # Push 32 bit param onto the stack
342341
ICInstruction.PARAMF16: ICInfo(1, Fixed16.paramf16), # Push 32 bit param onto the stack

0 commit comments

Comments
 (0)