        SUBT    > Sys.EndSection

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

iCloseFiles
        MOV     R0, #0
        MOV     R1, #0
        SWI     Open

; Oddies

iXfer
iPopIblkI

; I/O functions

iIvalStr
iRvalStr

Nyi     ERROR   "Not yet implemented"

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Assorted cockups that aren't referenced by translator output object code

eEof            ERROR "End of file reached"
eNotText        ERROR "Can't use console with non-text files"
eUndefinedBV    ERROR "Undefined buffer variable"
eBadFieldDigits ERROR "Bad FracDigits"
eBadFieldWidth  ERROR "Bad field width"
eReadOnlyFile   ERROR "File is read only"
eWriteOnlyFile  ERROR "File is write only"
eUndefinedFile  ERROR "File is undefined"
eTooManyFiles   ERROR "Too many files open"
eFileNotFound   ERROR "File could not be opened"

eDisposeNil     ERROR "You tried to dispose a pointer which was NIL"
eDisposeUnd     ERROR "Dispose (UND)"
eHeapHitStack   ERROR "Heap allocation would overwrite the stack"

eIndexSmall  ERROR "Array index is below the lower bound"
eIndexLarge  ERROR "Array index exceeds upper bound"

eBadMod         ERROR "MOD with zero / -ve second arg"
eDivZero        ERROR "Integer division by zero"
eMulOverflow    ERROR "Integer overflow on multiply"
eSetRange       ERROR "Set value not in range"

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Externally referenced cockups

eIdentify ERROR "Attempting to reference an object using a NIL pointer"

eChrRange  ERROR "Chr () range"
ePredError ERROR "Pred () error"
eSuccError ERROR "Succ () error"
eSubSmall  ERROR "Subrange value too small"
eSubLarge  ERROR "Subrange value too large"

eIntOverflow  ERROR "Integer overflow"

eBadCaseIndex ERROR "Bad CASE index"
eStackFucked  ERROR "Entering new stack frame would overwrite the heap"

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Isolate the user from changes to the runtime system

SetElement      B       iSetElement
SetSubrange     B       iSetSubrange
ArrayAccess     B       iArrayAccess
ArrayAccessOne  B       iArrayAccessOne
IdnIrdbuff      B       iIdnIrdbuff
DebugName       B       iDebugName
DebugLine       B       iDebugLine
CheckArray      B       iCheckArray
CmpRea  B       iCmpRea
SetEQ   B       iSetEQ
SetNE   B       iSetNE
SetLE   B       iSetLE
SetGE   B       iSetGE
InSet   B       iInSet
MulInt  B       iMulInt
XX2Int  B       iXX2Int
DivInt  B       iDivInt
ModInt  B       iModInt
FnFloat B       iFnFloat
AddRea  B       iAddRea
SubRea  B       iSubRea
MulRea  B       iMulRea
XX2Rea  B       iXX2Rea
DivRea  B       iDivRea
Float2  B       iFloat2
StrEQ   B       iStrEQ
StrNE   B       iStrNE
StrLE   B       iStrLE
StrGE   B       iStrGE
StrLT   B       iStrLT
StrGT   B       iStrGT
TrdLn   B       iTrdLn
TrdChr  B       iTrdChr
Page    B       iPage
TrdInt  B       iTrdInt
TrdRea  B       iTrdRea
IrdType B       iIrdType
GetText B       iGetText
GetBytes        B       iGetBytes
PutText B       iPutText
PutBytes        B       iPutBytes
IrdUby  B       iIrdUby
IrdUwd  B       iIrdUwd
IrdBlk  B       iIrdBlk
TwrLn   B       iTwrLn
TwrChr  B       iTwrChr
TwrBoo  B       iTwrBoo
TwrInt  B       iTwrInt
TwrRea  B       iTwrRea
TwrHex  B       iTwrHex
TwrStr  B       iTwrStr
IwrType B       iIwrType
IwrUby  B       iIwrUby
IwrUwd  B       iIwrUwd
IwrBlk  B       iIwrBlk
Reset   B       iReset
XReset  B       iXReset
Release B       iRelease
Rewrite B       iRewrite
XRewrite        B       iXRewrite
WriteWidth      B       iWriteWidth
WriteDigits     B       iWriteDigits
Eoln    B       iEoln
Eof     B       iEof
PasExit B       iPasExit
Sin     B       iSin
Cos     B       iCos
Exp     B       iExp
Ln      B       iLn
Sqrt    B       iSqrt
Arctan  B       iArctan
Trunc   B       iTrunc
Round   B       iRound
IvalStr B       iIvalStr
RvalStr B       iRvalStr
CloseFiles      B       iCloseFiles
New     B       iNew
Dispose B       iDispose
SetCheck        B       iSetCheck
Plot    B       iPlot
Vdu     B       iVdu
Mode    B       iMode
Sound   B       iSound
Envelope        B       iEnvelope
Oscli   B       iOscli
SetTime B       iSetTime
Time    B       iTime
Adval   B       iAdval
Inkey   B       iInkey
Point   B       iPoint
IdnIwrbuff      B       iIdnIwrbuff
PopIblkI        B       iPopIblkI
Claim   B       iClaim

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CmdTail ; Space for reading the command tail into, and backtrace hasp

        %       256

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Strap the user on here, Igor !

PasLength * .
PasEntry  * .+4

        END
