diff --git a/idasm/loadptp.py b/idasm/loadptp.py index 0c81a36..2279ae3 100755 --- a/idasm/loadptp.py +++ b/idasm/loadptp.py @@ -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)