From 420ede09ab36684d91264bb4210d5a05f75b61c4 Mon Sep 17 00:00:00 2001
From: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Date: Fri, 11 Oct 2013 10:48:11 +0100
Subject: [PATCH 04/35] Move kernel includes into a separate file. This allows
 them to be included for the purposes of generating a C header file.

Conflicts:
	castle/RiscOS/Sources/Kernel/s/Kernel
---
 castle/RiscOS/Sources/Kernel/hdr/GetAll |  93 ++++++++++
 castle/RiscOS/Sources/Kernel/hdr/Kernel | 294 ++++++++++++++++++++++++++++++++
 castle/RiscOS/Sources/Kernel/s/GetAll   |  67 +-------
 castle/RiscOS/Sources/Kernel/s/Kernel   | 274 -----------------------------
 4 files changed, 388 insertions(+), 340 deletions(-)
 create mode 100644 castle/RiscOS/Sources/Kernel/hdr/GetAll
 create mode 100644 castle/RiscOS/Sources/Kernel/hdr/Kernel

diff --git a/castle/RiscOS/Sources/Kernel/hdr/GetAll b/castle/RiscOS/Sources/Kernel/hdr/GetAll
new file mode 100644
index 0000000..06f7f01
--- /dev/null
+++ b/castle/RiscOS/Sources/Kernel/hdr/GetAll
@@ -0,0 +1,93 @@
+; This source code in this file is licensed to You by Castle Technology
+; Limited ("Castle") and its licensors on contractual terms and conditions
+; ("Licence") which entitle you freely to modify and/or to distribute this
+; source code subject to Your compliance with the terms of the Licence.
+;
+; This source code has been made available to You without any warranties
+; whatsoever. Consequently, Your use, modification and distribution of this
+; source code is entirely at Your own risk and neither Castle, its licensors
+; nor any other person who has contributed to this source code shall be
+; liable to You for any loss or damage which You may suffer as a result of
+; Your use, modification or distribution of this source code.
+;
+; Full details of Your rights and obligations are set out in the Licence.
+; You should have received a copy of the Licence with this source code file.
+; If You have not received a copy, the text of the Licence is available
+; online at www.castle-technology.co.uk/riscosbaselicence.htm
+;
+; > GetAll
+
+        GET     Hdr:ListOpts
+        GET     Hdr:Macros
+        GET     Hdr:System
+        GET     Hdr:CPU.Arch
+        GET     Hdr:Machine.<Machine>
+        GET     Hdr:HALSize.<HALSize>
+        GET     Hdr:ImageSize.<ImageSize>
+        GET     Hdr:UserIF.<UserIF>
+        $GetCPU
+        $GetIO
+        $GetMEMC
+        $GetMEMM
+        $GetVIDC
+
+        GET     hdr.Options
+
+; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+; now get the headers
+; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+        GET     Hdr:CMOS
+        GET     Hdr:Heap
+        GET     Hdr:PublicWS
+        GET     Hdr:KernelWS
+        GET     Hdr:HALEntries
+        GET     Hdr:HALDevice
+        GET     Hdr:RTCDevice
+        GET     Hdr:OSEntries
+        GET     Hdr:Services
+        GET     Hdr:FSNumbers
+        GET     Hdr:HighFSI
+        GET     Hdr:NewErrors
+        GET     Hdr:Proc
+        GET     Hdr:Sprite
+        GET     Hdr:KeyWS
+        GET     Hdr:RS423
+        GET     Hdr:ModHand
+        GET     Hdr:Variables
+        GET     Hdr:EnvNumbers
+        GET     Hdr:UpCall
+        GET     Hdr:Sound
+        GET     Hdr:Pointer
+        GET     Hdr:Podule
+        GET     Hdr:VduExt
+        GET     Hdr:Buffer
+        GET     Hdr:Font
+        GET     Hdr:DevNos
+        GET     Hdr:OsBytes
+        GET     Hdr:Internatio
+        GET     Hdr:Territory
+        GET     Hdr:Portable
+        GET     Hdr:MsgTrans
+        GET     Hdr:PaletteV
+        GET     Hdr:GraphicsV
+        GET     Hdr:Wimp
+        GET     Hdr:ColourTran
+        GET     Hdr:Debug
+        GET     Hdr:NVRAM
+        GET     Hdr:PortMan
+        GET     Hdr:SerialOp
+        GET     Hdr:Keyboard
+        GET     Hdr:OSRSI6
+        [ Machine = "Linux"
+        GET     Hdr:LinuxSyscalls
+        ]
+
+; now the main parts of the MOS
+
+        GET     hdr.Copro15ops ; some macros
+        GET     hdr.ARMops
+        GET     hdr.Kernel
+
+        END
diff --git a/castle/RiscOS/Sources/Kernel/hdr/Kernel b/castle/RiscOS/Sources/Kernel/hdr/Kernel
new file mode 100644
index 0000000..ee26820
--- /dev/null
+++ b/castle/RiscOS/Sources/Kernel/hdr/Kernel
@@ -0,0 +1,294 @@
+; This source code in this file is licensed to You by Castle Technology
+; Limited ("Castle") and its licensors on contractual terms and conditions
+; ("Licence") which entitle you freely to modify and/or to distribute this
+; source code subject to Your compliance with the terms of the Licence.
+;
+; This source code has been made available to You without any warranties
+; whatsoever. Consequently, Your use, modification and distribution of this
+; source code is entirely at Your own risk and neither Castle, its licensors
+; nor any other person who has contributed to this source code shall be
+; liable to You for any loss or damage which You may suffer as a result of
+; Your use, modification or distribution of this source code.
+;
+; Full details of Your rights and obligations are set out in the Licence.
+; You should have received a copy of the Licence with this source code file.
+; If You have not received a copy, the text of the Licence is available
+; online at www.castle-technology.co.uk/riscosbaselicence.htm
+;
+
+        TTL     => Kernel : SWI Despatch, simple SWIs
+        SUBT    Arthur Variables
+        OPT     4
+; Moved from s.Kernel
+
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+; handy macros:
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+        MACRO
+        DebugTX $str
+    [ DebugHALTX
+        BL      DebugHALPrint
+        =       "$str", 0
+        ALIGN
+    ]
+        MEND
+
+        MACRO
+$l      CheckSpaceOnStack   $space, $faildest, $tmp
+$l      MOV     $tmp, sp, LSR #15       ; Stack base on 32K boundary
+        SUB     $tmp, sp, $tmp, LSL #15 ; Amount of stack left
+        CMP     $tmp, #$space           ; Must have at least this much left
+        BMI     $faildest
+        MEND
+
+        MACRO
+        assert  $condition
+ [ :LNOT: ($condition)
+ ! 1,"Assert failed: $condition"
+ ]
+        MEND
+
+; **************************************
+; ***  BYTEWS - Point to OsbyteVars  ***
+; **************************************
+        MACRO
+$label  BYTEWS  $reg
+$label  LDR     $reg,=ZeroPage+OsbyteVars
+        MEND
+
+; ***************************************
+; ***  LDROSB - Load Osbyte variable  ***
+; ***************************************
+        MACRO
+$label  LDROSB  $reg, $var, $cond
+$label  LDR$cond $reg, =ZeroPage
+        LDR$cond.B $reg, [$reg, #OsbyteVars+$var-OSBYTEFirstVar]
+        MEND
+
+; ****************************************
+; ***  STROSB - Store Osbyte variable  ***
+; ****************************************
+        MACRO
+$label  STROSB  $reg, $var, $temp, $cond
+$label  LDR$cond $temp, =ZeroPage
+        STR$cond.B $reg, [$temp, #OsbyteVars+$var-OSBYTEFirstVar]
+        MEND
+
+; ****************************************************
+; ***  VDWS - Point to our new VduDriverWorkSpace  ***
+; ****************************************************
+        MACRO
+$label  VDWS    $reg
+$label  LDR     $reg, =ZeroPage+VduDriverWorkSpace
+        MEND
+
+; one that builds a module command table entry:
+; set Module_BaseAddr to module base before use.
+
+                GBLA    Module_BaseAddr
+Module_BaseAddr SETA    0
+
+; Fake a 26-bit pc, given a PSR currently in lr (or reg), and the 32-bit address on
+; the stack. The stacked address is pulled, and the result is left in lr.
+
+        MACRO
+        FakeLR  $temp, $dontpull, $reg
+ [ "$reg" = ""
+        AND     $temp,lr,#&F0000003
+ |
+        AND     $temp,$reg,#&F0000003
+ ]
+        AND     lr,lr,#I32_bit+F32_bit
+        ORR     $temp,$temp,lr,LSL #IF32_26Shift
+ [ "$dontpull" = "dontpull"
+        LDR     lr,[sp]
+ |
+        LDR     lr,[sp],#4
+ ]
+        BIC     lr,lr,#ARM_CC_Mask
+        ORR     lr,lr,$temp
+        MEND
+
+;
+
+    [ AddTubeBashers
+ [ TubeType = Tube_Normal
+DebugTUBE  * &03340000+3*&4000         ; tube in podule #3
+; Tube register offsets
+ ^ 0
+R1STAT # 4
+R1DATA # 4
+ |
+DebugTUBE * &03000000           ; simulator tube address
+R1DATA * 0
+ ]
+   ]
+
+; routine to stuff a char down the Tube
+; should be inside above conditional, but AAsm winges pitifully.
+     MACRO
+$l   TubeChar $reg1, $reg2, $charset, $stackthere
+  !  0, "TubeChar used."
+$l
+   [ "$stackthere"=""
+   Push "$reg1, $reg2"
+   ]
+     LDR  $reg1, =DebugTUBE
+ [ TubeType = Tube_Normal               ; normal tubes have status register, simulator one doesn't
+01   LDRB $reg2, [$reg1, #R1STAT]
+     TST $reg2, #&40
+     BEQ %BT01
+ ]
+     $charset
+     STRB $reg2, [$reg1, #R1DATA]
+   [ "$stackthere"=""
+   Pull "$reg1, $reg2"
+   ]
+     MEND
+
+        MACRO
+$l      TubeString $reg1, $reg2, $reg3, $string, $cc
+        LDR     $reg1, =DebugTUBE
+        ADR     $reg2, %FT20
+10
+ [ TubeType = Tube_Normal
+        LDRB    $reg3, [$reg1, #R1STAT]
+        TST     $reg3, #&40
+        BEQ     %BT10
+ ]
+
+        LDRB    $reg3, [$reg2], #1
+        TEQ     $reg3, #0
+        STRNEB  $reg3, [$reg1, #R1DATA]
+        BNE     %BT10
+        B       %FT30
+20
+        =       "$string"
+ [ "$cc" = ""
+        =       10, 13
+ ]
+        =       0
+        ALIGN
+30
+        MEND
+
+        MACRO
+$l      TubeDumpNoStack $dump, $t1, $t2, $t3
+$l      MOV    $t1, #7
+01
+        ADRL   $t2, HexTable
+        TubeChar $t3, $t2, "LDRB $t2, [$t2, $dump, LSR #28]", NoStack
+        MOV    $dump, $dump, ROR #28
+        SUBS   $t1, $t1, #1
+        BPL    %BT01
+        TubeChar $t3, $t2, "MOV $t2, #"" """, NoStack
+        MEND
+
+        MACRO
+$l      TubeNewlNoStack $t1, $t2
+$l      TubeChar $t1, $t2, "MOV $t2, #10", NoStack
+        TubeChar $t1, $t2, "MOV $t2, #13", NoStack
+        MEND
+
+
+a1      RN      0
+a2      RN      1
+a3      RN      2
+a4      RN      3
+v1      RN      4
+v2      RN      5
+v3      RN      6
+v4      RN      7
+v5      RN      8
+v6      RN      9
+sb      RN      9
+v7      RN      10
+v8      RN      11
+
+; Set sb up ready for CallHAL.
+        MACRO
+        AddressHAL $zero
+ [ "$zero" <> ""
+        LDR     sb, [$zero, #HAL_Workspace]
+ |
+        LDR     sb, =ZeroPage
+        LDR     sb, [sb, #HAL_Workspace]
+ ]
+        MEND
+
+; Calls the HAL. $rout is the routine. sb must have been set up by AddressHAL
+        MACRO
+        CallHAL $rout, $cond
+        MOV$cond lr, pc
+        LDR$cond pc, [sb, #-(EntryNo_$rout+1) * 4]
+        MEND
+
+; Checks whether a HAL routine exists. If it does, $ptr points to it, and Z is
+; clear. lr corrupted.
+        MACRO
+        CheckHAL $rout, $ptr
+      [ "$ptr"=""
+        LDR     a1, [sb, #-(EntryNo_$rout+1) * 4]
+        ADRL    lr, NullHALEntry
+        TEQ     a1, lr
+      |
+        LDR     $ptr, [sb, #-(EntryNo_$rout+1) * 4]
+        ADRL    lr, NullHALEntry
+        TEQ     $ptr, lr
+      ]
+        MEND
+
+
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+; Various constants
+; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+PageSize          * (4*1024)       ;MMU page size (normal pages)
+Log2PageSize      * 12             ;for shifts
+
+MinAplWork * 40*1024         ; minimum size of AplWork
+
+; Fixed addresses
+
+MEMCADR  * &03600000
+        GBLL    ROMatTop
+ [ HAL32 :LAND: {TRUE}
+ROM      * &FC000000
+ROMatTop SETL {TRUE}
+ |
+ROM      * &03800000
+ROMLimit * &04000000
+ ]
+
+VideoPhysRam *  &02000000               ; Amazing - it's in the same place!
+DRAM0PhysRam *  &10000000               ; 4 DRAM banks
+DRAM1PhysRam *  &14000000
+DRAM2PhysRam *  &18000000
+DRAM3PhysRam *  &1C000000
+DRAMBaseAddressMask * &1C000000         ; used to mask off bits after stealing video RAM
+ [ STB
+PhysExtROM *    &01000000               ; 2nd ROM bank starts at 16M
+ ]
+SAMLength *     512*4                   ; SAM length in bytes for 1 bank of VRAM
+ [ :LNOT: HAL
+PhysSpaceSize * &20000000               ; IOMD physical map is 512M big
+PhysROM *       &00000000               ; and real ROM starts at 0
+EASISpacePhys * &08000000
+EASISpace *     PhysSpace + EASISpacePhys
+ ]
+
+; Manifests
+
+CR * 13
+LF * 10
+space * " "
+
+; Callback byte bits:
+CBack_OldStyle  * 1
+CBack_Postpone  * 2
+CBack_VectorReq * 4
+
+; Set up symbols for the SWIs which aren't really there yet
+
+        END
diff --git a/castle/RiscOS/Sources/Kernel/s/GetAll b/castle/RiscOS/Sources/Kernel/s/GetAll
index 65fd434..a005f1f 100644
--- a/castle/RiscOS/Sources/Kernel/s/GetAll
+++ b/castle/RiscOS/Sources/Kernel/s/GetAll
@@ -17,75 +17,10 @@
 ; 
 ; > GetAll
 
-        GET     Hdr:ListOpts
-        GET     Hdr:Macros
-        GET     Hdr:System
-        GET     Hdr:CPU.Arch
-        GET     Hdr:Machine.<Machine>
-        GET     Hdr:HALSize.<HALSize>
-        GET     Hdr:ImageSize.<ImageSize>
-        GET     Hdr:UserIF.<UserIF>
-        $GetCPU
-        $GetIO
-        $GetMEMC
-        $GetMEMM
-        $GetVIDC
-
-        GET     hdr.Options
-
-; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; now get the headers
-; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-        GET     Hdr:CMOS
-        GET     Hdr:Heap
-        GET     Hdr:PublicWS
-        GET     Hdr:KernelWS
-        GET     Hdr:HALEntries
-        GET     Hdr:HALDevice
-        GET     Hdr:RTCDevice
-        GET     Hdr:OSEntries
-        GET     Hdr:Services
-        GET     Hdr:FSNumbers
-        GET     Hdr:HighFSI
-        GET     Hdr:NewErrors
-        GET     Hdr:Proc
-        GET     Hdr:Sprite
-        GET     Hdr:KeyWS
-        GET     Hdr:RS423
-        GET     Hdr:ModHand
-        GET     Hdr:Variables
-        GET     Hdr:EnvNumbers
-        GET     Hdr:UpCall
-        GET     Hdr:Sound
-        GET     Hdr:Pointer
-        GET     Hdr:Podule
-        GET     Hdr:VduExt
-        GET     Hdr:Buffer
-        GET     Hdr:Font
-        GET     Hdr:DevNos
-        GET     Hdr:OsBytes
-        GET     Hdr:Internatio
-        GET     Hdr:Territory
-        GET     Hdr:Portable
-        GET     Hdr:MsgTrans
-        GET     Hdr:PaletteV
-        GET     Hdr:GraphicsV
-        GET     Hdr:Wimp
-        GET     Hdr:ColourTran
-        GET     Hdr:Debug
-        GET     Hdr:NVRAM
-        GET     Hdr:PortMan
-        GET     Hdr:SerialOp
-        GET     Hdr:Keyboard
-        GET     Hdr:OSRSI6
+        GET     hdr.GetAll
 
 ; now the main parts of the MOS
 
-        GET     hdr.Copro15ops ; some macros
-        GET     hdr.ARMops
-
         GET     s.Kernel
         $GetFlashROM
         GET     s.ARMops
diff --git a/castle/RiscOS/Sources/Kernel/s/Kernel b/castle/RiscOS/Sources/Kernel/s/Kernel
index b34d268..d3bce88 100644
--- a/castle/RiscOS/Sources/Kernel/s/Kernel
+++ b/castle/RiscOS/Sources/Kernel/s/Kernel
@@ -16,280 +16,6 @@
 ; online at www.castle-technology.co.uk/riscosbaselicence.htm
 ; 
         TTL     => Kernel : SWI Despatch, simple SWIs
-        SUBT    Arthur Variables
-        OPT     4
-
-; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; handy macros:
-; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-        MACRO
-        DebugTX $str
-    [ DebugHALTX
-        BL      DebugHALPrint
-        =       "$str", 0
-        ALIGN
-    ]
-        MEND
-
-        MACRO
-$l      CheckSpaceOnStack   $space, $faildest, $tmp
-$l      MOV     $tmp, sp, LSR #15       ; Stack base on 32K boundary
-        SUB     $tmp, sp, $tmp, LSL #15 ; Amount of stack left
-        CMP     $tmp, #$space           ; Must have at least this much left
-        BMI     $faildest
-        MEND
-
-        MACRO
-        assert  $condition
- [ :LNOT: ($condition)
- ! 1,"Assert failed: $condition"
- ]
-        MEND
-
-; **************************************
-; ***  BYTEWS - Point to OsbyteVars  ***
-; **************************************
-        MACRO
-$label  BYTEWS  $reg
-$label  LDR     $reg,=ZeroPage+OsbyteVars
-        MEND
-
-; ***************************************
-; ***  LDROSB - Load Osbyte variable  ***
-; ***************************************
-        MACRO
-$label  LDROSB  $reg, $var, $cond
-$label  LDR$cond $reg, =ZeroPage
-        LDR$cond.B $reg, [$reg, #OsbyteVars+$var-OSBYTEFirstVar]
-        MEND
-
-; ****************************************
-; ***  STROSB - Store Osbyte variable  ***
-; ****************************************
-        MACRO
-$label  STROSB  $reg, $var, $temp, $cond
-$label  LDR$cond $temp, =ZeroPage
-        STR$cond.B $reg, [$temp, #OsbyteVars+$var-OSBYTEFirstVar]
-        MEND
-
-; ****************************************************
-; ***  VDWS - Point to our new VduDriverWorkSpace  ***
-; ****************************************************
-        MACRO
-$label  VDWS    $reg
-$label  LDR     $reg, =ZeroPage+VduDriverWorkSpace
-        MEND
-
-; one that builds a module command table entry:
-; set Module_BaseAddr to module base before use.
-
-                GBLA    Module_BaseAddr
-Module_BaseAddr SETA    0
-
-; Fake a 26-bit pc, given a PSR currently in lr (or reg), and the 32-bit address on
-; the stack. The stacked address is pulled, and the result is left in lr.
-
-        MACRO
-        FakeLR  $temp, $dontpull, $reg
- [ "$reg" = ""
-        AND     $temp,lr,#&F0000003
- |
-        AND     $temp,$reg,#&F0000003
- ]
-        AND     lr,lr,#I32_bit+F32_bit
-        ORR     $temp,$temp,lr,LSL #IF32_26Shift
- [ "$dontpull" = "dontpull"
-        LDR     lr,[sp]
- |
-        LDR     lr,[sp],#4
- ]
-        BIC     lr,lr,#ARM_CC_Mask
-        ORR     lr,lr,$temp
-        MEND
-
-;
-
-    [ AddTubeBashers
- [ TubeType = Tube_Normal
-DebugTUBE  * &03340000+3*&4000         ; tube in podule #3
-; Tube register offsets
- ^ 0
-R1STAT # 4
-R1DATA # 4
- |
-DebugTUBE * &03000000           ; simulator tube address
-R1DATA * 0
- ]
-   ]
-
-; routine to stuff a char down the Tube
-; should be inside above conditional, but AAsm winges pitifully.
-     MACRO
-$l   TubeChar $reg1, $reg2, $charset, $stackthere
-  !  0, "TubeChar used."
-$l
-   [ "$stackthere"=""
-   Push "$reg1, $reg2"
-   ]
-     LDR  $reg1, =DebugTUBE
- [ TubeType = Tube_Normal               ; normal tubes have status register, simulator one doesn't
-01   LDRB $reg2, [$reg1, #R1STAT]
-     TST $reg2, #&40
-     BEQ %BT01
- ]
-     $charset
-     STRB $reg2, [$reg1, #R1DATA]
-   [ "$stackthere"=""
-   Pull "$reg1, $reg2"
-   ]
-     MEND
-
-        MACRO
-$l      TubeString $reg1, $reg2, $reg3, $string, $cc
-        LDR     $reg1, =DebugTUBE
-        ADR     $reg2, %FT20
-10
- [ TubeType = Tube_Normal
-        LDRB    $reg3, [$reg1, #R1STAT]
-        TST     $reg3, #&40
-        BEQ     %BT10
- ]
-
-        LDRB    $reg3, [$reg2], #1
-        TEQ     $reg3, #0
-        STRNEB  $reg3, [$reg1, #R1DATA]
-        BNE     %BT10
-        B       %FT30
-20
-        =       "$string"
- [ "$cc" = ""
-        =       10, 13
- ]
-        =       0
-        ALIGN
-30
-        MEND
-
-        MACRO
-$l      TubeDumpNoStack $dump, $t1, $t2, $t3
-$l      MOV    $t1, #7
-01
-        ADRL   $t2, HexTable
-        TubeChar $t3, $t2, "LDRB $t2, [$t2, $dump, LSR #28]", NoStack
-        MOV    $dump, $dump, ROR #28
-        SUBS   $t1, $t1, #1
-        BPL    %BT01
-        TubeChar $t3, $t2, "MOV $t2, #"" """, NoStack
-        MEND
-
-        MACRO
-$l      TubeNewlNoStack $t1, $t2
-$l      TubeChar $t1, $t2, "MOV $t2, #10", NoStack
-        TubeChar $t1, $t2, "MOV $t2, #13", NoStack
-        MEND
-
-
-a1      RN      0
-a2      RN      1
-a3      RN      2
-a4      RN      3
-v1      RN      4
-v2      RN      5
-v3      RN      6
-v4      RN      7
-v5      RN      8
-v6      RN      9
-sb      RN      9
-v7      RN      10
-v8      RN      11
-
-; Set sb up ready for CallHAL.
-        MACRO
-        AddressHAL $zero
- [ "$zero" <> ""
-        LDR     sb, [$zero, #HAL_Workspace]
- |
-        LDR     sb, =ZeroPage
-        LDR     sb, [sb, #HAL_Workspace]
- ]
-        MEND
-
-; Calls the HAL. $rout is the routine. sb must have been set up by AddressHAL
-        MACRO
-        CallHAL $rout, $cond
-        MOV$cond lr, pc
-        LDR$cond pc, [sb, #-(EntryNo_$rout+1) * 4]
-        MEND
-
-; Checks whether a HAL routine exists. If it does, $ptr points to it, and Z is
-; clear. lr corrupted.
-        MACRO
-        CheckHAL $rout, $ptr
-      [ "$ptr"=""
-        LDR     a1, [sb, #-(EntryNo_$rout+1) * 4]
-        ADRL    lr, NullHALEntry
-        TEQ     a1, lr
-      |
-        LDR     $ptr, [sb, #-(EntryNo_$rout+1) * 4]
-        ADRL    lr, NullHALEntry
-        TEQ     $ptr, lr
-      ]
-        MEND
-
-
-; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-; Various constants
-; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-PageSize          * (4*1024)       ;MMU page size (normal pages)
-Log2PageSize      * 12             ;for shifts
-
-MinAplWork * 40*1024         ; minimum size of AplWork
-
-; Fixed addresses
-
-MEMCADR  * &03600000
-        GBLL    ROMatTop
- [ HAL32 :LAND: {TRUE}
-ROM      * &FC000000
-ROMatTop SETL {TRUE}
- |
-ROM      * &03800000
-ROMLimit * &04000000
- ]
-
-VideoPhysRam *  &02000000               ; Amazing - it's in the same place!
-DRAM0PhysRam *  &10000000               ; 4 DRAM banks
-DRAM1PhysRam *  &14000000
-DRAM2PhysRam *  &18000000
-DRAM3PhysRam *  &1C000000
-DRAMBaseAddressMask * &1C000000         ; used to mask off bits after stealing video RAM
- [ STB
-PhysExtROM *    &01000000               ; 2nd ROM bank starts at 16M
- ]
-SAMLength *     512*4                   ; SAM length in bytes for 1 bank of VRAM
- [ :LNOT: HAL
-PhysSpaceSize * &20000000               ; IOMD physical map is 512M big
-PhysROM *       &00000000               ; and real ROM starts at 0
-EASISpacePhys * &08000000
-EASISpace *     PhysSpace + EASISpacePhys
- ]
-
-; Manifests
-
-CR * 13
-LF * 10
-space * " "
-
-; Callback byte bits:
-CBack_OldStyle  * 1
-CBack_Postpone  * 2
-CBack_VectorReq * 4
-
-; Set up symbols for the SWIs which aren't really there yet
-
-
         SUBT    Arthur Code
         OPT     4
 
-- 
1.8.4.rc3

