makehswis 3.96 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
; 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
45 46
        GET     Hdr:Machine.<Machine>
        $GetIO
Neil Turton's avatar
Neil Turton committed
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

        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
108
	BIN	h.swisheader
Neil Turton's avatar
Neil Turton committed
109 110 111 112 113 114 115 116 117 118

; 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

119
        GET     s.swioptions
Neil Turton's avatar
Neil Turton committed
120 121 122 123 124 125 126

; And finally the trailing bits

        =       10
        =       "#endif", 10

        END