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