File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1073,21 +1073,21 @@ def store16(cls, ins: Quad) -> list[str]:
10731073
10741074 return output
10751075
1076+ @classmethod
1077+ def jzero16 (cls , ins : Quad ) -> list [str ]:
1078+ """Jumps if top of the stack (16bit) is 0 to arg(1)"""
1079+ value = ins [1 ]
1080+ if is_int (value ):
1081+ if int (value ) == 0 :
1082+ return ["jp %s" % str (ins [2 ])] # Always true
1083+ else :
1084+ return []
10761085
1077- def _jzero16 (ins : Quad ) -> list [str ]:
1078- """Jumps if top of the stack (16bit) is 0 to arg(1)"""
1079- value = ins [1 ]
1080- if is_int (value ):
1081- if int (value ) == 0 :
1082- return ["jp %s" % str (ins [2 ])] # Always true
1083- else :
1084- return []
1085-
1086- output = Bits16 .get_oper (value )
1087- output .append ("ld a, h" )
1088- output .append ("or l" )
1089- output .append ("jp z, %s" % str (ins [2 ]))
1090- return output
1086+ output = Bits16 .get_oper (value )
1087+ output .append ("ld a, h" )
1088+ output .append ("or l" )
1089+ output .append ("jp z, %s" % str (ins [2 ]))
1090+ return output
10911091
10921092
10931093def _jgezerou16 (ins : Quad ) -> list [str ]:
Original file line number Diff line number Diff line change 3232 _jgezeroi16 ,
3333 _jgezerou16 ,
3434 _jnzero16 ,
35- _jzero16 ,
3635 _param16 ,
3736 _ret16 ,
3837)
@@ -313,8 +312,8 @@ def _set_quad_table(self):
313312 ICInstruction .LENSTR : ICInfo (2 , String .lenstr ), # Gets strlen
314313 ICInstruction .JZEROI8 : ICInfo (2 , Bits8 .jzero8 ), # if X == 0 jmp LABEL
315314 ICInstruction .JZEROU8 : ICInfo (2 , Bits8 .jzero8 ), # if X == 0 jmp LABEL
316- ICInstruction .JZEROI16 : ICInfo (2 , _jzero16 ), # if X == 0 jmp LABEL
317- ICInstruction .JZEROU16 : ICInfo (2 , _jzero16 ), # if X == 0 jmp LABEL
315+ ICInstruction .JZEROI16 : ICInfo (2 , Bits16 . jzero16 ), # if X == 0 jmp LABEL
316+ ICInstruction .JZEROU16 : ICInfo (2 , Bits16 . jzero16 ), # if X == 0 jmp LABEL
318317 ICInstruction .JZEROI32 : ICInfo (2 , Bits32 .jzero32 ), # if X == 0 jmp LABEL (32bit, fixed)
319318 ICInstruction .JZEROU32 : ICInfo (2 , Bits32 .jzero32 ), # if X == 0 jmp LABEL (32bit, fixed)
320319 ICInstruction .JZEROF16 : ICInfo (2 , Fixed16 .jzerof16 ), # if X == 0 jmp LABEL (32bit, fixed)
You can’t perform that action at this time.
0 commit comments