Remove duplicate routine_address == 0 check from op_call

The _call() method already handles this case, so the check in op_call is redundant.
This commit is contained in:
Jared Miller 2026-02-09 21:46:59 -05:00
parent e6b63622fa
commit 0f5fada29e
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -605,17 +605,7 @@ class ZCpu:
# call in v1-3 # call in v1-3
def op_call(self, routine_addr, *args): def op_call(self, routine_addr, *args):
"""Call the routine r1, passing it any of r2, r3, r4 if defined.""" """Call the routine r1, passing it any of r2, r3, r4 if defined."""
# Calling address 0 is a no-op that returns false (0). self._call(routine_addr, args, True)
if routine_addr == 0:
self._write_result(0)
return
addr = self._memory.packed_address(routine_addr)
return_addr = self._opdecoder.get_store_address()
current_addr = self._opdecoder.program_counter
new_addr = self._stackmanager.start_routine(
addr, return_addr, current_addr, args
)
self._opdecoder.program_counter = new_addr
def op_call_vs(self, routine_addr, *args): def op_call_vs(self, routine_addr, *args):
"""See op_call.""" """See op_call."""