1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Better handling of end-of-tape

This commit is contained in:
Ross Wilson
2016-02-29 15:30:01 +07:00
parent 176b507dc1
commit e358de5ceb

View File

@@ -92,7 +92,11 @@ def skipzeros(ptp_data, index):
"""
while True:
val = ptp_data[index]
try:
val = ptp_data[index]
except IndexError:
# off end of tape
return None
if val > 0:
return index
index += 1
@@ -174,7 +178,7 @@ def c8lds_handler(ptp_data, memory):
# skip any leading zeros
index = skipzeros(ptp_data, index)
if index is None:
break
return (None, None) # end of tape
# get data word count
result = get_byte(ptp_data, index)