Robert Sprowson
authored
The FPOINT=0 implementations of result() = array() [+-*/] constant result() = arraya() [+-*/] arrayb() and FPOINT=0,1,2 implementations of result() = arraya() . arrayb() were all using R8 at the top level loop to iterate the array, not noticing that R8 is ARGP, so if the operation fails (for example due to overflow) the attempt to translate the error message via MSG fails because ARGP is left pointing at the next array element. Deal with this by spilling a register onto the stack so ARGP is left alone. The FPOINT=1 and FPOINT=2 implementations of operations [+-*/] both don't touch R8 and therefore correctly reported any errors during those calculations. Example faulting program: DIM array(2), result(2) a() = 1.7E18,1.7E28,1.7E38 result() = a() + 1E38 : REM Overflow on the last element PRINT result(0)'result(1)'result(2) Version 1.86. Tagged as 'BASIC-1_86'