-
Ben Avison authored
Detail: There was a significant problem with Basic when external code is called using CALL, USR, SYS, or a *command (either directly or using OSCLI), and that code Aborts with Data Transfer, Undefined Instruction or Instruction Fetch. The Error Line (ERL) then given by Basic was often the last line of the program, rather than the Basic line containing the CALL, USR, SYS or *command. The problem was caused when the Basic LINE pointer in R12 (which points to the current line) was corrupted, and that is used by Basic to find the program line number (ERL) after an error. If R12 is outside the program, ERL was set to zero or the last line of the program, which was useless for problem diagnosis. After an Abort in a SYS, or in a module *Command (issued direct or via OSCLI), R12 is always corrupted. After an Abort in code executed from a CALL or USR then R12 is corrupted only if the called code changed it. In addition, if r13_usr was corrupted, the Basic error handler was reset to the default, causing the program to end abruptly without any line number at all. Admin: The changes have been added to CVS in four stages in preceding commits. This commit is to increment the module version number, and adds test code supplied (as were the module changes) by Martin Avison: The test program Aborter creates a module AbortMod which has SWIs and module commands which abort in each possible way. The same code is also saved to disc to create disc commands for the same function. The test application !AbortTest creates many sorts of error and abort, and displays the error details. Version 1.54. Tagged as 'BASIC-1_54'
8d054d02