RISCOS 15.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
; Copyright 2008 Castle Technology Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; This header file is autogenerated from the files maintained by the
; RISC OS allocations manager and should not be edited by anyone else.

        SUBT    Definitions relating to the basic RISCOS kernel ==> Hdr:RISCOS

OldOpt  SETA    {OPT}
        OPT     OptNoList+OptNoP1List

; SWI names are exported in two forms :
; 1)  with OS_  'OS_DoThingToOtherThing'  as N
; 2)  with XOS_ 'XOS_DoThingToOtherThing' as N + Auto_Error_SWI_bit

Auto_Error_SWI_bit_number * 17
Auto_Error_SWI_bit * 1 :SHL: Auto_Error_SWI_bit_number

SWIClass SETS   RISCOS_Kernel_0SWI_Name

        ^       RISCOS_Kernel_0SWI_Base
        AddSWI  WriteC                  ; &00
        AddSWI  WriteS                  ; &01
        AddSWI  Write0                  ; &02
        AddSWI  NewLine                 ; &03
        AddSWI  ReadC                   ; &04
        AddSWI  CLI                     ; &05
        AddSWI  Byte                    ; &06
        AddSWI  Word                    ; &07
        AddSWI  File                    ; &08
        AddSWI  Args                    ; &09
        AddSWI  BGet                    ; &0A
        AddSWI  BPut                    ; &0B
        AddSWI  GBPB                    ; &0C
        AddSWI  Find                    ; &0D
        AddSWI  ReadLine                ; &0E
        AddSWI  Control                 ; &0F
        AddSWI  GetEnv                  ; &10
        AddSWI  Exit                    ; &11
        AddSWI  SetEnv                  ; &12
        AddSWI  IntOn                   ; &13
        AddSWI  IntOff                  ; &14
        AddSWI  CallBack                ; &15
        AddSWI  EnterOS                 ; &16
        AddSWI  BreakPt                 ; &17
        AddSWI  BreakCtrl               ; &18
        AddSWI  UnusedSWI               ; &19
        AddSWI  UpdateMEMC              ; &1A
        AddSWI  SetCallBack             ; &1B
        AddSWI  Mouse                   ; &1C
        AddSWI  Heap                    ; &1D ; Our new ones start here
        AddSWI  Module                  ; &1E
        AddSWI  Claim                   ; &1F ; PMF's vector handling
        AddSWI  Release                 ; &20 ; routines
        AddSWI  ReadUnsigned            ; &21 ; Read an unsigned number
        AddSWI  GenerateEvent           ; &22
        AddSWI  ReadVarVal              ; &23 ; read variable value & type
        AddSWI  SetVarVal               ; &24 ; set  variable value & type
        AddSWI  GSInit                  ; &25
        AddSWI  GSRead                  ; &26
        AddSWI  GSTrans                 ; &27
        AddSWI  BinaryToDecimal         ; &28
        AddSWI  FSControl               ; &29
        AddSWI  ChangeDynamicArea       ; &2A
        AddSWI  GenerateError           ; &2B
        AddSWI  ReadEscapeState         ; &2C
        AddSWI  EvaluateExpression      ; &2D
        AddSWI  SpriteOp                ; &2E
        AddSWI  ReadPalette             ; &2F ; (was FontManager)
        AddSWI  ServiceCall             ; &30 ; was Claim_Release_FIQ
        AddSWI  ReadVduVariables        ; &31
        AddSWI  ReadPoint               ; &32
        AddSWI  UpCall                  ; &33
        AddSWI  CallAVector             ; &34 ; was ReadCurrentError
        AddSWI  ReadModeVariable        ; &35
        AddSWI  RemoveCursors           ; &36
        AddSWI  RestoreCursors          ; &37
        AddSWI  SWINumberToString       ; &38
        AddSWI  SWINumberFromString     ; &39
        AddSWI  ValidateAddress         ; &3A
        AddSWI  CallAfter               ; &3B
        AddSWI  CallEvery               ; &3C
        AddSWI  RemoveTickerEvent       ; &3D
        AddSWI  InstallKeyHandler       ; &3E
        AddSWI  CheckModeValid          ; &3F

SWIClass SETS   RISCOS_Kernel_1SWI_Name

        ^       RISCOS_Kernel_1SWI_Base
        AddSWI  ChangeEnvironment       ; &40
        AddSWI  ClaimScreenMemory       ; &41
        AddSWI  ReadMonotonicTime       ; &42
        AddSWI  SubstituteArgs          ; &43
        AddSWI  PrettyPrint             ; &44
        AddSWI  Plot                    ; &45
        AddSWI  WriteN                  ; &46
        AddSWI  AddToVector             ; &47
        AddSWI  WriteEnv                ; &48
        AddSWI  ReadArgs                ; &49
        AddSWI  ReadRAMFsLimits         ; &4A
        AddSWI  ClaimDeviceVector       ; &4B
        AddSWI  ReleaseDeviceVector     ; &4C
        AddSWI  DelinkApplication       ; &4D
        AddSWI  RelinkApplication       ; &4E
        AddSWI  HeapSort                ; &4F
        AddSWI  ExitAndDie              ; &50
        AddSWI  ReadMemMapInfo          ; &51
        AddSWI  ReadMemMapEntries       ; &52
        AddSWI  SetMemMapEntries        ; &53
        AddSWI  AddCallBack             ; &54
        AddSWI  ReadDefaultHandler      ; &55
        AddSWI  SetECFOrigin            ; &56
        AddSWI  SerialOp                ; &57
        AddSWI  ReadSysInfo             ; &58
        AddSWI  Confirm                 ; &59
        AddSWI  ChangedBox              ; &5A
        AddSWI  CRC                     ; &5B
        AddSWI  ReadDynamicArea         ; &5C
        AddSWI  PrintChar               ; &5D
        AddSWI  ChangeRedirection       ; &5E
        AddSWI  RemoveCallBack          ; &5F
        AddSWI  FindMemMapEntries       ; &60
        AddSWI  SetColour               ; &61
        AddSWI  ClaimSWI                ; &62 ; In ToolkitSpt - Must be implemented
        AddSWI  ReleaseSWI              ; &63 ; OS > 3.10.
        AddSWI  Pointer                 ; &64
        AddSWI  ScreenMode              ; &65
        AddSWI  DynamicArea             ; &66
        AddSWI  AbortTrap               ; &67
        AddSWI  Memory                  ; &68
        AddSWI  ClaimProcessorVector    ; &69
        AddSWI  Reset                   ; &6A
        AddSWI  MMUControl              ; &6B
        AddSWI  ResyncTime              ; &6C
        AddSWI  PlatformFeatures        ; &6D
        AddSWI  SynchroniseCodeAreas    ; &6E
        AddSWI  CallASWI                ; &6F
        AddSWI  AMBControl              ; &70 ### Clashes with OS_SpecialControl on PPlus ###
        AddSWI  CallASWIR12             ; &71
        AddSWI  SpecialControl          ; &72 ### this was &70 in original PPlus sources ###
        AddSWI  EnterUSR32              ; &73 first used in Ursula
        AddSWI  EnterUSR26              ; &74 first used in Ursula
        AddSWI  VIDCDivider             ; &75
        AddSWI  NVMemory                ; &76
        ^       OS_NVMemory + 4
        AddSWI  Hardware                ; &7A
        AddSWI  IICOp                   ; &7B
        AddSWI  LeaveOS                 ; &7C
        AddSWI  ReadLine32              ; &7D
        AddSWI  SubstituteArgs32        ; &7E
        AddSWI  HeapSort32              ; &7F

164 165
NCORESWIS  *    OS_HeapSort32 + 1       ; There are this many kernel SWIs, 0..NCORESWIS-1

166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
        ASSERT  @ <= &C0

SWIClass SETS   RISCOS_StringConversionSWI_Name

        ^       RISCOS_StringConversionSWI_Base
        AddSWI  ConvertStandardDateAndTime ; &C0
        AddSWI  ConvertDateAndTime         ; &C1

        ^       RISCOS_StringConversionSWI_Base + &10
        AddSWI  ConvertHex1             ; &D0
        AddSWI  ConvertHex2             ; &D1
        AddSWI  ConvertHex4             ; &D2
        AddSWI  ConvertHex6             ; &D3
        AddSWI  ConvertHex8             ; &D4
        AddSWI  ConvertCardinal1        ; &D5
        AddSWI  ConvertCardinal2        ; &D6
        AddSWI  ConvertCardinal3        ; &D7
        AddSWI  ConvertCardinal4        ; &D8
        AddSWI  ConvertInteger1         ; &D9
        AddSWI  ConvertInteger2         ; &DA
        AddSWI  ConvertInteger3         ; &DB
        AddSWI  ConvertInteger4         ; &DC
        AddSWI  ConvertBinary1          ; &DD
        AddSWI  ConvertBinary2          ; &DE
        AddSWI  ConvertBinary3          ; &DF
        AddSWI  ConvertBinary4          ; &E0
        AddSWI  ConvertSpacedCardinal1  ; &E1
        AddSWI  ConvertSpacedCardinal2  ; &E2
        AddSWI  ConvertSpacedCardinal3  ; &E3
        AddSWI  ConvertSpacedCardinal4  ; &E4
        AddSWI  ConvertSpacedInteger1   ; &E5
        AddSWI  ConvertSpacedInteger2   ; &E6
        AddSWI  ConvertSpacedInteger3   ; &E7
        AddSWI  ConvertSpacedInteger4   ; &E8
        AddSWI  ConvertFixedNetStation  ; &E9
        AddSWI  ConvertNetStation       ; &EA
        AddSWI  ConvertFixedFileSize    ; &EB
        AddSWI  ConvertFileSize         ; &EC
204
        AddSWI  ConvertVariform         ; &ED
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222

        ASSERT  @ <= &100

SWIClass SETS   RISCOS_WriteCharacter_0SWI_Name

        ^       RISCOS_WriteCharacter_0SWI_Base
        AddSWI  WriteI                  ; &100-&1FF

        ; RISC OS Specific register synonyms

Error   RN      r0                      ; Error return pointer

wp      RN      r12                     ; Workspace Pointer
WP      RN      r12
WsPtr   RN      r12

sp_irq  RN      r13_irq                 ; Note there is no definition
sp_svc  RN      r13_svc                 ; for sp_usr or sp_fiq.
223
stack   RN      r13                     ; Stack Pointer
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
Stack   RN      r13
STACK   RN      r13

        ; Vector numbers

UserV   *       &00
ErrorV  *       &01
IrqV    *       &02
WrchV   *       &03
RdchV   *       &04                     ; --,
CliV    *       &05                     ;   |
ByteV   *       &06                     ;   |
WordV   *       &07                     ;   |
FileV   *       &08                     ;   |
ArgsV   *       &09                     ;   } These numbers correspond
BGetV   *       &0A                     ;   } to the SWI numbers
BPutV   *       &0B                     ;   |
GBPBV   *       &0C                     ;   |
FindV   *       &0D                     ;   |
ReadLineV *     &0E                     ; --'
FSCV    *       &0F
EventV  *       &10
UPTV    *       &11
NETV    *       &12
KEYV    *       &13
INSV    *       &14
REMV    *       &15
CNPV    *       &16                     ; Count/Purge Buffer V
UKVDU23V *      &17                     ; VDU23 (decimal)
UKSWIV  *       &18                     ; Unknown SWI numbers
UKPLOTV *       &19                     ; VDU25 (decimal)
MouseV  *       &1A                     ; The mouse SWI vectors along here
VDUXV   *       &1B                     ; The kernel calls this vector instead of
                                        ; the VDU if bit 5 of wrch destination set
TickerV *       &1C                     ; 100Hz pacemaker
UpCallV *       &1D                     ; The 'can you deal with this before I go bang' vector.
ChangeEnvironmentV * &1E                ; vectors along here when changing any handlers,
                                        ; so debuggers etc. can stop it getting through.
SpriteV *       &1F                     ; called by SWI SpriteOp
DrawV   *       &20                     ; polygon fill vector for printers
EconetV *       &21                     ; Vector for NetFS/Econet progress reporting
ColourV *       &22                     ; for the ColourTrans module
PaletteV *      &23                     ; palette changed indication
SerialV *       &24                     ; indirection of SerialOps from kernel to Serial device drivers.
FontV   *       &25                     ; indirection of Font Manager calls prior
                                        ; to processing by Font Manager.
PointerV *      &26                     ; for mouse drivers
TimeShareV *    &27                     ; SkyNet TimeShare
GraphicsV *     &2A                     ; indirection of graphics system from Kernel
UnthreadV *     &2B                     ; high-priority callbacks
274
SeriousErrorV * &2D                     ; an exception occurred which could only be handled by flattening the privileged mode stacks
275

276
NVECTORS *      96                      ; There are this many vectors, 0..NVECTORS-1
277 278 279 280 281 282 283 284 285 286 287 288 289 290

        ; Buffer indices

Buff_Key        * 0
Buff_RS423In    * 1
Buff_RS423Out   * 2
Buff_Print      * 3
Buff_Sound0     * 4
Buff_Sound1     * 5
Buff_Sound2     * 6
Buff_Sound3     * 7
Buff_Speech     * 8
Buff_Mouse      * 9

291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
        ; Conversions for OS_ConvertVariform in R4

                ^ 0
ConvertToHex            # 1
ConvertToCardinal       # 1
ConvertToInteger        # 1 ; Signed
ConvertToBinary         # 1
ConvertToSpacedCardinal # 1
ConvertToSpacedInteger  # 1 ; Signed
ConvertToPunctCardinal  # 1
ConvertToPunctInteger   # 1 ; Signed
ConvertToFixedFileSize  # 1
ConvertToFileSize       # 1
ConvertToIPv4           # 1
ConvertToEUI            # 1
ConvertToIPv6           # 1
ConvertToShortestIPv6   # 1 ; See RFC5952 section 4
ConvertToHexLowercase   # 1
309
ConvertToUUID           # 1 ; See RFC4122
310

311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
        ; Event numbers. 0..31 available

Event_OutputEmpty       * 0
Event_InputFull         * 1
Event_CharInput         * 2
Event_ADCConvert        * 3
Event_VSync             * 4
Event_IntervalTimer     * 5
Event_Escape            * 6
Event_RS423Error        * 7
Event_Econet_UserRPC    * 8
Event_User              * 9
Event_Mouse             * 10
Event_Keyboard          * 11
Event_Sound             * 12
Event_Econet_Rx         * 14
Event_Econet_Tx         * 15
Event_Econet_OSProc     * 16    ; This is where Notify, View etc. happen
Event_MIDI              * 17    ; to notify of MIDI data being received
Event_Internet          * 19
Event_Expansion         * 21    ; was SJ. Now earmarked for use with subreason codes
Event_DeviceOverRun     * 22    ; DeviceFS to inform the world that a device has overrun
Event_PortableBMU       * 28    ; Downgrade of BMU interrupt.
; #### WARNING #### There are TWO event numbers left. Do not allocate any more
; without a really good reason.                                            amg
Event_PRISM             * 32    ; State change events from the PRISM subsystem

; Subreason codes for Event_Expansion - to be passed in R1 on the event call
                                ^ 0
Event_Expansion_SmartCard       # 0          ; ANC Rich Buckley
341 342
Event_Expansion_SCInterface     # 1          ; 0 more useful alias for above
Event_Expansion_SCTransport     # 1          ; 1
ROOL's avatar
ROOL committed
343
                                ^ 4
Jeffrey Lee's avatar
Jeffrey Lee committed
344
Event_Expansion_PointerScroll   # 1          ; 4
345

346 347 348 349 350 351 352 353
; Subreason codes for Event_Internet - to be passed in R1 on the event call
                                ^ 1
Event_Internet_SocketAsync      # 1
Event_Internet_SocketUrgent     # 1
Event_Internet_SocketBroken     # 1
Event_Internet_RevARPReply      # 1
Event_Internet_RevARPRequest    # 1

354 355 356 357 358 359 360 361 362 363 364 365 366
; Keyboard status bits

KBStat_PendingAlt       * &01
KBStat_ScrollLock       * &02
KBStat_NoNumLock        * &04
KBStat_ShiftEngaged     * &08
KBStat_NoCapsLock       * &10
KBStat_NoShiftLock      * &20
KBStat_CtrlEngaged      * &40
KBStat_ShiftEnable      * &80

KBStat_NoCapsLockBitNo  * 4

367 368
NIL                     * &80000000     ; An interesting value
AppSpaceStart           * &8000         ; Start of the user's world
369 370

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
371
; From here on, due for retirement
372

373 374 375
MaxLengthDateLo *       &33EA0000       ; Wednesday, 28th September 1988
MaxLengthDateHi *       &00000041       ; 11:34:36.80 am

376 377 378 379 380
                 GBLL True
True             SETL {TRUE}

                 GBLL False
False            SETL {FALSE}
381

382 383
                 GBLL AssemblingArthur
AssemblingArthur SETL {FALSE}
384 385 386

        OPT     OldOpt
        END