makehswis 5.41 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
; 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    Creation of swis.h ==> Hdr:makehswis

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

; Date       Name       Description
; ----       ----       -----------
; 07-Feb-94  TMD        Created file
; 20-Jul-94  AMcC       Made compatible with Hdr file changes:
;                       - GETs Hdr:PublicWS rather than defining SoundWorkSpace.
;                       - Hdr:File has been split into Hdr:FSNumbers and Hdr:HighFSI
;                         GETs Hdr:FSNumbers (needed by NewErrors) (was GET Hdr:File).
;                       - FilerAction hdr file is now called FilerAct (was Filer).
;                       - Filter hdr file is now called Filter (was Filters).
;                       - Squash hdr file is now called Squash (was Compress).
;                       - Removed GET  Hdr:DBox
;                       - Removed GET  Hdr:ROMCache
; 22-Sep-94  AMcC       #ifdef __cplusplus lines included in derived file (from IJohnson)
; 22-Sep-94  AMcC       Generates SWI name defs for all SWIs listed in PRM (3.50 version)
; 12-Oct-94  AMcC       Added SWIs for DDT (HLLDebugger) and HostFS (Tube)
; 03-Jan-95  AMcC       Added CDROM and SCSI SWIs (as requested by SPalmer)
; 09-Jan-95  AMcC       Added #defines for INR(..) and OUTR(..)
;                       Added usage comment (for Aquarius Toolbox)
;                       Updated version and date for header of output file
;

; AAsm source file to make h.swis file from Hdr:SWIs and other headers

        GET     Hdr:ListOpts

        GBLS    SWIClass

; Now the special version of the AddSWI macro that outputs the #defines

        MACRO
        AddSWI  $SWIName,$value
        LCLA    val2
  [     "$value" = ""
$SWIClass._$SWIName # 1
  |
$SWIClass._$SWIName * $value
  ]
val2    SETA    $SWIClass._$SWIName
X$SWIClass._$SWIName * $SWIClass._$SWIName + Auto_Error_SWI_bit
        =       "#undef $SWIClass._$SWIName", 10
        =       "#define $SWIClass._$SWIName 0x$val2", 10
        MEND

        MACRO
$label  AddError $name,$text,$value
$label
   [    "$value" = ""
ErrorNumber_$name # 1
   |
ErrorNumber_$name * $value
   ]
        GBLS ErrorString_$name
ErrorString_$name SETS "$text"
        MEND

        MACRO
$label  AddError2 $name,$text,$value
$label
   [    "$value" = ""
ErrorNumber_$name # 1
   |
ErrorNumber_$name * $value
   ]
        GBLS ErrorString_$name
ErrorString_$name SETS "$text"
        MEND

        MACRO
$label  AddFSError      $class, $baseerr, $fsname, $fsnumber
$label
        LCLA    value
value   SETA    &10000 + $fsnumber*&100 + ErrorNumber_$baseerr._Pre
        LCLS    string
string  SETS    ErrorString_$baseerr._Pre :CC: "$fsname" :CC: ErrorString_$baseerr._Post
        LCLS    string2
string2 SETS    "&":CC:(:STR:value)
        AddError        $class$baseerr, "$string", $string2
        MEND

; Needed to GET Hdr:Sound without Hdr:VickySpace -> Hdr:Macros

;SoundWorkSpace * &01F04000
        GET     Hdr:PublicWS

; First output the file header
106
	BIN	h.swisheader
Neil Turton's avatar
Neil Turton committed
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

; Now output all the SWI symbols we can access

        GET     Hdr:FSNumbers
        GET     Hdr:NewErrors
        GET     Hdr:SWIs
        GET     Hdr:CPU.Generic26
        GET     Hdr:IO.GenericIO
        GET     Hdr:ModHand

        GET     Hdr:ADFS
        GET     Hdr:ATAPI
        GET     Hdr:BasicTrans
        GET     Hdr:Buffer
        GET     Hdr:ARM3Cache
        GET     Hdr:CDROM
        GET     Hdr:CDFS
        GET     Hdr:ColourPick
        GET     Hdr:ColourTran
        GET     Hdr:DDT
        GET     Hdr:Debugger
        GET     Hdr:DeviceFS
        GET     Hdr:DMA
        GET     Hdr:DOSFS
        GET     Hdr:DragASprit
        GET     Hdr:DragAnObj
        GET     Hdr:Draw
        GET     Hdr:Econet
        GET     Hdr:FileCore
        GET     Hdr:FilerAct
        GET     Hdr:Filter
        GET     Hdr:Font
        GET     Hdr:FPEmulator
        GET     Hdr:Free
        GET     Hdr:FSLock
        GET     Hdr:Hourglass
        GET     Hdr:HostFS
        GET     Hdr:IIC
        GET     Hdr:Joystick
        GET     Hdr:MakePSFont
        GET     Hdr:MsgTrans
;       GET     Hdr:NetFS         SWIs defined in Hdr:Econet
;       GET     Hdr:NetPrint      SWIs defined in Hdr:Econet
        GET     Hdr:RISCOS
        GET     Hdr:Parallel
        GET     Hdr:PDriver
        GET     Hdr:PDumper
        GET     Hdr:Podule
        GET     Hdr:Portable
        GET     Hdr:RAMFS
        GET     Hdr:ResourceFS
        GET     Hdr:ScrBlank
        GET     Hdr:ScrModes
        GET     Hdr:SCSI
        GET     Hdr:SCSIFS
        GET     Hdr:SharedCLib
        GET     Hdr:Shell
        GET     Hdr:Sound
        GET     Hdr:Squash
        GET     Hdr:Super
        GET     Hdr:Switcher
        GET     Hdr:TaskWindow
        GET     Hdr:Territory
        GET     Hdr:Wimp

; And finally the trailing bits

        =       10
        =       "#endif", 10

        END