KernelWS 71.4 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
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 164 165 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
; Copyright 1996 Acorn Computers 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.
;
        SUBT    > Kernel WorkSpace

OldOpt  SETA    {OPT}
        OPT     OptNoList+OptNoP1List

; ***********************************
; ***    C h a n g e   L i s t    ***
; ***********************************

; Date       Name  Description
; ----       ----  -----------
; 02-Nov-87  APT   Added module SWI hash table
; 03-Nov-87  APT   Modo-fied module SWI hash table info, removed BRKLST
; 09-Nov-87  APT   Removed ESCCNT and ESFLG
; 12-Nov-87  APT   Added IRQsema
; 13-Nov-87  APT   Added DefaultIRQ1V codespace
; 16-Nov-87  APT   PIRQ chain heads
; 18-Nov-87  APT   Reordered EvtHan, EvtHan_ws
; 19-Nov-87  APT   Moved IRQsema
; 01-Dec-87  APT   Added interruptible heap manager workspace
; 08-Dec-87  TMD   Added ECFShift, ECFYOffset
; 14-Dec-87  TMD   Added DisplayNColour, DisplayModeFlags
; 15-Dec-87  TMD   Added KeyAlphabet
; 22-Dec-87  NDR   Using ScratchSpace
; 13-Jan-88  APT   General scratchspace bash, low workspace reordering.
;                  Removed spurious 32 bytes of osbyte wspace
; 14-Jan-88  APT   *type buffer in scratchspace.
;                  MOShasFIQ byte added
; 20-Jan-88  APT   Workspace juggling for speed & space; also discarded
;                  Level0 stuff.
; 28-Jan-88  APT   MetroGnome moved to "public" location for ADFS
; 02-Feb-88  APT   FIQclaim_interlock added
; 05-Feb-88  APT   CallBack_Vector
; 09-Feb-88  APT   RAM for SWI despatch
; 17-Feb-88  TMD   Added VduSaveArea, VduSaveAreaPtr, DisplayModeNo
; 26-Feb-88  APT   NoOfCamEntries manifest
; 03-Mar-88  APT   Shrank SVC despatch
; 03-Mar-88  APT   NoOfCamEntries manifest doubled
; 07-Mar-88  TMD   Added DisplayScreenStart, VduOutputCurrentState,
;                  SpriteMaskSelect, reordered mode variables
; 07-Mar-88  APT   Made CamEntries always at &164
; 07-Mar-88  TMD   Added GCharSizes, GCharSizeX, GCharSizeY
; 08-Mar-88  TMD   Added GCharSpacing, GCharSpaceX, GCharSpaceY
; 08-Mar-88  TMD   Moved GCharSizes..GCharSpaceY into first 1K of workspace
; 15-Mar-88  TMD   Added HLineAddr
; 18-Mar-88  TMD   Added DisplayXWindLimit, DisplayYWindLimit,
;                   DisplayXEigFactor, DisplayYEigFactor, PointerXEigFactor
; 18-Mar-88  APT   Setting variables scratchspace use revised.
; 21-Mar-88  TMD   Removed CursorIndex
; 22-Mar-88  TMD   Added TCharSizeX,TCharSizeY,TCharSpaceX,TCharSpaceY
; 29-Mar-88  TMD   Added GcolOraEorAddr
; 31-Mar-88  TMD   Removed WsFontPtr
; 07-Apr-88  SKS   Added HeapSort use of ScratchSpace
; 14-Apr-88  TMD   Added SerialFlags
; 28-Apr-88  TMD   Added XONXOFFChar
;  5-May-88  APT   Added MemorySpeed
; 18-May-88  APT   Added CannotReset sema at &107, removed pre-1.20 changes.
; 24-May-88  TMD   Added ClipBoxEnable, ClipBoxLCol..ClipBoxTRow, moved in
;                   ScrLoaSpriteCB, ScrLoaBuffer, SrcSavCommon
; 24-May-88  TMD   Flood fill uses ScratchSpace
; 01-Jun-88  TMD   Added AlignSpace for ClipBoxCoords
; 03-Jun-88  BCSKS Make Keyboard buffer into a useful part of the system
;                  Also PrinterBufferSize
; 09-Jun-88  DJS   Draw uses ScratchSpace
; 09-Jun-88  BC    Gave Econet some private debungling space
; 11-Jun-88  SKS   Align IRQ stack to make STMFD not cross two MEMC bdy's
;                  Made info condit'l on AsmArf; someone had commented it out!
; 15-Jun-88  SKS   Added two more instructions in SWIDespatch area
;                  Moved SLVK definition into kernel; it's not public
; 16-Jun-88  SKS   Added 3 more instructions in SWIDespatch area + nailed
;                  SvcTable address for compatibility
; 22-Jun-88  SKS   Moved MEMC_CR_SoftCopy into pubic ws
; 19-Jul-88  APT   Added UpCall handler stuff
; 20-Jul-88  SKS   Added above entry
;                  Amended comment about overlaid workspace in vdu
; 15-Aug-88  SKS   Inserted DomainId at FF8 (set by Wimp on task swap, used by
;                  FileSwitch to tag resources)
; 27-Sep-89  JSR   Added ColourTrans to users of scratch space
; 24-Oct-89  TMD   Added CamEntriesForBigMachines, CamEntriesPointer
; 26-Oct-89  TMD   Added MaxCamEntry, removed NoOfCamEntries symbol
; 27-Oct-89  TMD   Added VIDCClockSpeed
; 09-Nov-89  TMD   Added ResetIndirection
; 15-Jan-91  TMD   Added ROMModuleChain
; 04-Feb-91  DDV   Added DeviceFS as user of ScratchSpace.
; 04-Feb-91  DDV   Added ColourTrans use of ScratchSpace to build diff tables.
; 06-Mar-91  TMD   Added IOSystemType
; 07-Mar-91  LVR   ADFS uses scratch space for floppy formatting
; 07-Mar-91  TMD   Added MonitorLeadType
; 08-Mar-91  TMD   Added PrinterBufferAddr, PrinterBufferSize
; 11-Apr-91  TMD   Added SerialInHandle, SerialOutHandle
; 24-Apr-91  TMD   Added UniqueMachineID
; 09-Jun-91  RM    Added KernelMessagesBlock,ErrorSemaphore and MOSConvertBuffer
; 26-Jul-91  JSR   Extend GeneralMOSBuffer by 4 bytes to make it a valid
;                       length for the default error handler's error buffer
; 19-Aug-91  JSR   Added *If to list of GeneralMOSBuffer users
; 22-Aug-91  TMD   Reduced ErrorSemaphore to a byte, added PortableFlag
; 25-Aug-91  DDV   Updated to indicate correct usage of scratch space by ColourTrans
; 09-Jan-92  DDV   Added FgPattern, BgPattern and indicate use of ScratchSpace by OS_SetColour
; 20-Jan-92  TMD   OS_SetColour no longer uses ScratchSpace
; 17-Feb-92  ECN   Added CLibWord and RISCOSLibWord
; 02-Apr-92  TMD   Added ScreenBlankFlag
; 27-Jul-92  TMD   Create Victoria specific version
; 28-Jul-92  TMD   Moved RAMDiscAddress
; 29-Jul-92  TMD   Moved SpriteSpaceAddress
; 30-Jul-92  TMD   Moved FontCacheAddress
; 31-Jul-92  TMD   Moved ScreenEndAdr from source.vdudecl, and moved actual address!
; 03-Aug-92  TMD   Added PhysRam (moved from hdr:System)
; 24-Aug-92  TMD   Added AbortIndirection
; 26-Aug-92  TMD   Added PreVeneerRegDump
; 02-Sep-92  TMD   Added FirPalAddr, SecPalAddr
; 10-Sep-92  DDV   Added new Vdu Variables for new text expansion buffer
; 17-Sep-92  DDV   Moved NColour into the word initialised VDU workspace
; 17-Sep-92  DDV   Two new colour words added for text foreground and background.
; 27-Jan-93  TMD   Moved RMA to new position
; 29-Jan-93  TMD   Put RMA back to old position (you can't branch to above 32M!)
; 01-Feb-93  TMD   Added PhysRamTable
; 02-Feb-93  TMD   Added VInitSoftCopy and VEndSoftCopy
; 03-Feb-93  TMD   Added PhysRamTableEnd
; 04-Feb-93  TMD   Added extra slot in PhysRamTable (in case soft-loaded OS splits a bank)
; 08-Feb-93  TMD   Added VRAMWidth variable, and extra symbols for skipped bits
; 24-Feb-93  TMD   Changed VRAMPhysAddr to VideoPhysAddr, and split off VideoSize from VRAMSize, to allow for
;                   DRAM-only systems
; 05-Mar-93  TMD   Added CMOSRAMCache
; 19-Apr-93  TMD   Added DAList, AppSpaceDANode and DANode offset symbols
; 26-Apr-93  TMD   Added FreePoolAddress, FreePoolMaxSize, FreePoolSize
; 29-Apr-93  TMD   Changed FontCacheAddress, SpriteSpaceAddress, RAMDiscAddress and FreePoolAddress
;                   in order to make way for L2PT, which is moving above 64M
; 10-May-93  TMD   Added SoftCamMapSize
; 11-May-93  TMD   Moved SoftCamMapSize into area that's not zapped in clearing all memory routine
; 12-May-93  TMD   Added FreePoolDANode, removed FreePoolSize
; 20-May-93  TMD   Moved AplWorkSize into AppSpaceDANode
; 27-May-93  TMD   Added VideoBandwidth
; 04-Jun-93  TMD   Added CurrentMonitorType
; 09-Jun-93  TMD   Added CamMapCorruptDebugBlock
; 07-Jul-93  TMD   Increased FreePoolMaxSize to 64M (had to reduce RAMDiscMaxSize to 48M and
;                   move FreePoolAddress down to do this)
; 15-Jul-93  TMD   Added KernelModeSelector
; 26-Jul-93  SMC   Moved DefaultIRQ1V (had to accommodate IRQs for IOMD DMA)
; 04-Aug-93  TMD   Added L2PTSize, removed FreePoolMaxSize
; 14-Aug-93  TMD   Removed SpriteSpaceAddress, shuffled things down
; 16-Aug-93  TMD   Removed RAMDiscAddress, shuffled things down
; 17-Aug-93  TMD   Removed FontCacheAddress, shuffled things down
;                  Corrected maximum size of system heap to 2M-8K.
;                  Added node (in bottom 32K) for system heap.
; 25-Aug-93  SMC   Added processor vector table at ProcVec_Start
;                  Added ProcVecPreVeneers
; 02-Sep-93  SMC   Moved RMA to &02100000 and changed application space size to 28M.
; 03-Sep-93  TMD   Moved InitKbdWs into SkippedTables (was at start of screen originally)
; 07-Oct-93  TMD   Put in OldMemoryMap option so I can still use it
; 07-Oct-93  TMD   Added ScreenBlankDPMSState, HSWRSoftCopy, VSWRSoftCopy
; 10-Dec-93  BC    Added RawMachineID
; 13-Dec-93  BC    Removed UniqueMachineID
; 14-Jan-94  TMD   Added CDASemaphore
; 18-Jan-94  TMD   Added MMUControlSoftCopy
; 15-Jun-94  AMcC  Renamed file (was VickySpace)
;                  The following values are 'exported' to PublicWS:
;                        Name:                     Used by:
;                        ----------------------------------
;                        BgEcfOraEor               SprExtend
;                        FgEcfOraEor               SprExtend
;                        BranchToSWIExit           TaskWindow
;                        CannotReset               FileCore
;                        DomainId                  FileSwitch
;                        ESC_Status                ADFS, DeviceFS
;                        IRQsema                   Draw, MsgTrans
;                        LatchBSoftCopy            ADFS, Parallel
;                        MEMC_CR_SoftCopy          ADFS
;                        RedirectInHandle          TaskWindow
;                        RedirectOutHandle         TaskWindow
;                        ScratchSpace              ADFS, Colours, Draw, FileCore
;                                                  FileSwitch, FontManager, NetFiler
;                        SoundDMABufferSize        Sound0
;                        SoundDMABuffers           Sound0
;                        SoundWorkSpace            Portable, Sound1, Sound2, Voices
;                        SVCSTK                    FileSwitch
;                        SvcTable                  TaskWindow, Wimp
;                        SysHeapStart              FileSwitch
;                        VduDriverWorkSpace        SprExtend
;
; 31-Oct-94  AMcC/RM/WT  Added CLine_Softcopy for Morris monitor id
; 03-Nov-94  AMcC        Export ScreenBlankFlag and ScreenBlankDPMSState
;                        (for DPMSUtils: part of RISC OS releases 3.50 and 3.60)
Neil Turton's avatar
Neil Turton committed
197
; 28-Mar-95  JRH         Added NVRamSize and RTCFitted, conditioned on E2ROMSupport
Neil Turton's avatar
Neil Turton committed
198
; 06-Feb-95  SMC         Increased SVC stack size to 12K.
Neil Turton's avatar
Neil Turton committed
199 200 201 202 203 204 205 206 207
; 18-Jan-96  JRH         Removed CLine_Softcopy cos not needed
; 06-Feb-96  SMC         Increased DefIRQ1Vspace for IRQC registers
; amg 6/12/96 Renaissance. Merge in changes below from 3.70 version. Make changes conditional.
; 07-Feb-95  WT          Added LCD_Active for LCD/CRT dynamic switching support
; 07-Feb-95  WT          Added VStartSoftCopy for dual-panel LCD support
; 18-May-95  WT          Added LCD_Inverted for LCD inversion (well, surprise surprise!)
; 05-Dec-95  WT          Added ProcessorType and ProcessorFlags (1 byte each)
; amg 07/12/96 Renaissance. Shifted ResetType (which is a public export) so it'll
;              stay in the same place.
Kevin Bracey's avatar
Kevin Bracey committed
208
; 21-Jul-98  NDT         Added PixelRate.  Moved KernelModeSelector to make space.
209
; 19-Oct-99  KJB         Moved IOSystemType into SkippedTables.
Neil Turton's avatar
Neil Turton committed
210 211 212 213 214 215
;
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Memory map:

; Dynamic area node format

216
                  ^     0
217
DANode_Link       #     4               ; points to next node (in address order)
218 219 220
DANode_Number     #     4               ; number of this area
DANode_Base       #     4               ; base address of area (points in middle of doubly-mapped areas)
DANode_Flags      #     4               ; various flags
221 222
DANode_Size       #     4               ; current logical size of area (not counting holes, if Sparse/PMP area)
DANode_MaxSize    #     4               ; maximum logical size of area
223 224 225 226 227 228
DANode_Workspace  #     4               ; workspace pointer when calling handlers
DANode_Handler    #     4               ; pointer to handler routine for area
DANode_Title      #     4               ; pointer to area title
DANode_SubLink    #     4               ; next node in any disjoint sublist (currently used for Shrinkables only)
DANode_SparseHWM  #     4               ; high water mark, if Sparse area (highest base+size claimed for area)
DANode_SortLink   #     4               ; next node in alphabetically sorted list
229 230 231
DANode_PMP        #     4               ; pointer to physical memory pool - zero if not PMP or has been resized to zero
DANode_PMPSize    #     4               ; number of pages currently in phys pool
DANode_PMPMaxSize #     4               ; size of phys memory pool, in pages
232 233
DANode_NodeSize   #     0

234 235 236 237 238 239 240 241 242
; CAM entry format
                  ^     0
CAM_LogAddr       #     4               ; Logical address page is assigned to (lower address if doubly mapped, Nowhere/DuffEntry if not mapped)
CAM_PageFlags     #     4               ; DynAreaFlags_* and PageFlags_*
CAM_PMP           #     4               ; Pointer to PMP (DANode ptr) if DynAreaFlags_PMP. 0 if not.
CAM_PMPIndex      #     4               ; Index of page in PMP page list. Invalid if not in PMP.
CAM_EntrySize     #     0
CAM_EntrySizeLog2 *     4

Neil Turton's avatar
Neil Turton committed
243 244 245

; The addresses below are only temporary; eventually most of them will be allocated at run time (we hope!)

246
 [ HiProcVecs
247
ProcVecs            * &FFFF0000
248
 |
249
ProcVecs            * &00000000
250
 ]
251 252
; Currently, zero page must be located at the processor vectors
ZeroPage            * ProcVecs
253

254 255 256 257
 [ CompatibilityPage
        ASSERT ZeroPage != 0 :LAND: ProcVecs != 0
 ]

258
; Sort out 26/32 bit versions
259 260 261 262
SVCStackSize        *  32*1024
IRQStackSize        *   8*1024
ABTStackSize        *   8*1024
UNDStackSize        *   8*1024
263
KbuffsMaxSize       *  64*1024
264
ScreenMaxSize       * 480*1024
265
DCacheCleanSize     * 256*1024  ;should be multiple of 64k
Kevin Bracey's avatar
Kevin Bracey committed
266

267 268 269
AplWorkMaxSize      * &20000000 ; 512M - temporary (need to decide this at boot time)
RMAAddress          * AplWorkMaxSize ; temporary - run time allocate?
RMAMaxSize          * &10000000 ; 256M
270 271 272 273
SysHeapChunkAddress * RMAAddress + RMAMaxSize
SysHeapAddress      * SysHeapChunkAddress
SysHeapMaxSize      * 32:SHL:20
FreePoolAddress     * 0
274

Jeffrey Lee's avatar
Jeffrey Lee committed
275 276 277 278 279 280 281 282 283 284 285 286 287
        MACRO
$label  ASpace $size, $align
      [ "$align" <> ""
        AlignSpace $align
      ELIF $size >= &10000
        AlignSpace &10000 ; 64K align to make large page mapping a possibility
      ]
      [ "$label" <> "" :LAND: :DEF:ShowWS
        ! 0, "$label at ":CC::STR:@
      ]
$label  # $size
        MEND

288
                    ^ &B9000000
Jeffrey Lee's avatar
Jeffrey Lee committed
289 290 291
IOLimit             ASpace &41000000 ; initial lower limit on room for IO space (DA creation may move limit up)
                                     ; IO start will be placed just before CAM (calculated at runtime)
CAMTop              ASpace &00000000 ; top of CAM, will be allocated down from here
292
HALWorkspaceSize    * &00100000
Jeffrey Lee's avatar
Jeffrey Lee committed
293 294 295 296 297 298
HALWorkspace        ASpace HALWorkspaceSize
IRQStackAddress     ASpace IRQStackSize, &100000
SVCStackAddress     ASpace SVCStackSize, &100000
ABTStackAddress     ASpace ABTStackSize, &100000
UNDStackAddress     ASpace UNDStackSize, &100000
DCacheCleanAddress  ASpace &00040000, &10000 ; eg. for StrongARM, 256k of space
299
KbuffsBaseAddress   ASpace KbuffsMaxSize ; kernel buffers for long command lines
Jeffrey Lee's avatar
Jeffrey Lee committed
300
HALWorkspaceNCNB    ASpace &00008000 ; 32K of uncacheable HAL workspace (if requested)
301
KWSLongDescBase     * :INDEX: @
Jeffrey Lee's avatar
Jeffrey Lee committed
302 303 304 305
 [ LongDesc
LL3PT               ASpace &00800000, &100000 ; 8MB of L3PT
LL2PT               ASpace &00004000 ; 16KB of L2PT
LL1PT               ASpace &00001000 ; 32 bytes of L1PT
306 307 308 309 310 311 312 313 314
 ]
 [ ShortDesc
KWSLongDescLimit    * :INDEX: @
                    # KWSLongDescBase-(:INDEX:@) ; Wind back so that long & short descriptor page tables share the same address space
L2PT                ASpace &00400000, &400000 ; 4MB of L2PT
L1PT                ASpace &00004000 ; 16KB of L1PT
   [ (:INDEX: @) < KWSLongDescLimit
                    # KWSLongDescLimit-(:INDEX:@) ; Wind forwards
   ]
Jeffrey Lee's avatar
Jeffrey Lee committed
315
 ]
Jeffrey Lee's avatar
Jeffrey Lee committed
316 317 318 319 320
                    ASSERT &FAFF0000-@ < &80000000
                    # &FAFF0000-@    ; padding to ensure SoundWorkSpace export is correct (in CursorChunkAddress)
CursorChunkAddress  ASpace &00008000
DuffEntry           ASpace &00001000 ; No page ever mapped in here (L2PT entry always 0), also, all non mapped pages
Nowhere             * DuffEntry      ; use this as their CAM entry. There is only one 'Nowhere' (synonym).
Jeffrey Lee's avatar
Jeffrey Lee committed
321
PhysicalAccess      ASpace &01000000, &01000000 ; 16MB allocation to permit supersection mapping
322 323 324 325 326 327
WorkspaceLimit      # 0

                 GBLL ROMatTop
ROM                 * &FC000000
ROMatTop         SETL {TRUE}
        ASSERT ROM >= WorkspaceLimit
Jeffrey Lee's avatar
Jeffrey Lee committed
328
RWBase              * &FF000000 ; ~16MB of RW data space available to C code
329

330 331 332 333

IRQSTK              * IRQStackAddress + IRQStackSize
ABTSTK              * ABTStackAddress + ABTStackSize
UNDSTK              * UNDStackAddress + UNDStackSize
Neil Turton's avatar
Neil Turton committed
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; system variables

        ^  0,R12

OSBYTEFirstVar  #  0

ByteVars  #  0                 ; The main osbyte variables, accessed
                               ; via calls &A6 to &FF

VarStart  #  2                 ; &A6,&A7
ROMPtr    #  2                 ; &A8,&A9
ROMInfo   #  2                 ; &AA,&AB
KBTran    #  2                 ; &AC,&AD
VDUvars   #  2                 ; &AE,&AF

CFStime   #  1                 ; &B0
InputStream #  1               ; &B1
KeyBdSema #  1                 ; &B2

ROMPollSema #  1               ; &B3
OSHWM     #  1                 ; &B4

RS423mode #  1                 ; &B5
NoIgnore  #  1                 ; &B6
CFSRFS    #  1                 ; &B7
VULAcopy  #  2                 ; &B8,&B9

ROMatBRK  #  1                 ; &BA
BASICROM  #  1                 ; &BB

ADCchanel #  1                 ; &BC
ADCmaxchn #  1                 ; &BD
ADCconv   #  1                 ; &BE

RS423use     #  1              ; &BF
RS423conflag #  1              ; &C0

FlashCount # 1                 ; &C1
SpacPeriod # 1                 ; &C2
MarkPeriod # 1                 ; &C3

KeyRepDelay # 1                ; &C4
KeyRepRate  # 1                ; &C5

ExecFileH   # 1                ; &C6
SpoolFileH  # 1                ; &C7

ESCBREAK    # 1                ; &C8 (200)

KeyBdDisable # 1               ; &C9
KeyBdStatus  # 1               ; &CA

RS423HandShake # 1             ; &CB
RS423InputSupr # 1             ; &CC
RS423CFSFlag   # 1             ; &CD

EconetOScall # 1               ; &CE
EconetOSrdch # 1               ; &CF
EconetOSwrch # 1               ; &D0

SpeechSupr # 1                 ; &D1
SoundSupr # 1                  ; &D2

BELLchannel # 1                ; &D3
BELLinfo    # 1                ; &D4
BELLfreq    # 1                ; &D5
BELLdur     # 1                ; &D6

StartMessSupr # 1              ; &D7

SoftKeyLen # 1                 ; &D8

PageModeLineCount # 1          ; &D9

VDUqueueItems # 1              ; &DA

TABch # 1                      ; &DB
ESCch # 1                      ; &DC

IPbufferCh # 4                 ; &DD,&DE,&DF,&E0
RedKeyCh   # 4                 ; &E1,&E2,&E3,&E4

ESCaction  # 1                 ; &E5
ESCeffect  # 1                 ; &E6

u6522IRQ # 1                   ; &E7
s6850IRQ # 1                   ; &E8
s6522IRQ # 1                   ; &E9

TubeFlag # 1                   ; &EA

SpeechFlag # 1                 ; &EB

WrchDest # 1                   ; &EC
CurEdit  # 1                   ; &ED

SoftResetVars # 0              ; Reset to here on soft reset

KeyBase # 1                    ; &EE
Shadow # 1                     ; &EF
Country # 1                    ; &F0

UserFlag # 1                   ; &F1

SerULAreg # 1                  ; &F2

TimerState # 1                 ; &F3

SoftKeyConsist # 1             ; &F4

PrinterDrivType   # 1          ; &F5
PrinterIgnore     # 1          ; &F6

BREAKvector # 3                ; &F7,&F8,&F9

MemDriver  # 1                 ; &FA - where the VDU drivers write to
MemDisplay # 1                 ; &FB - where we display from

LangROM # 1                    ; &FC

LastBREAK # 1                  ; &FD

KeyOpt # 1                     ; &FE

StartOptions # 1               ; &FF

Kevin Bracey's avatar
Kevin Bracey committed
462
HardResetVars # 0              ; Reset to here on hard reset
Neil Turton's avatar
Neil Turton committed
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
PowerOnResetVars # 0           ; Reset to here on power-on reset

; These two can dovetail in here to use up 2 bytes before the AlignSpace!

SerialInHandle # 1              ; Handle for serial input stream  (0 if not open currently)
SerialOutHandle # 1             ; Handle for serial output stream (-----------""----------)

        AlignSpace

EventSemaphores # 32            ; One byte for each of 32 events

TimerAlpha # 8                  ; As used by time (bottom 5 bytes)
TimerBeta  # 8                  ; ................................
; both aligned to word boundaries

RealTime # 8                    ; 5-byte fast real-time

PrinterActive # 4               ; Handle/active flag for printer (word aligned)

IntervalTimer # 5               ; Up Counter synchronous with TIME.
; Event generated when Zero is reached
; bottom byte aligned to word boundary

486
           # 2 ; SPARE
Neil Turton's avatar
Neil Turton committed
487 488 489

FlashState # 1 ; which flash colours are we using

490
           # 3 ; SPARE
Neil Turton's avatar
Neil Turton committed
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522

TVVertical # 1                  ; *TV first parameter

TVInterlace # 1                 ; *TV second parameter

CentiCounter # 1                ; Counter for VDU CTRL timing

Alphabet # 1                    ; Current alphabet number

Keyboard # 1                    ; Current keyboard number

KeyAlphabet # 1                 ; Alphabet associated with current keyboard

                GBLS    PrinterPrefix
PrinterPrefix   SETS    "PrinterType$"

PrinterTypeName #       6 + :LEN: (PrinterPrefix)

        AlignSpace

SerialFlags # 4                 ; New serial flags

XONXOFFChar # 1                 ; Character to send before rest (0 if none)

        AlignSpace

OSBYTEVarSize * @-OSBYTEFirstVar

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

; End of variables' space

523 524 525 526 527 528 529 530 531 532 533 534 535 536 537
; *** layout of a descriptor block for a display pointer shape ***

                  ^  0
PointerBlkHAL     #  0  ; fields up to private part passed to HAL
PointerWidth      #  1  ; actual (unpadded) shape width in bytes (from OS_Word 21)
PointerHeight     #  1  ; shape height in pixels
                  #  2  ; alignment padding
PointerBuffLA     #  4  ; logical address of shape buffer (up to 8 * 32 bytes)
PointerBuffPA     #  4  ; physical address of shape buffer
PointerBlkPrivate #  0  ; fields below here not used by HAL
PointerActiveX    #  1  ; active x in pixels from left
PointerActiveY    #  1  ; active y in pixels from top
                  #  2  ; alignment padding
PointerBlkSize    #  0

Neil Turton's avatar
Neil Turton committed
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599

; ***********************************
; ***  Main Vdu Driver Workspace  ***
; ***********************************

        ^ 0

FgEcf  # 4 * 8  ; Foreground Ecf, set by GCOL(a,0-127)
BgEcf  # 4 * 8  ; Background Ecf, set by GCOL(a,128-255)
GPLFMD # 4      ; Foreground action, set by GCOL(a,0-127)
GPLBMD # 4      ; Background action, set by GCOL(a,128-255)
GFCOL  # 4      ; Foreground colour, set by GCOL(a,0-127)
GBCOL  # 4      ; Background colour, set by GCOL(a,128-255)

GWLCol # 4      ; Graphics window left column  --
GWBRow # 4      ; Graphics window bottom row     |
GWRCol # 4      ; Graphics window right column   |
GWTRow # 4      ; Graphics window top row      --

qqqPad   # 3
QQ       # 17   ;Queue - QQ+1 is on a word boundary
QOffset  # 4    ;Value to add to VDUqueueItems to point to next queue posn.
JVec     # 4    ;Jump vector to internal routines

; Start of MODE table workspace

ScreenSize # 4  ; number of bytes needed for this mode (assumed 1st in list)

XWindLimit # 4  ; Maximum value of GWRCol (internal representation)

; LineLength must be immediately after YWindLimit

YWindLimit # 4  ; Maximum value of GWTRow (internal representation)

LineLength # 4  ; Length of one pixel row in bytes

NColour # 4     ; Number of colours minus 1

YShftFactor # 4 ; Number of places to shift YCoord in address generation after
                ; multiplying by 5, holds
                ; 7,6,5 or 4 for 8,4,2 or 1 bits per pixel (640x256 mode) or
                ; 6,5,4 or 3 for 8,4,2 or 1 bits per pixel (320x256 mode).

ModeFlags # 4   ; Bit 0 => non-graphic, Bit 1 => teletext, Bit 2 => gap mode

XEigFactor # 4  ; Number of places to shift XCoord in external to internal
                ; coordinate conversion, holds
                ; 1 for 640x256 mode
                ; 2 for 320x256 mode
                ; 3 for 160x256 (BBC micro mode 2)

YEigFactor # 4  ; number of shifts to convert between internal/external Y

Log2BPC # 4     ; Log to base 2 of BytesPerChar ie (0,1,2,3,4)

Log2BPP # 4     ; Log to base 2 of BitsPerPix ie (0,1,2,3)

ScrRCol # 4     ; Maximum column number in this screen mode
ScrBRow # 4     ; Maximum row number in this screen mode

; End of table-initialised workspace

600 601
         # 8    ; SPARE

Neil Turton's avatar
Neil Turton committed
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
; Next 3 must be together in this order !

XShftFactor # 4 ; Number of places to shift XCoord in address generation,
                ; holds 2,3,4 or 5 for 8,4,2,1 bits per pixel respectivly
GColAdr # 4     ; Address of Ecf to plot - either FgEcf or BgEcf

ScreenStart # 4         ; Start address of screen (for VDU drivers)

NPix # 4        ; Number of pixels per word minus 1, holds
                ; holds 3,7,15 or 31 for 8,4,2,1 bits per pixel modes

AspectRatio # 4 ; Pixel shape : 0 square, 1 horz rect, 2 vert rect

BitsPerPix # 4  ; Bits per pixel (1,2,4,8)

617
BytesPerChar # 4        ; Bytes per 8 pixels of character
Neil Turton's avatar
Neil Turton committed
618 619
                        ; (same as BitsPerPix except in double pixel modes)

620
DisplayLineLength # 4   ; LineLength of display. May include padding from ExtraBytes control list item, so needs manual preservation during screen redirection.
Neil Turton's avatar
Neil Turton committed
621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696

RowMult # 4     ; Row multiplier for text manipulation

RowLength # 4   ; Bytes per text row in this mode (eg 640,1280,5120)

; The following (up to and including NewPtY) must be together in this order
; (relied upon by DefaultWindows)

TWLCol # 4      ; Text window left column  --
TWBRow # 4      ; Text window bottom row     |
TWRCol # 4      ; Text window right column   |
TWTRow # 4      ; Text window top row      --

OrgX # 4        ; Screen origin (external representation)
OrgY # 4

GCsX # 4        ; Graphics cursor (external representation)
GCsY # 4

OlderCsX # 4    ; Very old X coordinate (internal)
OlderCsY # 4    ; Very old Y coordinate (internal)

OldCsX # 4      ; Old graphics cursor (internal representation) --
OldCsY # 4      ;                                                 |
                ;                                                 |
GCsIX  # 4      ; Graphics cursor (internal representation)       |
GCsIY  # 4      ;                                                 |
                ;                                                 |
NewPtX # 4      ; Newest point (internal representation)          |
NewPtY # 4      ;                                               --

; End of together block

TForeCol # 4    ; Text foreground colour
TBackCol # 4    ; Text background colour

CursorX # 4     ; Text cursor X position ; these 3 must be in same order as ...
CursorY # 4     ; Text cursor Y position
CursorAddr # 4  ; Screen address of (output) cursor

InputCursorX # 4        ; Input cursor X position ; ... these 3
InputCursorY # 4        ; Input cursor Y position
InputCursorAddr # 4     ; Screen address of input cursor

EORtoggle # 4   ; Toggle between gap and non-gap
RowsToDo  # 4   ; in the CLS

VduStatus # 4   ; Vdu2, Window, Shadow bits (others in CursorFlags)

CBWS # 8        ; Clear block (VDU 23,8..) workspace
CBStart # 2
CBEnd # 2

CursorDesiredState # 4
CursorStartOffset # 4
CursorEndOffset # 4
CursorCounter # 4
CursorSpeed # 4
Reg10Copy # 4

CursorFill # 4  ; Word to EOR cursor ; MUST be immediately before CursorNbit

CursorNbit # 4  ; Pointer to cursor code for current mode

DisplayStart # 4        ; Start address of screen (for display)
DriverBankAddr # 4      ; Default start address for VDU drivers
DisplayBankAddr # 4     ; Default start address for display
DisplayNColour # 4      ; No. of colours -1 for displayed mode
DisplayModeFlags # 4    ; ModeFlags for displayed mode
DisplayModeNo # 4       ; ModeNo for displayed mode
DisplayScreenStart # 4  ; Where VDU outputs to when outputting to screen

DisplayXWindLimit # 4   ; Used for pointer programming
DisplayYWindLimit # 4
DisplayXEigFactor # 4
DisplayYEigFactor # 4
697 698 699
DisplayLog2BPP # 1
PointerXEigFactor # 1
                  # 2
Neil Turton's avatar
Neil Turton committed
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718

Ecf1 # 8        ; The Ecf patterns
Ecf2 # 8
Ecf3 # 8
Ecf4 # 8

DotLineStyle # 8        ; Dot dash line pattern

ModeNo # 4      ; Current mode number

TFTint # 4      ; Text foreground tint          (in bits 6,7)
TBTint # 4      ; Text background tint
GFTint # 4      ; Graphics foreground tint
GBTint # 4      ; Graphics background tint

TotalScreenSize # 4     ; Amount configured for screen (in bytes)

MaxMode # 4             ; Maximum mode number allowed (20 for now)

Kevin Bracey's avatar
Kevin Bracey committed
719
ScreenEndAddr # 4       ; Logical address of screen (start of 2nd copy)
Neil Turton's avatar
Neil Turton committed
720 721 722 723 724 725 726 727 728

CursorFlags # 4 ; Silly Master cursor movement flags

CursorStack # 4 ; Bit stack of nested cursor states (0 => on, 1 => off)
                ; (bit 31 = TOS)

ECFShift # 4    ; number of bits to rotate right ECF OR and EOR masks by
ECFYOffset # 4  ; vertical offset to ECF index

729 730 731 732 733
        ASSERT  ECFShift =  Legacy_ECFShift
        ASSERT ?ECFShift = ?Legacy_ECFShift
        ASSERT  ECFYOffset =  Legacy_ECFYOffset
        ASSERT ?ECFYOffset = ?Legacy_ECFYOffset

Neil Turton's avatar
Neil Turton committed
734 735 736 737 738 739 740 741 742 743
WsVdu5 # 0      ; Vdu 5 workspace
WsScr # 4
WsEcfPtr # 4
; WsFontPtr # 4 ; not needed any more, kept in register
EndVerti # 4
StartMask # 4
EndMask # 4
FontOffset # 4
TempPlain # 16  ; only used for MODE 10

744
VIDCClockSpeed # 4      ; current VIDC clock speed in kHz (now always zero)
745

Neil Turton's avatar
Neil Turton committed
746 747
CurrentMonitorType # 4  ; initialised from configured one

Kevin Bracey's avatar
Kevin Bracey committed
748
PixelRate # 4   ; Pixel Rate in kHz
Neil Turton's avatar
Neil Turton committed
749

Ben Avison's avatar
Ben Avison committed
750 751 752 753 754
BorderL # 4             ; Size of border
BorderB # 4
BorderR # 4
BorderT # 4

Neil Turton's avatar
Neil Turton committed
755 756 757
GraphicWs # 300 ; All graphics workspace is overlaid here
EndGraphicWs # 0

Jeffrey Lee's avatar
Jeffrey Lee committed
758
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778
 ! 0,"16 ":CC::STR:@
 ]
        AlignSpace 16

GCharSizes  # 0
GCharSizeX  # 4         ; width of VDU 5 chars in pixels
GCharSizeY  # 4         ; height of VDU 5 chars in pixels

GCharSpacing # 0
GCharSpaceX  # 4        ; horizontal spacing between VDU 5 chars in pixels
GCharSpaceY  # 4        ; vertical   ------------------""-----------------

TCharSizes  # 0
TCharSizeX  # 4         ; width of VDU 4 chars in pixels
TCharSizeY  # 4         ; height of VDU 4 chars in pixels

TCharSpacing # 0
TCharSpaceX  # 4        ; horizontal spacing between VDU 4 chars in pixels
TCharSpaceY  # 4        ; vertical   ------------------""-----------------

779
HLineAddr      # 4      ; address of exported HLine
Neil Turton's avatar
Neil Turton committed
780 781
GcolOraEorAddr # 4      ; address of FgEcfOraEor etc

782 783 784 785
BlankPalAddr  # 4       ; address of block for blank palette
FirPalAddr    # 4       ; address of block for first flash state palette
SecPalAddr    # 4       ; address of block for second flash state palette

Jeffrey Lee's avatar
Jeffrey Lee committed
786 787
CurrentGraphicsVDriver # 4 ; Current driver number

788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804
PointerShapes      # 0
PointerShape1      # 4  ; pointers to defined shapes 1 to 4
PointerShape2      # 4
PointerShape3      # 4
PointerShape4      # 4
PointerShapesH     # 0
PointerShapeH1     # 4  ; pointers to holding shapes 1 and 2 (so updates never hit shape given to HAL)
PointerShapeH2     # 4

PointerShapeBlocks # 6*PointerBlkSize ; room for the 6 shape descriptors themselves

PointerShapeLA     # 4               ; logical address of current shape buffer (owned by HAL)
PointerShapeNumber # 1               ; includes bit 7 linkage flag
                   # 3               ; alignment padding
PointerX           # 4               ; co-ordinates of pointer (not always = mouse)
PointerY           # 4

805
 [ :DEF: ShowWS
806
  ! 0, "PointerShapes @ ":CC::STR:(PointerShapes)
807
 ]
808

Jeffrey Lee's avatar
Jeffrey Lee committed
809
GraphicsVFeatures  # 4               ; features word from current driver, refreshed each mode change
810
TrueVideoPhysAddr  # 4               ; VideoPhysAddr is a lie, use this instead
Jeffrey Lee's avatar
Jeffrey Lee committed
811 812 813
MaxGraphicsVDrivers * 8
GraphicsVDrivers # MaxGraphicsVDrivers*4 ; List of drivers
                # 4*4                ; SPARE (avoiding changes of exported addresses for now)
Neil Turton's avatar
Neil Turton committed
814 815 816 817 818 819 820 821 822 823 824 825

TextFgColour    # 4             ; Fg/Bg colour stored as a colour number, computed on VDU 18 and re-poked!
TextBgColour    # 4             ;

; In this brave new world there is a pointer to the text expansion
; buffer used for VDU 4 / 5 text plotting.

; This now lives in the system heap.

TextExpandArea # 4      ; Pointer to Text expand area (in system heap)
TextExpandArea_Size * (8*1024)

826
                 # 2*4   ; SPARE (avoiding changes of exported addresses for now)
Neil Turton's avatar
Neil Turton committed
827

828
ScreenBlankFlag # 1     ; 0 => unblanked, 1 => blanked
Neil Turton's avatar
Neil Turton committed
829

830 831
        ASSERT  ScreenBlankFlag =  Legacy_ScreenBlankFlag
        ASSERT ?ScreenBlankFlag = ?Legacy_ScreenBlankFlag
Neil Turton's avatar
Neil Turton committed
832

833 834 835 836
ScreenBlankDPMSState # 1       ; 0 => just blank video
                               ; 1 => blank to stand-by (hsync off)
                               ; 2 => blank to suspend (vsync off)
                               ; 3 => blank to off (H+V off)
837
                               ; 255 => no mode programmed yet
Neil Turton's avatar
Neil Turton committed
838

839 840
        ASSERT  ScreenBlankDPMSState =  Legacy_ScreenBlankDPMSState
        ASSERT ?ScreenBlankDPMSState = ?Legacy_ScreenBlankDPMSState
Neil Turton's avatar
Neil Turton committed
841 842


Jeffrey Lee's avatar
Jeffrey Lee committed
843
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
844 845 846 847
 ! 0,"64 ":CC::STR:@
 ]
        AlignSpace 64

848 849 850
FgEcfOraEor # 4*16      ; Interleaved zgora & zgeor
        ASSERT  FgEcfOraEor =  Legacy_FgEcfOraEor
        ASSERT ?FgEcfOraEor = ?Legacy_FgEcfOraEor
Neil Turton's avatar
Neil Turton committed
851

852 853 854
BgEcfOraEor # 4*16      ; Interleaved zgora & zgeor
        ASSERT  BgEcfOraEor =  Legacy_BgEcfOraEor
        ASSERT ?BgEcfOraEor = ?Legacy_BgEcfOraEor
Neil Turton's avatar
Neil Turton committed
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870

BgEcfStore  # 4*16      ; Interleaved zgora & zgeor to store background

;Current state of pattern
LineDotCnt # 4          ; Count down to restarting pattern
LineDotPatLSW # 4       ; Current state of pattern LSWord
LineDotPatMSW # 4       ;    "      "   "     "    MSWord

DotLineLength # 4       ; Dot Pattern repeat length as given in *FX163,242,n

BBCcompatibleECFs # 4   ; 0 => BBC compatible, 1 => native

SpAreaStart # 4         ; Start of sprite area
SpChooseName # 16       ; No comment says Richard
SpChoosePtr # 4

871 872 873 874 875 876 877 878 879 880 881
SWP_W # 1               ; Width & height of image to restore
SWP_H # 1
SWP_Callback # 1        ; Nonzero if palette update callback registered
SWP_Mutex # 1           ; Mutex to prevent re-entrancy
SWP_Restore # 1         ; Nonzero if restore needed in RestorePointer
SWP_Dirty # 1           ; Nonzero if need replot due to palette change
          # 2
SWP_Coords # 4          ; Coordinates of last plot
SWP_Pos # 4             ; Address to restore pixels to, 0 if not displayed
SWP_Under # 4           ; Pointer to copy of screen pixels from under the pointer
SWP_Palette # 3*4       ; Pointer colours converted to pixel values for current mode
Neil Turton's avatar
Neil Turton committed
882 883 884 885 886 887 888

TeletextOffset # 4      ; Offset to current teletext flash bank

TeletextCount # 4       ; Number of vsyncs till next teletext flash

WrchNbit # 4            ; Pointer to char code for current mode

889
CharWidth # 4           ; Width of a character in bytes (same as BytesPerChar except
890 891 892 893 894 895 896
                        ; in HiResTTX MODE 7, where characters are 16 pixels wide)
                        ; This could also be defined as (TCharSizeX<<Log2BPC)/8

TextOffset # 4          ; Byte offset into screen bank at which text window starts.
                        ; Keeps the text window centered when e.g. when mode 7 picks
                        ; a higher resolution mode than strictly necessary.

897 898 899 900 901 902 903 904 905 906 907 908 909 910 911
TTXFlags # 4            ; VDU 23,18 flags
TTXFlag_Suspend         * 1:SHL:0
TTXFlag_Conceal         * 1:SHL:1
TTXFlag_BlackEnable     * 1:SHL:2
TTXFlag_TransModeShift  * 3
TTXFlag_TransModeMask   * 3:SHL:TTXFlag_TransModeShift
                        ; bits 9-11 must be zero
TTXFlag_FgTransEOR      * 1:SHL:12
                        ; bits 13-15 must be zero
TTXFlag_BgTransEOR      * 1:SHL:16
                        ; bits 17-19 must be zero
TTXFlag_FgTransBIC      * 1:SHL:20
                        ; bits 21-23 must be zero
TTXFlag_BgTransBIC      * 1:SHL:24

Neil Turton's avatar
Neil Turton committed
912 913 914
BeepBlock # 8           ; OSWORD block for VDU 7

ScreenMemoryClaimed # 1 ; NZ => memory has been claimed or is unusable
Kevin Bracey's avatar
Kevin Bracey committed
915
ExternalFramestore # 1  ; NZ => using external framestore rather than screen memory DA
Neil Turton's avatar
Neil Turton committed
916

917
     AlignSpace
Neil Turton's avatar
Neil Turton committed
918

919 920 921 922
TTXDoubleCountsPtr # 4 ; Number of double height chars on each line
TTXMapPtr          # 4
TTXLineStartsPtr   # 4
TTXNewWorkspace    # 4 ; Temp variable to allow mode changes to fail gracefully if TTX workspace can't be allocated
Neil Turton's avatar
Neil Turton committed
923

Jeffrey Lee's avatar
Jeffrey Lee committed
924
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
925 926 927 928 929 930
 ! 0,"16 ":CC::STR:@
 ]
     AlignSpace 16      ; Align workspace to 16 bytes

RAMMaskTb # 32*4        ; Copy of MaskTb for this mode (up to 32 words)

Jeffrey Lee's avatar
Jeffrey Lee committed
931
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946
 ! 0,"16 ":CC::STR:@
 ]
     AlignSpace 16      ; Align workspace to 16 bytes

VduOutputCurrentState # 0 ; values of R0-R3 to return from SwitchOutputToSprite
                        ; or Mask; next 4 must be in this order
SpriteMaskSelect # 4    ; value of R0 to be given to SWI OS_SpriteOp to set up
                        ; current state
VduSpriteArea # 4       ; Pointer to sprite area containing VDU output sprite
                        ; (0 if output is to screen)
VduSprite # 4           ; Pointer to VDU output sprite (0 if output to screen)

VduSaveAreaPtr # 4      ; Pointer to save area for VDU variables


Jeffrey Lee's avatar
Jeffrey Lee committed
947
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963
 ! 0,"16,12 ":CC::STR:@
 ]
    AlignSpace 16, 12   ; Make ClipBoxCoords a valid immediate,
                        ; with ClipBoxEnable immediately before it
ClipBoxInfo # 0
ClipBoxEnable # 4       ; 0 => clip box disabled, 1 => enabled

ClipBoxCoords # 0       ; Internal coords of modified area of screen
ClipBoxLCol # 4
ClipBoxBRow # 4
ClipBoxRCol # 4
ClipBoxTRow # 4

FgPattern       # 4*8   ; foreground pattern as defined by OS_SetColour
BgPattern       # 4*8   ; background pattern as defined by OS_SetColour

964
                # 3*4   ; SPARE (avoiding changes of exported addresses for now)
Neil Turton's avatar
Neil Turton committed
965

Kevin Bracey's avatar
Kevin Bracey committed
966 967 968
KernelModeSelector # 4  ; pointer to block in system heap where
                        ; current mode selector is copied

Jeffrey Lee's avatar
Jeffrey Lee committed
969
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
970 971 972 973 974 975 976 977 978
 ! 0,"16 ":CC::STR:@
 ]
     AlignSpace 16      ; Align workspace to 16 bytes

TextExpand # 4*1024     ; Tim's massive text expansion table for whizzy WRCH
; TextPlain is now always hard against the end of TextExpand for this mode

TTXSoftFonts * TextExpand + 2*1024      ; Soft fonts in teletext mode

Jeffrey Lee's avatar
Jeffrey Lee committed
979
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
980 981 982 983
 ! 0,"64 ":CC::STR:@
 ]
     AlignSpace 64      ; Align workspace to 64 bytes

984
; Some infrequently used buffers which can be overlaid
Neil Turton's avatar
Neil Turton committed
985

986
LargeCommon     # SpriteAreaCBsize + SpriteCBsize + MaxSpritePaletteSize ; the largest area
Neil Turton's avatar
Neil Turton committed
987 988

ScrLoaSpriteCB  * LargeCommon   ; (size = SpriteCBsize + MaxSpritePaletteSize)
989
        ASSERT ?LargeCommon >= SpriteCBsize + MaxSpritePaletteSize
Neil Turton's avatar
Neil Turton committed
990 991
ScrSavCommon    * LargeCommon   ; (size = SpriteAreaCBsize + SpriteCBsize
                                ;  + MaxSpritePaletteSize)
992
        ASSERT ?LargeCommon >= SpriteAreaCBsize + SpriteCBsize + MaxSpritePaletteSize
993 994 995 996 997 998 999

VIDCList3BaseSize * VIDCList3_ControlList
VIDCList3Size * (VIDCList3BaseSize + ControlList_InvalidReason*8 + 4) ; primary params, up to 16 video control params, terminator

TempModeSelector * LargeCommon  ; (size = ModeSelector_MaxSize + VIDCList3Size)
        ASSERT ?LargeCommon >= ModeSelector_MaxSize + VIDCList3Size
TempVIDCList * TempModeSelector+ModeSelector_MaxSize
Neil Turton's avatar
Neil Turton committed
1000 1001 1002 1003

FldQueueSize    * ScratchSpaceSize
FldQueueStart   * ScratchSpace

Jeffrey Lee's avatar
Jeffrey Lee committed
1004
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
 ! 0,"64 ":CC::STR:@
 ]
     AlignSpace 64      ; Align workspace to 64 bytes

Font # &700             ; 7 pages of (soft) font

SaveAreaSize * 12*1024-@

VduSaveArea # SaveAreaSize      ; save area for switching output to sprites

VDWSSize # 0

                ASSERT  VDWSSize <= 12 * 1024

1019 1020 1021 1022 1023 1024 1025 1026
; IIC bus info block

               ^ 0
IICBus_Type    # 4 ; Bus type (HAL_IICType)
IICBus_Status  # 4 ; Bus status (HAL_IICMonitorTransfer)
IICBus_Device  # 4 ; Bus device (HAL_IICDevice)
IICBus_Size    # 0

Neil Turton's avatar
Neil Turton committed
1027 1028 1029 1030 1031
; *****************************************************************************
;                 Space in the first 32K is allocated below
; *****************************************************************************
; Real workspace definition

1032
; locations used during reset only. Not cleared by ClearWkspRAM, but
1033 1034
; cleared later (just before DEFHAN).

1035 1036 1037
; Note that these are all relative to ZeroPage!

                ^       &80             ; steer clear of FIQ code
1038
InitWsStart     #       0
Kevin Bracey's avatar
Kevin Bracey committed
1039 1040
InitIRQHandler  #       4               ; pointer to IRQ handler (LDR PC'ed from IRQ HW vector)
InitIRQWs       #       16              ; workspace for IRQ handler
1041 1042
InitUsedStart   #       4               ; start of used pages (L2PT etc) not to be cleared (32bit address)
InitUsedEnd     #       4               ; end of used pages (page units)
1043
InitUsedBlock   #       4               ; current block in PhysRamTable
1044
InitClearRamWs  #       10*4            ; preserve registers during ClearPhysRAM
1045 1046
InitDMABlock    #       8               ; block of DMAable memory extracted from PhysRamTable
InitDMAOffset   #       4               ; offset+8 into PhysRamTable where memory was taken
1047
InitDMAEnd      #       4               ; current DMA alloc pos (32bit address)
1048 1049 1050
                AlignSpace 32           ; because we clear 32 at a time
InitWsEnd       #       0

Neil Turton's avatar
Neil Turton committed
1051 1052
; Basic kernel space - defined locations for external modules

1053
                       ^       &100
Neil Turton's avatar
Neil Turton committed
1054 1055
IRQ1V                  #       4       ; &100

1056 1057 1058
ESC_Status             #       1       ; &104
        ASSERT  ESC_Status =  Legacy_ESC_Status
        ASSERT ?ESC_Status = ?Legacy_ESC_Status
Neil Turton's avatar
Neil Turton committed
1059

1060 1061 1062
LatchBSoftCopy         #       1       ; &105
        ASSERT  LatchBSoftCopy =  Legacy_LatchBSoftCopy
        ASSERT ?LatchBSoftCopy = ?Legacy_LatchBSoftCopy
Neil Turton's avatar
Neil Turton committed
1063 1064 1065

IOCControlSoftCopy     #       1       ; &106

1066 1067 1068
CannotReset            #       1       ; &107
        ASSERT  CannotReset =  Legacy_CannotReset
        ASSERT ?CannotReset = ?Legacy_CannotReset
Neil Turton's avatar
Neil Turton committed
1069

1070 1071 1072
IRQsema                #       4       ; &108
        ASSERT  IRQsema =  Legacy_IRQsema
        ASSERT ?IRQsema = ?Legacy_IRQsema
Neil Turton's avatar
Neil Turton committed
1073 1074

MetroGnome             #       4       ; &10C
1075 1076 1077
        ASSERT  MetroGnome =  Legacy_MetroGnome
        ASSERT ?MetroGnome = ?Legacy_MetroGnome

Neil Turton's avatar
Neil Turton committed
1078 1079
MemorySpeed            #       4       ; &110

1080 1081 1082
MEMC_CR_SoftCopy       #      4       ; &114
        ASSERT  MEMC_CR_SoftCopy =  Legacy_MEMC_CR_SoftCopy
        ASSERT ?MEMC_CR_SoftCopy = ?Legacy_MEMC_CR_SoftCopy
Neil Turton's avatar
Neil Turton committed
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119

ResetIndirection        #      4       ; &118

; Now all internal definitions

; Up to here is initialized on reset

; Next come handler variables

MemLimit        #       4
UndHan          #       4
PAbHan          #       4
DAbHan          #       4
AdXHan          #       4

ErrHan          #       4
ErrBuf          #       4
ErrHan_ws       #       4

CallAd_ws       #       4     ; smart Rs ordering:
CallAd          #       4     ; can do LDMIA of r12, pc
CallBf          #       4

BrkAd_ws        #       4
BrkAd           #       4
BrkBf           #       4

EscHan_ws       #       4
EscHan          #       4

EvtHan_ws       #       4
EvtHan          #       4

; The next lot of workspace is in the space vacated by the small soft CAM map area
; (256 words) which is no longer adequate, so we can reuse it

JordanWS        #       0
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129

Serv_SysChains          # 4          ;anchor for block handling 'system' service numbers, in range 1 to 255
Serv_UsrChains          # 4          ;anchor for block handling 'user' service numbers, > 255
Serv_AwkwardChain       # 4          ;anchor for chain handling non-compliant modules (no service table)
 [ :DEF: ShowWS
      ! 0, "Serv_SysChains        at ":CC::STR:(Serv_SysChains)
      ! 0, "Serv_UsrChains        at ":CC::STR:(Serv_UsrChains)
      ! 0, "Serv_AwkwardChain     at ":CC::STR:(Serv_AwkwardChain)
 ]

Neil Turton's avatar
Neil Turton committed
1130 1131
DAList          #       4       ; Pointer to first node on dynamic area list

Neil Turton's avatar
Neil Turton committed
1132 1133 1134

                AlignSpace 16
AMBControl_ws   #       4       ; workspace anchor word for AMBControl
1135
DynArea_ws      #       4       ; workspace anchor word for data structures to accelerate OS SWIs for dynamic areas
1136
 [ :DEF: ShowWS
1137 1138
 ! 0, "AMBControl_ws         at ":CC::STR:(AMBControl_ws)
 ! 0, "DynArea_ws            at ":CC::STR:(DynArea_ws)
1139
 ]
1140

1141 1142
Oscli_CmdHashSum        # 4          ;for hashed command lookup
Oscli_CmdHashLists      # 4          ;anchor for hashed command lists structure
1143
 [ :DEF: ShowWS
1144 1145
      ! 0, "Oscli_CmdHashSum      at ":CC::STR:(Oscli_CmdHashSum)
      ! 0, "Oscli_CmdHashLists    at ":CC::STR:(Oscli_CmdHashLists)
1146
 ]
1147

Neil Turton's avatar
Neil Turton committed
1148

1149
                AlignSpace 16   ; skipped bit must start on 16-byte boundary (ClearPhysRAM does 4 words at a time for skipped areas)
Neil Turton's avatar
Neil Turton committed
1150
SkippedTables   #       0
1151

1152
PhysRamTable    #       0       ; Pairs of words (physaddr, size+flags)
1153 1154 1155 1156 1157
                                ; indicating RAM present in machine. physaddr
                                ; is in units of pages. size is in bytes, with
                                ; the flags in the low 12 bits. Individual
                                ; entries don't cross 4GB barriers. Unused
                                ; entries have size+flags of zero.
Neil Turton's avatar
Neil Turton committed
1158
VideoPhysAddr   #       4       ; Address of video RAM (in the case of DRAM-only machines,
1159 1160 1161 1162
VideoSizeFlags  #       4       ; this is actually a chunk out of DRAM)
DRAMPhysAddrA   #       4       ; Next the DRAM
DRAMSizeFlagsA  #       4
                #       8 * 16  ; Space for 17 DRAM banks + 1 VRAM bank total
Neil Turton's avatar
Neil Turton committed
1163
PhysRamTableEnd #       0
1164 1165
DRAMPhysTableSize *     (PhysRamTableEnd-DRAMPhysAddrA) / 8

1166
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1167
 ! 0, "VideoPhysAddr held at  ":CC::STR:(VideoPhysAddr)
1168
 ]
Neil Turton's avatar
Neil Turton committed
1169

Jeffrey Lee's avatar
Jeffrey Lee committed
1170
LxPTUsed        #       4       ; Amount of memory used for L2PT (short desc) or L3PT (long desc)
Neil Turton's avatar
Neil Turton committed
1171 1172
SoftCamMapSize  #       4       ; Amount of memory (in bytes) used for soft CAM map
                                ; (whole number of pages)
1173

1174
                AlignSpace
1175
HAL_StartFlags  #       4
1176 1177
HAL_Descriptor  #       4
HAL_Workspace   #       4
1178
HAL_WsSize      #       4
1179

1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193
ICache_Info              #  0
ICache_NSets             #  4
ICache_Size              #  4
ICache_LineLen           #  1
ICache_Associativity     #  1

Cache_Type               #  1
Cache_Flags              #  1

DCache_Info              #  0
DCache_NSets             #  4
DCache_Size              #  4
DCache_LineLen           #  1
DCache_Associativity     #  1
1194 1195 1196

ProcessorArch            #  1
ProcessorType            #  1   ; Processor type (handles 600 series onwards)
1197 1198 1199 1200 1201 1202

DCache_CleanBaseAddress  #  0   ; word used either for IndexBit or CleanBaseAddress
DCache_IndexBit          #  4
DCache_CleanNextAddress  #  0   ; word used either for IndexSegStart or CleanNextAddress
DCache_IndexSegStart     #  4
DCache_RangeThreshold    #  4
1203 1204 1205 1206 1207 1208
                AlignSpace
ProcessorFlags           #  4    ; Processor flags (IMB, Arch4 etc)
 [ :DEF: ShowWS
 ! 0, "ProcessorType  at  ":CC::STR:(ProcessorType)
 ! 0, "ProcessorFlags at  ":CC::STR:(ProcessorFlags)
 ]
Jeffrey Lee's avatar
Jeffrey Lee committed
1209 1210 1211
        ; Allow use by C code
        EXPORT  g_ProcessorFlags
g_ProcessorFlags * ZeroPage+ProcessorFlags
1212 1213 1214

                AlignSpace

1215
MMU_PPLTrans             #  4
Kevin Bracey's avatar
Kevin Bracey committed
1216
MMU_PCBTrans             #  4
1217
MMU_PPLAccess            #  4
Kevin Bracey's avatar
Kevin Bracey committed
1218

1219
Proc_Cache_CleanInvalidateAll     #       4
Jeffrey Lee's avatar
Jeffrey Lee committed
1220
Proc_Cache_CleanInvalidateRange   #       4
1221
Proc_Cache_CleanAll               #       4
1222
Proc_Cache_CleanRange             #       4
1223
Proc_Cache_InvalidateAll          #       4
1224
Proc_Cache_InvalidateRange        #       4
1225
Proc_Cache_RangeThreshold         #       4
1226
Proc_Cache_Examine                #       4
1227 1228
Proc_ICache_InvalidateAll         #       4
Proc_ICache_InvalidateRange       #       4
1229 1230
Proc_TLB_InvalidateAll            #       4
Proc_TLB_InvalidateEntry          #       4
1231 1232 1233 1234 1235 1236
Proc_DSB_ReadWrite                #       4
Proc_DSB_Write                    #       4
Proc_DSB_Read                     #       4
Proc_DMB_ReadWrite                #       4
Proc_DMB_Write                    #       4
Proc_DMB_Read                     #       4
1237 1238
Proc_IMB_Full                     #       4
Proc_IMB_Range                    #       4
1239
Proc_IMB_List                     #       4
1240 1241 1242 1243 1244 1245
Proc_MMU_Changing                 #       4
Proc_MMU_ChangingEntry            #       4
Proc_MMU_ChangingUncached         #       4
Proc_MMU_ChangingUncachedEntry    #       4
Proc_MMU_ChangingEntries          #       4
Proc_MMU_ChangingUncachedEntries  #       4
1246

1247
Cache_Lx_Info                     #       4       ; Cache level ID register
1248 1249 1250
Cache_Lx_MaxLevel                 *       2       ; Current machines have max of 2 cache levels
Cache_Lx_DTable                   #       4*Cache_Lx_MaxLevel ; Data/unified cache layout for all supported levels
Cache_Lx_ITable                   #       4*Cache_Lx_MaxLevel ; Instruction cache layout for all supported levels
1251
Cache_HALDevice                   #       4       ; Pointer to any HAL cache device we're using
Neil Turton's avatar
Neil Turton committed
1252 1253


1254 1255
IOAllocPtr      #       4               ; current lowpoint of mapped I/O space (also upper limit on DAs)
IOAllocLimit    #       4               ; current lowest allowed I/O space (DA creation may move this up)
Jeffrey Lee's avatar
Jeffrey Lee committed
1256
IOAllocTop      #       4               ; high end of I/O space
1257

1258 1259
PhysIllegalMask #       4               ; mask of invalid bits in upper word of physical addresses

Neil Turton's avatar
Neil Turton committed
1260

1261
  [ :DEF: ShowWS
1262
        ! 0, "Free space before DebuggerSpace = ":CC::STR:(&300-@)
1263
 ]
1264

1265 1266
        ASSERT  @ <= &300
                        #       (&300-@)
1267
 [ :LNOT: HiProcVecs
1268 1269 1270 1271
; Note that this is currently located within the skipped region, even though it
; doesn't need to be. It was just an easy way of adding the IIC bus info to the
; region. The debugger will initialise DebuggerSpace on startup, so it doesn't
; matter that it doesn't get cleared during the main RAM clear.
1272 1273 1274 1275 1276 1277 1278 1279
DebuggerSpace           #       16*8    ; Debugger module needs some zero page
DebuggerSpace_Size      *       ?DebuggerSpace

        ASSERT  DebuggerSpace =  Legacy_DebuggerSpace
        ASSERT ?DebuggerSpace = ?Legacy_DebuggerSpace
 |
DebuggerSpace           *       &2000   ; Debugger gets a page all to itself!
DebuggerSpace_Size      *       &1000
1280 1281 1282 1283 1284

   [ CompatibilityPage
CompatibilityPageEnabled #      1       ; 0 or 1 as appropriate
   ]
                AlignSpace
1285
 ]
Kevin Bracey's avatar
Kevin Bracey committed
1286

1287
IICBus_Count       *    5 ; 5 buses is enough for all current machines
1288 1289
IICBus_Base        #    IICBus_Size*IICBus_Count

1290 1291
PageTable_PageFlags #   4               ; Page flags used for page tables. L2PT uses this directly, L1PT adds in PageFlags_Unavailable.

1292
                AlignSpace 16   ; skipped bit must end on 16-byte boundary (ClearPhysRAM does 4 words at a time for skipped areas)
1293 1294
SkippedTablesEnd #      0

Dan Ellis's avatar
Dan Ellis committed
1295
; NVRAM support
Kevin Bracey's avatar
Kevin Bracey committed
1296

Kevin Bracey's avatar
Kevin Bracey committed
1297 1298
NVRamSize          #    1               ; Size of NVRam (E2ROM & CMOS) fitted in 256byte units
NVRamBase          #    1               ; Base of NVRam
1299
NVRamSpeed         #    1               ; Clock hold time in 0.5us units
Kevin Bracey's avatar
Kevin Bracey committed
1300 1301
NVRamPageSize      #    1               ; Page size for writing (log2)
NVRamWriteSize     #    1               ; Size of writable region (256byte units)
Kevin Bracey's avatar
Kevin Bracey committed
1302

Kevin Bracey's avatar
Kevin Bracey committed
1303 1304
                   AlignSpace

Kevin Bracey's avatar
Kevin Bracey committed
1305

Kevin Bracey's avatar
Kevin Bracey committed
1306 1307 1308 1309
AppSpaceDANode     #    DANode_NodeSize ; Dummy area node for application space (not on list)
FreePoolDANode     #    DANode_NodeSize ; Area node for free pool
SysHeapDANode      #    DANode_NodeSize ; Area node for system heap
CDASemaphore       #    4               ; Semaphore for OS_ChangeDynamicArea - non-zero => routine threaded
1310
MMUControlSoftCopy #    4               ; Soft copy of ARM control register
1311
IRQMax             #    4               ; from HAL_IRQMax
Ben Avison's avatar
Ben Avison committed
1312 1313
DeviceCount     #       4       ; size of our table of devices in the system heap
DeviceTable     #       4       ; pointer to table
1314

1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327
ProcVec_Start           #       0       ; Start of processor vector table
ProcVec_Branch0         #       4       ; Branch through zero
ProcVec_UndInst         #       4       ; Undefined instruction vector
ProcVec_SWI             #       4       ; SWI vector
ProcVec_PrefAb          #       4       ; Prefetch abort vector
ProcVec_DataAb          #       4       ; Data abort vector
ProcVec_AddrEx          #       4       ; not used (was Address exception vector on 26-bit-only ARMs)
ProcVec_IRQ             #       4       ; IRQ vector
ProcVec_End             #       0

ProcVecPreVeneersSize   *       4*4     ; Space for preveneers for loading handler addresses from 0 page.
ProcVecPreVeneers       #       ProcVecPreVeneersSize

1328
AplWorkSize * AppSpaceDANode + DANode_Size
1329
SoftAplWorkMaxSize * AppSpaceDANode + DANode_MaxSize
1330

1331 1332
ExtendedROMFooter # 4 ; Pointer to the extended ROM footer structure. 0 if not initialised, -1 if not found.

1333
CPUFeatures # 3*4
1334

1335
 [ :DEF: ShowWS
1336
        ! 0, "Free space after EnvString = ":CC::STR:(&500-@)
1337
 ]
Kevin Bracey's avatar
Kevin Bracey committed
1338

Neil Turton's avatar
Neil Turton committed
1339 1340 1341 1342 1343
        ASSERT  @ <= &500               ; a convenient address to remember
                #       (&500-@)

CamMapCorruptDebugBlock #       &40     ; somewhere to dump registers in case of emergency

1344 1345 1346 1347 1348
MaxCamEntry32   #       4       ; maximum index into the cam map which has a
                                ; 32bit physical address, for easy detection by
                                ; page number (all RAM banks with 32bit
                                ; addresses come first)

1349
 [ :DEF: ShowWS
1350
        ! 0, "Free space after CamMap debug block = ":CC::STR:((JordanWS+256*4)-@)
1351
 ]
Kevin Bracey's avatar
Kevin Bracey committed
1352

Neil Turton's avatar
Neil Turton committed
1353 1354 1355 1356 1357 1358 1359 1360 1361
        ASSERT  @ <= JordanWS+256*4
                #       (JordanWS+256*4-@)  ; pad out to original size

CamEntriesPointer #     4       ; points to where CAM soft copy is

MaxCamEntry     #       4       ; maximum index into the cam map, ie
                                ; 511 for 16MByte machines, 383 for 12MBytes
                                ; 255 for 8MBytes, otherwise 127

1362
RAMLIMIT        #       4       ; Number of pages of RAM
Neil Turton's avatar
Neil Turton committed
1363

1364
ROMPhysAddr     #       4
Neil Turton's avatar
Neil Turton committed
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376

HiServ_ws       #       4
HiServ          #       4
SExitA          #       4
SExitA_ws       #       4
UpCallHan_ws    #       4
UpCallHan       #       4

ROMModuleChain  #       4               ; pointer to head of ROM module chain

; now a section that it's handy to have in simply loadable places

Jeffrey Lee's avatar
Jeffrey Lee committed
1377
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1378 1379 1380 1381 1382 1383
 ! 0,"16 ":CC::STR:@
 ]
             AlignSpace 16

KeyWorkSpaceSize   *  &200
KeyWorkSpace       #  KeyWorkSpaceSize
1384
 [ :DEF: ShowWS
1385
      ! 0, "KeyWorkSpace          at ":CC::STR:(KeyWorkSpace)
1386
 ]
Neil Turton's avatar
Neil Turton committed
1387 1388 1389 1390 1391 1392 1393 1394 1395

; The following were reordered on 26-Jul-91. Old ordering was:
; GeneralMOSBuffer
; ModuleSWI_HashTab
; Module_List
; Curr_Active_Object
; VecPtrTab
; ExceptionDump

1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407
; SWI hash table moved to OldIRQ1Vspace on 12-Nov-97, for Ursula (wider hashing)
;
; !!!! Free Space
;
  [ ChocolateSysHeap
ChocolateBlockArrays  #  0
ChocolateCBBlocks     #  4            ; -> array of quick access blocks for Callback
ChocolateSVBlocks     #  4            ; -> array of quick access blocks for software vectors
ChocolateTKBlocks     #  4            ; -> array of quick access blocks for tickers
ChocolateMRBlocks     #  4            ; -> array of blocks for ROM module nodes (reduces no. of individual blocks in heap)
ChocolateMABlocks     #  4            ; -> array of blocks for active module nodes (reduces no. of individual blocks in heap)
ChocolateMSBlocks     #  4            ; -> array of blocks for module SWI hash nodes (reduces no. of individual blocks in heap)
1408
 [ :DEF: ShowWS
1409 1410 1411 1412 1413 1414
      ! 0, "ChocolateCBBlocks     at ":CC::STR:(ChocolateCBBlocks)
      ! 0, "ChocolateSVBlocks     at ":CC::STR:(ChocolateSVBlocks)
      ! 0, "ChocolateTKBlocks     at ":CC::STR:(ChocolateTKBlocks)
      ! 0, "ChocolateMRBlocks     at ":CC::STR:(ChocolateMRBlocks)
      ! 0, "ChocolateMABlocks     at ":CC::STR:(ChocolateMABlocks)
      ! 0, "ChocolateMSBlocks     at ":CC::STR:(ChocolateMSBlocks)
1415
 ]
1416

1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427
; !!!! Free Space (40 bytes)
OldSWIHashspace    #  10*4
  |
; !!!! Free Space (64 bytes)
OldSWIHashspace    #  16*4
  ]

;
;was:
;ModuleSHT_Entries  *  16
;ModuleSWI_HashTab  #  4*ModuleSHT_Entries
Neil Turton's avatar
Neil Turton committed
1428 1429

Module_List        #  4
1430
 [ :DEF: ShowWS
1431
      ! 0, "Module_List           at ":CC::STR:(Module_List)
1432
 ]
1433

Neil Turton's avatar
Neil Turton committed
1434 1435 1436 1437 1438 1439 1440 1441
Curr_Active_Object #  4

; Vector Claim & Release tables etc

VecPtrTab          #  NVECTORS * 4

ExceptionDump      #  4

1442
 # 68                       ; spare
Neil Turton's avatar
Neil Turton committed
1443

Jeffrey Lee's avatar
Jeffrey Lee committed
1444
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467
 ! 0,"16 ":CC::STR:@
 ]
            AlignSpace  16 ; Ensures we can MOV rn, #OsbyteVars if <=&1000

OsbyteVars      #       OSBYTEVarSize
 ASSERT OsbyteVars < &10000 ; Must keep in first 64K so address can be read by
                            ; (and stored in) OS_Bytes &A6,&A7. SKS

; These must be in first 4K
NBuffers        *       10
BuffInPtrs      #       4 * NBuffers
BuffOutPtrs     #       4 * NBuffers

VariableList    #       4

; Oscli stuff
OscliCBtopUID   #       4
OscliCBbotUID   #       4
OscliCBcurrend  #       4

ReturnCode      #       4
RCLimit         #       4

Kevin Bracey's avatar
Kevin Bracey committed
1468
SpriteSize      #       4       ; saved on startup for Sprite code
Neil Turton's avatar
Neil Turton committed
1469 1470 1471

TickNodeChain   #       4

Kevin Bracey's avatar
Kevin Bracey committed
1472 1473 1474
PIRQ_Chain      #       4
PFIQasIRQ_Chain #       4

Neil Turton's avatar
Neil Turton committed
1475 1476 1477 1478
; Workspace

EnvTime            #    5

1479 1480 1481
RedirectInHandle   #    1
        ASSERT  RedirectInHandle =  Legacy_RedirectInHandle
        ASSERT ?RedirectInHandle = ?Legacy_RedirectInHandle
Neil Turton's avatar
Neil Turton committed
1482

1483 1484 1485
RedirectOutHandle  #    1
        ASSERT  RedirectOutHandle =  Legacy_RedirectOutHandle
        ASSERT ?RedirectOutHandle = ?Legacy_RedirectOutHandle
Neil Turton's avatar
Neil Turton committed
1486 1487 1488 1489 1490

MOShasFIQ          #    1
FIQclaim_interlock #    1
CallBack_Flag      #    1
IRQ_CallBack_Flag * CallBack_Flag
Robert Sprowson's avatar
Robert Sprowson committed
1491 1492
MonitorLeadType    #    1       ; some function of the monitor lead inputs, as yet undetermined
MentionCMOSReset   #    1       ; non zero reports CMOS resets prior to the start banner
Neil Turton's avatar
Neil Turton committed
1493

Kevin Bracey's avatar
Kevin Bracey committed
1494
                AlignSpace
Neil Turton's avatar
Neil Turton committed
1495

Kevin Bracey's avatar
Kevin Bracey committed
1496
DUMPER          #       17 * 4  ; now 17 words for 32-bit
Neil Turton's avatar
Neil Turton committed
1497

Kevin Bracey's avatar
Kevin Bracey committed
1498 1499
                #       4       ; PxxxIRQ_Chain used to be here
Page_Size       #       4
Kevin Bracey's avatar
Kevin Bracey committed
1500
CMOSRAMCache    #       256
Neil Turton's avatar
Neil Turton committed
1501

1502 1503 1504 1505 1506 1507 1508 1509
; Was Free space (752 bytes) left by old IRQ despatch (new IRQ despatch moved as it required more space).
; Re-used for various purposes on 12-Nov-97, for Ursula
;
      ASSERT @ = &C34                            ;if fails, may need to rearrange padding to sort hash table alignment
;
ModuleSHT_Entries  *  128
ModuleSHT_Padding0 #  12                         ;spare, so that SWI hashtable is aligned for easy immediate address load
ModuleSWI_HashTab  #  4*ModuleSHT_Entries
1510
 [ :DEF: ShowWS
1511
      ! 0, "ModuleSWI_HashTab     at ":CC::STR:(ModuleSWI_HashTab)
1512
 ]
1513 1514
;
SysVars_StickyPointers # (10+1)*4                ;used if ChocolateSysVars is TRUE (1 dummy pointer for 0 size)
1515
 [ :DEF: ShowWS
1516
      ! 0, "SysVars_StickyPtrs    at ":CC::STR:(SysVars_StickyPointers)
1517
 ]
1518
;
Jeffrey Lee's avatar
Jeffrey Lee committed
1519 1520
Abort32_dumparea   # 3*4          ;info for OS_ReadSysInfo 7 - 32-bit PC, 32-bit PSR, fault address
                   # 12           ; Spare
1521
 [ :DEF: ShowWS
1522
      ! 0, "Abort32_dumparea      at ":CC::STR:(Abort32_dumparea)
1523
 ]
1524 1525 1526
;
Help_guard         # 4            ;for *help, guard against foreground re-entrancy (multiple taskwindows)
Help_msgdescr      # 4*4          ;for *help, 4 words MessageTrans descriptor
1527
 [ :DEF: ShowWS
1528
      ! 0, "Help_guard            at ":CC::STR:(Help_guard)
1529
 ]
1530 1531
;
PCI_status         # 4            ;bit 0 = 1 if PCI exists or 0 if PCI does not exist, bits 1..31 reserved (0)
1532
 [ :DEF: ShowWS
1533
      ! 0, "PCI_status            at ":CC::STR:(PCI_status)
1534
 ]
1535 1536 1537 1538
IOMD_NoInterrupt          # 4     ;no. of irq devices for extant IOMD
IOMD_DefaultIRQ1Vcode     # 4     ;default irq code start address (ROM) for extant IOMD
IOMD_DefaultIRQ1Vcode_end # 4     ;default irq code end address (ROM)
IOMD_Devices              # 4     ;default irq devices table address (ROM)
1539
 [ :DEF: ShowWS
1540
      ! 0, "IOMD_NoInterrupt      at ":CC::STR:(IOMD_NoInterrupt)
1541
 ]
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556
;
  [ mjsSysHeapNodesTrace
mjsSHNodesTrace_ws # 0
mjsSHNT_hcl_total  # 4    ;total calls to ClaimSysHeapNode
mjsSHNT_hfr_total  # 4    ;total calls to FreeSysHeapNode
mjsSHNT_hop_total  # 4    ;total calls to DoSysHeapOpWithExpansion
mjsSHNT_ohc_total  # 4    ;total calls to OS_Heap for SysHeap claim
mjsSHNT_ohf_total  # 4    ;total calls to OS_Heap for SysHeap free
mjsSHNT_ohx_total  # 4    ;total calls to OS_Heap for SysHeap expand or shrink
mjsSHNT_vcs_total  # 4    ;total SysVar ClaimVNode calls that picked up a sticky node
mjsSHNT_vch_total  # 4    ;total SysVar ClaimVNode calls that went to the heap for a node
mjsSHNT_vxs_total  # 4    ;total SysVar ExpandOrShrinkVNode calls that tried to do sticky change
mjsSHNT_vxh_total  # 4    ;total SysVar ExpandOrShrinkVNode calls that went to the heap
mjsSHNT_vfs_total  # 4    ;total SysVar FreeVNode calls that stuck
mjsSHNT_vfh_total  # 4    ;total SysVar FreeVNode calls that dropped a node to the heap
1557
 [ :DEF: ShowWS
1558 1559 1560 1561
      ! 0, ""
      ! 0, "**WARNING** compiling in code to trace some SysHeap node statistics (mjsSysHeapNodesTrace TRUE)"
      ! 0, ""
      ! 0, "mjsSHNodesTrace_ws    at ":CC::STR:(mjsSHNodesTrace_ws)
1562
 ]
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572
ModuleSHT_Padding1 #  752-12-4*ModuleSHT_Entries-11*4-6*4-5*4-4-4*4-12*4 ;spare
  |
ModuleSHT_Padding1 #  752-12-4*ModuleSHT_Entries-11*4-6*4-5*4-4-4*4      ;spare
  ]
;
      ASSERT @ = &C34 + 752
;
;was:
;OldIRQ1Vspace       # 752

Neil Turton's avatar
Neil Turton committed
1573 1574 1575 1576 1577 1578 1579 1580 1581 1582

CallBack_Vector   #  4

; interruptible heap manager workspace

HeapSavedReg_R0     # 4
HeapSavedReg_R1     # 4
HeapSavedReg_R2     # 4
HeapSavedReg_R3     # 4
HeapSavedReg_R4     # 4
1583
HeapSavedReg_R5     # 4
Neil Turton's avatar
Neil Turton committed
1584 1585 1586 1587 1588 1589
HeapSavedReg_R13    # 4
HeapReturnedReg_R0  # 4
HeapReturnedReg_R1  # 4
HeapReturnedReg_R2  # 4
HeapReturnedReg_R3  # 4
HeapReturnedReg_R4  # 4
1590
HeapReturnedReg_R5  # 4
Neil Turton's avatar
Neil Turton committed
1591
HeapReturnedReg_R13 # 4
Kevin Bracey's avatar
Kevin Bracey committed
1592
HeapReturnedReg_PSR # 4                 ; also acts as interlock
Neil Turton's avatar
Neil Turton committed
1593 1594 1595 1596 1597

RawMachineID        #  8                ; 64 bits for unique machine ID
KernelMessagesBlock #  20               ; 5 Words for messagetrans message block.
ErrorSemaphore      #  1                ; Error semaphore to avoid looping on error translation.
PortableFlags       #  1                ;
Jeffrey Lee's avatar
Jeffrey Lee committed
1598
PowerSave * &80                         ; Gets set in PortableFlags when we've switched to slow speed
Neil Turton's avatar
Neil Turton committed
1599 1600 1601 1602 1603 1604

        AlignSpace

MOSConvertBuffer    #  12               ; Enough romm for 8 hex digits.
PreVeneerRegDump    #  17*4             ; room for r0-r15, spsr

1605 1606 1607 1608
 [ CacheCommonErrors
CachedErrorBlocks   #  4                ; pointer to sysheap node holding the error block cache
 ]

1609 1610 1611 1612
PrinterBufferAddr   #  4                ; holds address of printer buffer
PrinterBufferSize   #  4                ; size of printer buffer - not to be confused with PrintBuffSize
                                        ; which is the (constant) default size for the MOS's smallish buffer

Jeffrey Lee's avatar
Jeffrey Lee committed
1613
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1614 1615 1616 1617 1618 1619 1620 1621 1622
 ! 0, "low space free ":CC::STR:(&FE8-@)
 ]
 ASSERT @ < &FE8

; Words for old tools of assorted varieties
; Don't move the following as their positions are assumed by other modules

                        ^       &FE8
CLibCounter             #       1               ; Counter for Shared C Library tmpnam function
1623 1624
        ASSERT  CLibCounter =  Legacy_CLibCounter
        ASSERT ?CLibCounter = ?Legacy_CLibCounter
Neil Turton's avatar
Neil Turton committed
1625 1626 1627 1628 1629 1630 1631 1632 1633

        AlignSpace

; ECN 17-Feb-92
; Added RISCOSLibWord and CLibWord. The ROM RISCOSLib and CLib must continue
; to work even when they are killed since ROM apps are hard linked to the
; ROM libraries. They cannot use the private word since the block pointed
; to by this will be freed.
RISCOSLibWord           #       4
1634 1635 1636
        ASSERT  RISCOSLibWord =  Legacy_RISCOSLibWord
        ASSERT ?RISCOSLibWord = ?Legacy_RISCOSLibWord

Neil Turton's avatar
Neil Turton committed
1637
CLibWord                #       4
1638 1639 1640
        ASSERT  CLibWord =  Legacy_CLibWord
        ASSERT ?CLibWord = ?Legacy_CLibWord

Neil Turton's avatar
Neil Turton committed
1641
FPEAnchor               #       4
1642 1643
        ASSERT  FPEAnchor =  Legacy_FPEAnchor
        ASSERT ?FPEAnchor = ?Legacy_FPEAnchor
Neil Turton's avatar
Neil Turton committed
1644

1645 1646 1647
DomainId                #       4       ; SKS added for domain identification
        ASSERT  DomainId =  Legacy_DomainId
        ASSERT ?DomainId = ?Legacy_DomainId
Neil Turton's avatar
Neil Turton committed
1648 1649 1650

Modula2_Private         #       4       ; MICK has FFC and uses it it in USR mode

1651 1652 1653
VduDriverWorkSpace      #       VDWSSize
        ASSERT  VduDriverWorkSpace =  Legacy_VduDriverWorkSpace
        ASSERT ?VduDriverWorkSpace = ?Legacy_VduDriverWorkSpace
Neil Turton's avatar
Neil Turton committed
1654 1655 1656 1657

 ASSERT (VduDriverWorkSpace :AND: 63) = 0 ; For Tim (VDU5)


Jeffrey Lee's avatar
Jeffrey Lee committed
1658
 [ :DEF: ShowWS
Neil Turton's avatar
Neil Turton committed
1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696
 ! 0, "high space free ":CC::STR:(&4000-@)
 ]

                        ^       &4000
ScratchSpaceSize        *       &4000

Export_ScratchSpace            #       ScratchSpaceSize
        ASSERT  Export_ScratchSpace =  ScratchSpace
        ASSERT ?Export_ScratchSpace = ?ScratchSpace

 ASSERT @ <= &8000 ; Start of apl

; *****************************************************************************
; Users of ScratchSpace declare yourself here:

; NRaine: Filling a polygon uses ScratchSpace to flatten the path

; DSeal: Draw module uses ScratchSpace on fill operations (this supercedes
;   NRaine's declaration above).

; SKS: HeapSort with (r1 & 0x80000000) & ~(r1 & 0x20000000) & (r5 <= 16K)
;      uses ScratchSpace as a temp slot for data shuffling after sorting

; TMD: Flood fill uses ScratchSpace for the flood queue.

; Tidying the RMA uses ScratchSpace while all modules are dead

; LVR: ADFS uses scratch space to format floppies on 1772 based machines

; DDV: ColourTrans uses scratch space to build palette tables when in
;      ColourTrans_SelecTable/RetrunColourNumber and also whilst generating
;      stipple pattterns.

                        ^       0
GSNameBuff              #       &100
GS_Stack                #       &200
GS_StackPtr_Lim         *       &200 / 4        ; Number of words in stack.
GS_StackPtr             #       4
Jeffrey Lee's avatar
Jeffrey Lee committed
1697
GSVarWSpace_Size        #       0
Neil Turton's avatar
Neil Turton committed
1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710

                        ^      @ + ScratchSpace

; Pointers for SubstituteArgs: no external calls.
; Ensure these don't overlap FileSwitch's buffers below!

MacExStartPtrs          #       44
MacExEndPtrs            #       44

; OS_CLI has a buffer for alias expansion: ReadVarVal and SubstituteArgs
;    are called while the buffer is held. Also used for module prefixes:
;    Module called twice in this case.

1711
OldAliasExpansionBuffer #       100     ;spare, mjs: shouldn't this have been &100 ??!??
Neil Turton's avatar
Neil Turton committed
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722


; EvaluateExpression space. Calls ReadUnsigned, BinaryToDecimal and ReadVarVal.

ExprWSpace              *       @

                        ^       0, R12
exprBracDif             #       2       ; keep exprSTRACC aligned
tos_op                  #       2       ; 1 byte for use as STRACC-1
ExprSVCstack            #       4

1723 1724
ExprStackLimit          *       @ - exprBracDif + ExprWSpace + &100   ;keep 256 buffer zone for stack overflow
ExprStackStart          *       ScratchSpace + ScratchSpaceSize
Neil Turton's avatar
Neil Turton committed
1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752


; *****************************************************************************
; ***            Cursor, Sound DMA, SWI, and OSCLI workspace.               ***
; *****************************************************************************

TopOfDMAWorkSpace       *       CursorChunkAddress + 32*1024

                        ^       TopOfDMAWorkSpace ; Note we will be going down

; Sound

SoundWorkSpaceSize      *       &1000

Export_SoundDMABufferSize  *    &1000
        ASSERT  Export_SoundDMABufferSize =  SoundDMABufferSize

SoundEvtSize            *       &1000

Export_SoundDMABuffers         |#|     SoundDMABufferSize * 2
        ASSERT  Export_SoundDMABuffers =  SoundDMABuffers
        ASSERT ?Export_SoundDMABuffers = ?SoundDMABuffers

Export_SoundWorkSpace          |#|     SoundWorkSpaceSize + SoundEvtSize
        ASSERT  Export_SoundWorkSpace =  SoundWorkSpace
        ASSERT ?Export_SoundWorkSpace = ?SoundWorkSpace

; Cursor
1753 1754 1755 1756
; mjs Sep 2000, Kernel/HAL split
; Note that cursor data memory is expected to be uncacheable, since HAL may use it
; directly for h/w DMA. This may not be true since RO 3.7, but should be sorted
; eventually for next generation RO
1757 1758 1759 1760
;
; Currently (Jan 2013) only the sound DMA buffers are mapped in uncacheable.
; This means CursorData is mapped in cacheable, despite the OS treating it as
; uncacheable.
Neil Turton's avatar
Neil Turton committed
1761

1762
CursorDataSize          *       &600            ; four defined shapes, plus 2 holding shapes
Neil Turton's avatar
Neil Turton committed
1763 1764 1765
CursorData              |#|     CursorDataSize
CursorSoundRAM          *       CursorData

1766 1767
SPARE_oldCursorSpace    |#|     &200            ; padding to avoid changing exported addresses for now

Neil Turton's avatar
Neil Turton committed
1768 1769
; SWI despatcher

1770
BranchToSWIExit         |#|     4
Neil Turton's avatar
Neil Turton committed
1771

1772
SvcTable                |#|     &400
Neil Turton's avatar
Neil Turton committed
1773

1774 1775
                        GBLA    SWIDespatch_Size
SWIDespatch_Size        SETA    38*4
1776
 [ SupportARMT
1777 1778 1779 1780
SWIDespatch_Size        SETA    SWIDespatch_Size + 2*4
 ]
 [ ZeroPage <> 0
SWIDespatch_Size        SETA    SWIDespatch_Size + 4
1781
 ]
1782 1783 1784 1785
 [ CheckErrorBlocks
SWIDespatch_Size        SETA    SWIDespatch_Size + 4
 ]

Neil Turton's avatar
Neil Turton committed
1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811
SWIDespatch             |#|     SWIDespatch_Size


; Buffers

KeyBuffSize             *       &100
RS423InBuffSize         *       &100
RS423OutBuffSize        *       &C0
PrintBuffSize           *       &400
Sound0BuffSize          *       4
Sound1BuffSize          *       4
Sound2BuffSize          *       4
Sound3BuffSize          *       4
SpeechBuffSize          *       4
MouseBuffSize           *       &40
KeyBuff                 |#|     KeyBuffSize
RS423InBuff             |#|     RS423InBuffSize
RS423OutBuff            |#|     RS423OutBuffSize
PrintBuff               |#|     PrintBuffSize
Sound0Buff              |#|     Sound0BuffSize
Sound1Buff              |#|     Sound1BuffSize
Sound2Buff              |#|     Sound2BuffSize
Sound3Buff              |#|     Sound3BuffSize
SpeechBuff              |#|     SpeechBuffSize
MouseBuff               |#|     MouseBuffSize

1812
; IRQ despatch
Neil Turton's avatar
Neil Turton committed
1813

Jeffrey Lee's avatar
Jeffrey Lee committed
1814
MaxInterrupts           *       320     ; 320 needed by Pi 4. Increase in future if necessary.
1815
DefIRQ1Vspace           *       12*MaxInterrupts+128
Neil Turton's avatar
Neil Turton committed
1816 1817 1818

DefaultIRQ1V            |#|     DefIRQ1Vspace

Jeffrey Lee's avatar
Jeffrey Lee committed
1819
 [ :DEF: ShowWS
1820
 ! 0, "CursorChunkAddress free ":CC::STR:(@-CursorChunkAddress)
1821
 ]
Neil Turton's avatar
Neil Turton committed
1822

1823
 ASSERT @ >= CursorChunkAddress
Neil Turton's avatar
Neil Turton committed
1824 1825 1826 1827 1828

; *****************************************************************************
;                        High system workspace
; *****************************************************************************

1829
                ^       SVCStackAddress
Neil Turton's avatar
Neil Turton committed
1830 1831

                       #       SVCStackSize    ; svcstk size. Overflow will give abort
1832
SVCSTK                 #       0
Neil Turton's avatar
Neil Turton committed
1833

1834
SysHeapStart           *       SysHeapAddress
Neil Turton's avatar
Neil Turton committed
1835

1836 1837 1838 1839 1840 1841 1842 1843 1844

; *****************************************************************************

    ASSERT            LongCLISize >= 256+4     ;minimum size of GeneralMOSBuffer

;Kernel buffers area

                      ^  KbuffsBaseAddress

Jeffrey Lee's avatar
Jeffrey Lee committed
1845 1846 1847 1848 1849 1850 1851
; GeneralMOSBuffer: re-use with caution!
; Here's just some of the users:
; user                  use(s)
; default error handler error buffer (must be 246+4 bytes big)
; *If                   expression to be evaluated to control the *If
;                       Command line to be submited on the expression
;                         evaluating to non-zero (the THEN clause).
1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867
GeneralMOSBuffer      #  LongCLISize

EnvString             #  LongCLISize

AliasExpansionBuffer  #  LongCLISize
ArgumentBuffer        *  AliasExpansionBuffer

ExprBuff              #  LongCLISize
exprSTRACC            #  LongCLISize

OscliBuffSize         *  LongCLISize
OscliNoBuffs          *  16
RedirectBuff          #  OscliBuffSize
OscliCircBuffStart    #  OscliBuffSize * OscliNoBuffs
OscliCircBuffLimit    #  0

Ben Avison's avatar
Ben Avison committed
1868 1869
GSVarWSpace           #  GSVarWSpace_Size

Jeffrey Lee's avatar
Jeffrey Lee committed
1870
SysVarWorkSpace	      #  40             ; used by the sys$* variables for reading the current time into
Ben Avison's avatar
Ben Avison committed
1871

1872 1873 1874 1875 1876
ROMBuildDate          #  128
 [ UseNewFX0Error
NewFX0Error           #  64
 ]

1877 1878
HeapBackgroundError   #  256 ; For storing errors generated in the background by the forced completion of a foreground heap op

1879 1880 1881
KbuffsEnd             #  0
KbuffsSize            *  KbuffsEnd - KbuffsBaseAddress  ;size of Kernel buffers area

1882
    ASSERT            ((KbuffsSize + &FFF) :AND: &FFFFF000) <= KbuffsMaxSize
1883 1884 1885 1886

      ! 0, "Kbuffs                at ":CC::STR:(KbuffsBaseAddress)
      ! 0, "Kbuffs Size           is ":CC::STR:(KbuffsSize)

1887
    [ {FALSE}
1888 1889 1890 1891 1892 1893 1894 1895
      ! 0, "GeneralMOSBuffer      at ":CC::STR:(GeneralMOSBuffer)
      ! 0, "EnvString             at ":CC::STR:(EnvString)
      ! 0, "AliasExpansionBuffer  at ":CC::STR:(AliasExpansionBuffer)
      ! 0, "ArgumentBuffer        at ":CC::STR:(ArgumentBuffer)
      ! 0, "ExprBuff              at ":CC::STR:(ExprBuff)
      ! 0, "exprSTRACC            at ":CC::STR:(exprSTRACC)
      ! 0, "RedirectBuff          at ":CC::STR:(RedirectBuff)
      ! 0, "OscliCircBuffStart    at ":CC::STR:(OscliCircBuffStart)
1896
    ]
1897 1898


Neil Turton's avatar
Neil Turton committed
1899 1900
        OPT     OldOpt
        END