;Assembler header file for Econet
;written by DefMod (Mar  9 1999) on Thu Apr  8 04:39:39 1999
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET OS:Hdr.Types"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET OS:Hdr.OS"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Econet_Hdr
        GBLS    Econet_Hdr

;Symbols for constants
Econet_StatusTransmitted        *       &0
Econet_StatusLineJammed         *       &1
Econet_StatusNetError           *       &2
Econet_StatusNotListening       *       &3
Econet_StatusNoClock            *       &4
Econet_StatusTxReady            *       &5
Econet_StatusTransmitting       *       &6
Econet_StatusRxReady            *       &7
Econet_StatusReceiving          *       &8
Econet_StatusReceived           *       &9
Econet_StatusNoReply            *       &A
Econet_StatusEscape             *       &B
Econet_StatusNotPresent         *       &C
Error_EconetTxReady             *       &300
Error_EconetTransmitting        *       &301
Error_EconetRxReady             *       &302
Error_EconetReceiving           *       &303
Error_EconetReceived            *       &304
Error_EconetTransmitted         *       &305
Error_EconetBadStation          *       &306
Error_EconetBadNetwork          *       &307
Error_EconetUnableToDefault     *       &308
Error_EconetBadPort             *       &309
Error_EconetBadControl          *       &30A
Error_EconetBadBuffer           *       &30B
Error_EconetBadSize             *       &30C
Error_EconetBadMask             *       &30D
Error_EconetBadCount            *       &30E
Error_EconetBadDelay            *       &30F
Error_EconetBadStatus           *       &310
Error_EconetNoHardware          *       &311
Error_EconetNoEconet            *       &312
Error_EconetNoMoreDomains       *       &313
Error_EconetBadDomain           *       &314
Error_EconetUnRegisteredDomain  *       &315
Error_EconetPortNotAllocated    *       &316
Error_EconetPortAllocated       *       &317
Error_EconetNoMorePorts         *       &318
Econet_ImmediatePeek            *       &1
Econet_ImmediatePoke            *       &2
Econet_ImmediateJSR             *       &3
Econet_ImmediateUserProcedureCall *       &4
Econet_ImmediateOSProcedureCall *       &5
Econet_ImmediateHalt            *       &6
Econet_ImmediateContinue        *       &7
Econet_ImmediateMachinePeek     *       &8
Econet_ImmediateGetRegisters    *       &9
Econet_OSCharFromNotify         *       &0
Econet_OSInitialiseRemote       *       &1
Econet_OSGetViewParameters      *       &2
Econet_OSCauseFatalError        *       &3
Econet_OSCharFromRemote         *       &4
Econet_ProtectionPeek           *       &1
Econet_ProtectionPoke           *       &2
Econet_ProtectionJSR            *       &4
Econet_ProtectionUserProcedureCall *       &8
Econet_ProtectionOSProcedureCall *       &10
Econet_ProtectionHalt           *       &20
Econet_ProtectionContinue       *       &40
Econet_ProtectionMachinePeek    *       &80
Econet_ProtectionGetRegisters   *       &100
Econet_ProtectionWriteCMOS      *       &80000000
Econet_TransportNotKnown        *       &0
Econet_TransportInternet        *       &1
Econet_TransportEconet          *       &2
Econet_TransportNexus           *       &3
Econet_StateOK                  *       &0
Econet_StateNoClock             *       &1
Econet_NetFSStartLoad           *       &10
Econet_NetFSPartLoad            *       &11
Econet_NetFSFinishLoad          *       &12
Econet_NetFSStartSave           *       &20
Econet_NetFSPartSave            *       &21
Econet_NetFSFinishSave          *       &22
Econet_NetFSStartCreate         *       &30
Econet_NetFSPartCreate          *       &31
Econet_NetFSFinishCreate        *       &32
Econet_NetFSStartGetBytes       *       &40
Econet_NetFSPartGetBytes        *       &41
Econet_NetFSFinishGetBytes      *       &42
Econet_NetFSStartPutBytes       *       &50
Econet_NetFSPartPutBytes        *       &51
Econet_NetFSFinishPutBytes      *       &52
Econet_NetFSStartWait           *       &60
Econet_NetFSFinishWait          *       &62
Econet_NetFSStartBroadcastLoad  *       &70
Econet_NetFSPartBroadcastLoad   *       &71
Econet_NetFSFinishBroadcastLoad *       &72
Econet_NetFSStartBroadcastSave  *       &80
Econet_NetFSPartBroadcastSave   *       &81
Econet_NetFSFinishBroadcastSave *       &82
Econet_EconetStartTransmission  *       &C0
Econet_EconetFinishTransmission *       &C2
Econet_EconetStartReception     *       &D0
Econet_EconetFinishReception    *       &D2
Econet_Second                   *       4000000
Econet_kHz                      *       1

;Symbols for structure offsets and sizes
Econet_Status                   *       Int

Econet_ImmediateOp              *       Int

Econet_ImmediateOSProcedure     *       Ptr

Econet_Protection               *       Bits

Econet_TransportType            *       Int

Econet_State                    *       Int

Econet_RxCB                     *       4 ;abstract type
Econet_TxCB                     *       4 ;abstract type
Econet_Action                   *       Int

Econet_MapFlags                 *       Bits


;Symbols for SWIs and SWI reason codes
XEconet_CreateReceive           *       &60000
Econet_CreateReceive            *       &40000
   ;Entry
   ;  R0 = port (Byte)
   ;  R1 = station (Byte)
   ;  R2 = net (Byte)
   ;  R3 = buffer (pointer to data)
   ;  R4 = size (Int)
   ;Exit
   ;  R0 = rx_cb (Econet_RxCB)
   ;  R2 = nonlocal (Bool)

XEconet_ExamineReceive          *       &60001
Econet_ExamineReceive           *       &40001
   ;Entry
   ;  R0 = rx_cb (Econet_RxCB)
   ;Exit
   ;  R0 = status (Econet_Status)

XEconet_ReadReceive             *       &60002
Econet_ReadReceive              *       &40002
   ;Entry
   ;  R0 = rx_cb (Econet_RxCB)
   ;Exit
   ;  R0 = status (Econet_Status)
   ;  R1 = flag (Byte)
   ;  R2 = port (Byte)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)
   ;  R5 = buffer (pointer to data)
   ;  R6 = size (Int)

XEconet_AbandonReceive          *       &60003
Econet_AbandonReceive           *       &40003
   ;Entry
   ;  R0 = rx_cb (Econet_RxCB)
   ;Exit
   ;  R0 = status (Econet_Status)

XEconet_WaitForReception        *       &60004
Econet_WaitForReception         *       &40004
   ;Entry
   ;  R0 = rx_cb (Econet_RxCB)
   ;  R1 = delay (Int)
   ;  R2 = abort_on_escape (Bool)
   ;Exit
   ;  R0 = status (Econet_Status)
   ;  R1 = flag (Byte)
   ;  R2 = port (Byte)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)
   ;  R5 = buffer (pointer to data)
   ;  R6 = size (Int)

XEconet_EnumerateReceive        *       &60005
Econet_EnumerateReceive         *       &40005
   ;Entry
   ;  R0 = rx_cb_no (Int)
   ;Exit
   ;  R0 = rx_cb (Econet_RxCB)

XEconet_StartTransmit           *       &60006
Econet_StartTransmit            *       &40006
   ;Entry
   ;  R0 = flags (Byte)
   ;  R1 = port (Byte)
   ;  R2 = station (Byte)
   ;  R3 = net (Byte)
   ;  R4 = buffer (pointer to data)
   ;  R5 = size (Int)
   ;  R6 = count (Int)
   ;  R7 = delay (Int)
   ;Exit
   ;  R0 = tx_cb (Econet_TxCB)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted
   ;  R4 = nonlocal (Bool)

XEconet_PollTransmit            *       &60007
Econet_PollTransmit             *       &40007
   ;Entry
   ;  R0 = tx_cb (Econet_TxCB)
   ;Exit
   ;  R0 = status (Econet_Status)

XEconet_AbandonTransmit         *       &60008
Econet_AbandonTransmit          *       &40008
   ;Entry
   ;  R0 = tx_cb (Econet_TxCB)
   ;Exit
   ;  R0 = status (Econet_Status)

XEconet_DoTransmit              *       &60009
Econet_DoTransmit               *       &40009
   ;Entry
   ;  R0 = flags (Byte)
   ;  R1 = port (Byte)
   ;  R2 = station (Byte)
   ;  R3 = net (Byte)
   ;  R4 = buffer (pointer to data)
   ;  R5 = size (Int)
   ;  R6 = count (Int)
   ;  R7 = delay (Int)
   ;Exit
   ;  R0 = status (Econet_Status)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted
   ;  R4 = nonlocal (Bool)

XEconet_ReadLocalStationAndNet  *       &6000A
Econet_ReadLocalStationAndNet   *       &4000A
   ;Exit
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)

XEconet_ConvertStatusToString   *       &6000B
Econet_ConvertStatusToString    *       &4000B
   ;Entry
   ;  R0 = status (Econet_Status)
   ;  R1 = buffer (pointer to String)
   ;  R2 = size (Int)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)
   ;Exit
   ;  R0 corrupted
   ;  R1 -> end (Char)
   ;  R2 corrupted

XEconet_ConvertStatusToError    *       &6000C
Econet_ConvertStatusToError     *       &4000C
   ;Entry
   ;  R0 = status (Econet_Status)
   ;  R1 = buffer (pointer to OS_Error)
   ;  R2 = size (Int)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)

XEconet_ReadProtection          *       &6000D
Econet_ReadProtection           *       &4000D
   ;Exit
   ;  R0 = protection (Econet_Protection)

XEconet_SetProtection           *       &6000E
Econet_SetProtection            *       &4000E
   ;Entry
   ;  R0 = eor_mask (Econet_Protection)
   ;  R1 = and_mask (Econet_Protection)
   ;Exit
   ;  R0 = old_protection (Econet_Protection)

XEconet_ReadStationNumber       *       &6000F
Econet_ReadStationNumber        *       &4000F
   ;Entry
   ;  R1 -> s (String)
   ;Exit
   ;  R1 -> end (Char)
   ;  R2 = station (Int)
   ;  R3 = net (Int)

XEconet_PrintBanner             *       &60010
Econet_PrintBanner              *       &40010

XEconet_ReadTransportType       *       &60011
Econet_ReadTransportType        *       &40011
   ;Entry
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)
   ;  R2 = &2
   ;Exit
   ;  R2 = transport_type (Econet_TransportType)

XEconet_ReleasePort             *       &60012
Econet_ReleasePort              *       &40012
   ;Entry
   ;  R0 = port (Byte)

XEconet_AllocatePort            *       &60013
Econet_AllocatePort             *       &40013
   ;Exit
   ;  R0 = port (Byte)

XEconet_DeAllocatePort          *       &60014
Econet_DeAllocatePort           *       &40014
   ;Entry
   ;  R0 = port (Byte)

XEconet_ClaimPort               *       &60015
Econet_ClaimPort                *       &40015
   ;Entry
   ;  R0 = port (Byte)

XEconet_StartImmediate          *       &60016
Econet_StartImmediate           *       &40016
   ;Entry
   ;  R0 = op_type (Econet_ImmediateOp)
   ;  R1 = procedure (Econet_ImmediateOSProcedure)
   ;  R2 = station (Byte)
   ;  R3 = net (Byte)
   ;  R4 = buffer (pointer to data)
   ;  R5 = size (Int)
   ;  R6 = count (Int)
   ;  R7 = delay (Int)
   ;Exit
   ;  R0 = tx_cb (Econet_TxCB)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted
   ;  R4 = nonlocal (Bool)

XEconet_DoImmediate             *       &60017
Econet_DoImmediate              *       &40017
   ;Entry
   ;  R0 = op_type (Econet_ImmediateOp)
   ;  R1 = procedure (Econet_ImmediateOSProcedure)
   ;  R2 = station (Byte)
   ;  R3 = net (Byte)
   ;  R4 = buffer (pointer to data)
   ;  R5 = size (Int)
   ;  R6 = count (Int)
   ;  R7 = delay (Int)
   ;Exit
   ;  R0 = status (Econet_Status)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted
   ;  R4 = nonlocal (Bool)

XEconet_AbandonAndReadReceive   *       &60018
Econet_AbandonAndReadReceive    *       &40018
   ;Entry
   ;  R0 = rx_cb (Econet_RxCB)
   ;Exit
   ;  R0 = status (Econet_Status)
   ;  R1 = flag (Byte)
   ;  R2 = port (Byte)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)
   ;  R5 = buffer (pointer to data)
   ;  R6 = size (Int)

XEconet_Version                 *       &60019
Econet_Version                  *       &40019
   ;Entry
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)
   ;Exit
   ;  R2 = version (Int)

XEconet_NetworkState            *       &6001A
Econet_NetworkState             *       &4001A
   ;Entry
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)
   ;Exit
   ;  R2 = state (Econet_State)

XEconet_PacketSize              *       &6001B
Econet_PacketSize               *       &4001B
   ;Entry
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)
   ;Exit
   ;  R2 = packet_limit (Int)

XEconet_ReadTransportName       *       &6001C
Econet_ReadTransportName        *       &4001C
   ;Entry
   ;  R0 = station (Byte)
   ;  R1 = net (Byte)
   ;Exit
   ;  R2 -> transport_name (String)

XEconet_InetRxDirect            *       &6001D
Econet_InetRxDirect             *       &4001D

XEconet_EnumerateMap            *       &6001E
Econet_EnumerateMap             *       &4001E
   ;Entry
   ;  R0 = flags (Econet_MapFlags)
   ;  R4 = context (Int)
   ;Exit
   ;  R1 = net (Byte)
   ;  R2 -> net_name (String)
   ;  R3 = ip_subnetwork_address (Int)
   ;  R4 = context_out (Int)

XEconet_EnumerateTransmit       *       &6001F
Econet_EnumerateTransmit        *       &4001F
   ;Entry
   ;  R0 = tx_cb_no (Int)
   ;Exit
   ;  R0 = tx_cb (Econet_TxCB)

XEconet_HardwareAddresses       *       &60020
Econet_HardwareAddresses        *       &40020
   ;Exit
   ;  R0 = hardware_address (pointer to data)
   ;  R1 = register_address (pointer to data)
   ;  R2 = register_mask (Bits)

XEconet_NetworkParameters       *       &60021
Econet_NetworkParameters        *       &40021
   ;Exit
   ;  R0 = period (Int)
   ;  R1 = frequency (Int)
   ;  R2 corrupted
   ;  R3 corrupted

EconetV                         *       &21
   ;Entry
   ;  R0 = action (Econet_Action)
   ;  R1 = count (Int)
   ;  R9 = &21

Service_ReallocatePorts         *       &48
   ;Entry
   ;  R1 = &48

Service_EconetDying             *       &56
   ;Entry
   ;  R1 = &56

Service_ProtocolDying           *       &83
   ;Entry
   ;  R1 = &83

Service_FindNetworkDriver       *       &84
   ;Entry
   ;  R1 = &84

Service_NetworkDriverStatus     *       &8B
   ;Entry
   ;  R1 = &8B

Event_EconetUserRPC             *       &8
   ;Entry
   ;  R0 = &8
   ;  R1 -> args (data)
   ;  R2 = procedure (Econet_ImmediateOSProcedure)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)

Event_EconetRx                  *       &E
   ;Entry
   ;  R0 = &E
   ;  R1 = rx_cb (Econet_RxCB)
   ;  R2 = status (Econet_Status)

Event_EconetTx                  *       &F
   ;Entry
   ;  R0 = &F
   ;  R1 = tx_cb (Econet_TxCB)
   ;  R2 = status (Econet_Status)

Event_EconetOSProc              *       &10
   ;Entry
   ;  R0 = &10
   ;  R1 -> args (data)
   ;  R2 = procedure (Econet_ImmediateOSProcedure)
   ;  R3 = station (Byte)
   ;  R4 = net (Byte)

        ]

        END
