head     1.1;
branch   ;
access   ;
symbols  V36_3:1.1;
locks    ; strict;
comment  @# @;


1.1
date     89.04.10.17.19.43;  author steveb;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@// BCPL header for Amiga DOS

// Version 26 Release 25      

GLOBAL
$(
// Interface globals
     requestor2     : -33
     BtoC           : -32
     CtoB           : -31
     i.setfiledate  : -30
     i.flush        : -29
     i.relabel      : -28
     i.execute      : -27
     i.isinteractive: -26
     i.datstamp     : -25
     i.setprotection: -24
     i.setcomment   : -23
     i.deviceproc   : -22
     noreqloadseg   : -21
     clearvec       : -20
     i.loadseg      : -19
     i.createproc   : -18
     i.ioerr        : -17
     i.currentdir   : -16
     i.createdir    : -15
     i.info         : -14
     i.exnext       : -13
     i.examine      : -12
     i.lock         : -11
     i.renamefile   : -10
     i.deletefile   :  -9
     i.seek         :  -8
     i.writechar    :  -7
     i.write        :  -6
     i.unreadchar   :  -5
     i.readchar     :  -4
     i.read         :  -3
     copyvec        :  -2
     i.open         :  -1
// Normal BCPL globals
     globsize       :   0
     start          :   1
     stop           :   2
     multiply       :   3
     divide         :   4
     remainder      :   5
     SetIO          :   6
     backtrace      :   7
     gbytes         :   8
     pbytes         :   9
     result2        :  10
     returncode     :  11
     stackbase      :  12
     makeglob       :  13
     taskid         :  14
     getbyte        :  15
     byteget        :  15
     putbyte        :  16
     byteput        :  16
     level          :  17
     longjump       :  18
     getmem         :  19
     aptovec        :  20
     DoIo           :  21
     SendIO         :  22
     createco       :  23
     deleteco       :  24
     callco         :  25
     cowait         :  26
     resumeco       :  27
     globin         :  28
     GetVec         :  29
     FreeVec        :  30
     OpenDevice     :  31  
     CloseDevice    :  32 
     createtask     :  33
     deletetask     :  34
     parent         :  35  
     setflags       :  36
     testflags      :  37
     abort          :  38 
     rootstruct     :  39
     readbytes      :  40
     taskwait       :  41
     qpkt           :  42
     writebytes     :  43
     packstring     :  44
     unpackstring   :  45
     endtask        :  46
     delay          :  47
     sendpkt        :  48
     returnpkt      :  49
     openwindow     :  50
     currentdir     :  51
     requestor      :  52
     writet         :  53 
     rdch           :  54
     unrdch         :  55
     wrch           :  56
     readwords      :  57
     writewords     :  58
     findinput      :  59
     findoutput     :  60
     selectinput    :  61
     selectoutput   :  62
     endread        :  63
     endwrite       :  64
     input          :  65
     output         :  66
     readn          :  67
     newline        :  68
     writed         :  69
     writen         :  70
     writehex       :  71
     writeoct       :  72
     writes         :  73
     writef         :  74
     capitalch      :  75
     compch         :  76
     compstring     :  77
     rdargs         :  78
     rditem         :  79
     findarg        :  80
     loadseg        :  81
     unloadseg      :  82
     callseg        :  83
     tidyup         :  84
     adddevice      :  85   
     datstamp       :  86
     waitforchar    :  87
     exec           :  88  
     seglist        :  89 
     deleteobj      :  90
     deletefile     :  90   // Synonym
     renameobj      :  91
     renamefile     :  91   // Synonym
     intuition      :  92
     endstream      :  93
     i.close        :  93   // Synonym
     get2bytes      :  94
     put2bytes      :  95
     vdu.movecursor :  96   //** These four only used by ED
     vdu            :  97   //**
     vdu.rdch       :  98   //**
     vdu.wrch       :  99   //**
     pktwait        : 100
     execute        : 101
     devicetask     : 102
     callres        : 103
     fault          : 104
     consoletask    : 105
     filesystemtask : 106
     splitname      : 107
     locateobj      : 108
     freeobj        : 109
     getlong        : 110  
     putlong        : 111  
     loaddevice     : 112
     copydir        : 113
     err.report     : 114
     copystring     : 115
     pointword      : 116
     fix            : 117
     float          : 118
     readfp         : 119
     writefp        : 120
     runcommand     : 121
     fpsim          : 122
     locatedir      : 123
     finddevice     : 124
     createdir      : 125
     comparedate    : 126
     dotimer        : 127
     setdosdate     : 128
//129-132 spare
//133-149 defined in CLIHDR
$)

MANIFEST
$(
     EndStreamch         =     -1
     NotInUse            =     -1
     BytesPerWord        =     4
     BitsPerWord         =     32
     BitsPerByte         =     8
     MaxInt              =     #X7FFFFFFF
     MinInt              =     #X80000000
     TicksPerSecond      =     50
     UG                  =     150
     FG                  =     UG
     undefined.global    =     #X474C0001
     negative.global.size=     50

     // Error report types
     report.stream = 0       // A stream
     report.task   = 1       // A file system taskid
     report.lock   = 2       // A lock
     report.volume = 3       // A volume node

$)


MANIFEST
$(

     // EXEC structure offsets
     msg.size           = 5
     msg.name           = 10
     msg.replyport      = 14
     IO.command         = 28
     IO.flags           = 30
     IO.error           = 31
     IO.actual          = 32
     IO.length          = 36
     IO.data            = 40
     IO.offset          = 44
     IO.size            = 12
     // NB These are BCPL values
     IO.secs.p          = IO.actual >> 2
     IO.ticks.p         = IO.length >> 2
     IO.state.p         = IO.secs.p

     // Device commands
     IOC.invalid        = 0  
     IOC.reset          = 1
     IOC.read           = 2
     IOC.write          = 3
     IOC.update         = 4
     IOC.clear          = 5
     IOC.stop           = 6
     IOC.start          = 7
     IOC.flush          = 8

     IOC.motor          =  9
     IOC.seek           = 10
     IOC.format         = 11
     IOC.remove         = 12
     IOC.changenum      = 13
     IOC.changestate    = 14
     IOC.protectstate   = 15

     IOC.addrequest     =  9
     IOC.getsystime     = 10
     IOC.setsystime     = 11

     IOC.readext        = IOC.read | #X8000
     IOC.writeext       = IOC.write | #X8000

     // Disc parameters
     Disc.sector.size   = 512
     Disc.sector.shift  = 9

     // Memory type values
     memf.largest       = #X20000
     memf.clear         = #X10000
     memf.fast          = #X00004
     memf.chip          = #X00002
     memf.public        = #X00001

     memf.pubclear      = memf.public | memf.clear
     memf.chipclear      = memf.chip | memf.clear

     // coroutine offsets
     co.cllr             =     1
     co.send             =     2
     co.resp             =     3
     co.func             =     4

     // standard packet offsets
     pkt.link            =     0
     pkt.devtaskid       =     1
     pkt.taskid          =     1
     pkt.devid           =     1
     pkt.id              =     1
     pkt.type            =     2
     pkt.res1            =     3
     pkt.res2            =     4
     pkt.arg1            =     5
     pkt.arg2            =     6
     pkt.arg3            =     7
     pkt.arg4            =     8
     pkt.arg5            =     9
     pkt.arg6            =    10
     pkt.arg7            =    11

     // Offsets of TriposInfo structure from standard
     // message port used as TaskID (lword offsets)

     tinfo.seglist       =     9
     tinfo.stacksize     =    10
     tinfo.globvec       =    11
     tinfo.tasknum       =    12
     tinfo.stackbase     =    13
     tinfo.result2       =    14
     tinfo.currentdir    =    15
     tinfo.cis           =    16
     tinfo.cos           =    17
     tinfo.consoletask   =    18
     tinfo.filesystemtask=    19
     tinfo.cli           =    20
     tinfo.returnaddr    =    21
     tinfo.pktwait       =    22
     tinfo.windowptr     =    23

     // Rootnode offsets.
     rtn.tasktab         =     0
     rtn.cliseg          =     1
     rtn.days            =     2
     rtn.mins            =     3
     rtn.ticks           =     4
     rtn.restartseg      =     5
     rtn.info            =     6
     rtn.fhseg           =     7	// code for file handler

     // Rootnode info fields
     info.mctype         =     0
     info.devicelist     =     1
     info.devices        =     2
     info.handlers       =     3
     info.segments       =     4

$)
@
