Commit b2180b60 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Adjust VFP error handling

Detail:
  s/ErrorMsgs - Give the VFP "invalid operation" error a more useful error number, and correct the embedded text to match what's in the Resources file. Add VFPExcetion_SQRT, to allow "negative root" errors to be generated by FSQRTD error checks.
  hdr/Definitions - Update FPSCRCheck macro to allow alternate error handlers to be specified
  s/Array, s/Factor - Update FSQRTD error checks to use VFPException_SQRT, so that they say "negative root" instead of "invalid operation"
Admin:
  Tested on Raspberry Pi


Version 1.73. Tagged as 'BASIC-1_73'
parent 3c1ecfa0
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.72"
Module_Version SETA 172
Module_MajorVersion SETS "1.73"
Module_Version SETA 173
Module_MinorVersion SETS ""
Module_Date SETS "18 Sep 2017"
Module_ApplicationDate SETS "18-Sep-17"
Module_ComponentName SETS "BASIC"
Module_ComponentPath SETS "castle/RiscOS/Sources/Programmer/BASIC"
Module_FullVersion SETS "1.72"
Module_HelpVersion SETS "1.72 (18 Sep 2017)"
Module_FullVersion SETS "1.73"
Module_HelpVersion SETS "1.73 (18 Sep 2017)"
END
/* (1.72)
/* (1.73)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.72
#define Module_MajorVersion_CMHG 1.73
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Sep 2017
#define Module_MajorVersion "1.72"
#define Module_Version 172
#define Module_MajorVersion "1.73"
#define Module_Version 173
#define Module_MinorVersion ""
#define Module_Date "18 Sep 2017"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "BASIC"
#define Module_ComponentPath "castle/RiscOS/Sources/Programmer/BASIC"
#define Module_FullVersion "1.72"
#define Module_HelpVersion "1.72 (18 Sep 2017)"
#define Module_LibraryVersionInfo "1:72"
#define Module_FullVersion "1.73"
#define Module_HelpVersion "1.73 (18 Sep 2017)"
#define Module_LibraryVersionInfo "1:73"
......@@ -161,10 +161,10 @@ $L FSTD FACC,[SP,#-8]!
; Check for VFP exceptions
; Corrupts NZ, $temp
MACRO
FPSCRCheck $temp
FPSCRCheck $temp, $dest
FMRX $temp,FPSCR
TST $temp,#FPSCR_IOC+FPSCR_DZC+FPSCR_OFC
BNE VFPException
BNE VFPException$dest
MEND
;VFP FACC -> FPA F0
......
......@@ -1639,7 +1639,7 @@ MODULUSINT
FMSR S0,IACC
FSITOD FACC,S0
FSQRTD FACC,FACC
FPSCRCheck R14
FPSCRCheck R14,_SQRT
|
! 1, "Unknown FPOINT setting"
]
......@@ -1667,8 +1667,9 @@ MODULUSFP1
SQTD FACC,FACC
ELIF FPOINT=2
VFPSumOp FMACD,TYPE,R10
FSQRTD FACC,FACC
FPSCRCheck R14
FSQRTD FACC,FACC
FPSCRCheck R14,_SQRT
|
! 1, "Unknown FPOINT setting"
]
......
......@@ -514,12 +514,16 @@ FOVR1 BL MSG
= "Number too big for arc Sine or arc Cosine",0
]
ALIGN
] ; FPOINT=0
[ FPOINT<>1
FSQRTN BL MSG
= 21,68
[ OWNERRORS=1
= "Negative root",0
]
ALIGN
] ; FPOINT<>1
[ FPOINT=0
ERFLOG BL MSG
= 22,69
[ OWNERRORS=1
......@@ -872,6 +876,9 @@ EVFPRIA BL MSG
ALIGN
]
[ FPOINT=2
VFPException_SQRT ; Assume we arrived here with R14 = FPSCR
TST R14,#FPSCR_IOC
BNE FSQRTN
VFPException
FMRX R0,FPSCR
TST R0,#FPSCR_DZC
......@@ -879,9 +886,9 @@ VFPException
TST R0,#FPSCR_OFC
BNE FOVR
EINVOP BL MSG
= 0,124
= 55,124
[ OWNERRORS=1
= "Invalid operation", 0
= "Invalid arithmetic operation", 0
]
ALIGN
]
......
......@@ -1310,7 +1310,7 @@ SQR STR R14,[SP,#-4]!
SQTD FACC,FACC
ELIF FPOINT=2
FSQRTD FACC,FACC
FPSCRCheck R14
FPSCRCheck R14,_SQRT
|
! 1, "Unknown FPOINT setting"
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment