Fix signed comparison in op_jl

This commit is contained in:
Jared Miller 2026-02-09 23:04:52 -05:00
parent f8f5ac7ad0
commit fa31f39a65
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -251,16 +251,13 @@ class ZCpu:
# Fallthrough: No args were equal to a.
self._branch(False)
def op_jl(self, a, *others):
"""Branch if the first argument is less than any subsequent
argument. Note that the second operand may be absent, in
which case there is no jump."""
for b in others:
def op_jl(self, a, b):
"""Branch if the first argument is less than the second."""
a = self._make_signed(a)
b = self._make_signed(b)
if a < b:
self._branch(True)
return
# Fallthrough: No args were greater than a.
else:
self._branch(False)
def op_jg(self, a, b):