; Assembler header file for Podule
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:51 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
;    You should have received a copy of the GNU General Public License
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: Podule_Hdr
        GBLS    Podule_Hdr

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

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

;Symbols for constants
Podule_SectionSystemROM         *       &FFFFFFFF
Podule_SectionExpansionCard0    *       &0
Podule_SectionExpansionCard1    *       &1
Podule_SectionExpansionCard2    *       &2
Podule_SectionExpansionCard3    *       &3
Podule_SectionExtensionROM1     *       &FFFFFFFE
Error_PoduleBadPod              *       &500
Error_PoduleBadSpeed            *       &501
Error_PoduleNoPod               *       &502
Error_PoduleNotExt              *       &503
Error_PoduleNotAcrn             *       &504
Error_PoduleNoLdr               *       &505
Error_PoduleInLdr               *       &506
Error_PoduleBadChnk             *       &507
Error_PoduleBadDeviceNumber     *       &508
Error_PoduleBadDeviceType       *       &509
Error_PoduleRAMConfigSyntax     *       &50A
Error_PoduleWrongPoduleType     *       &50B
Error_PoduleROMBoardSyntax      *       &50C
Error_PoduleBadRead             *       &50D
Error_PoduleBdSpeed             *       &50E
Error_PoduleNotEASI             *       &50F
Error_PoduleSpeedNo             *       &510
Error_PoduleECNoSpd             *       &511
Error_PoduleECNoNet             *       &512
Error_PoduleNDallas             *       &513
Error_PoduleNotWritable         *       &580
Error_PoduleAddressRange        *       &581
Error_PoduleDeviceNotWritable   *       &582
Error_PodulePoduleReadOnly      *       &583
Error_PoduleAddressTooBig       *       &584

;Symbols for structure offsets and sizes
        ^       0
        #       Int
Podule_Section                  *       @

        ^       0
Podule_Header_b                 #       16*Byte
Podule_Header                   *       @


;Symbols for SWI's and SWI reason codes
XPodule_ReadID                  *       &60280
Podule_ReadID                   *       &40280
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = ec_id (Int)

XPodule_ReadHeader              *       &60281
Podule_ReadHeader               *       &40281
   ;Entry
   ;  R2 = header (pointer to Podule_Header)
   ;  R3 = section (Podule_Section)

XPodule_EnumerateChunks         *       &60282
Podule_EnumerateChunks          *       &40282
   ;Entry
   ;  R0 = context (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = context_out (Int)
   ;  R1 = size (Int)
   ;  R2 = os_id (Byte)
   ;  R4 -> module_name (String)

XPodule_ReadChunk               *       &60283
Podule_ReadChunk                *       &40283
   ;Entry
   ;  R0 = chunk_no (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = section (Podule_Section)

XPodule_ReadBytes               *       &60284
Podule_ReadBytes                *       &40284
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = slot_no (Int)

XPodule_WriteBytes              *       &60285
Podule_WriteBytes               *       &40285
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 -> buffer (data)
   ;  R3 = slot_no (Int)

XPodule_CallLoader              *       &60286
Podule_CallLoader               *       &40286
   ;Entry
   ;  R0 = arg0 (Int)
   ;  R1 = arg1 (Int)
   ;  R2 = arg2 (Int)
   ;  R3 = slot_no (Int)
   ;Exit
   ;  R0 = arg0_out (Int)
   ;  R1 = arg1_out (Int)
   ;  R2 = arg2_out (Int)

XPodule_RawRead                 *       &60287
Podule_RawRead                  *       &40287
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 = buffer (pointer to data)
   ;  R3 = slot_no (Int)

XPodule_RawWrite                *       &60288
Podule_RawWrite                 *       &40288
   ;Entry
   ;  R0 = start_offset (Int)
   ;  R1 = size (Int)
   ;  R2 -> buffer (data)
   ;  R3 = slot_no (Int)

XPodule_HardwareAddress         *       &60289
Podule_HardwareAddress          *       &40289
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R3 = combined_addr (pointer to Int)

XPodule_EnumerateChunksWithInfo *       &6028A
Podule_EnumerateChunksWithInfo  *       &4028A
   ;Entry
   ;  R0 = context (Int)
   ;  R3 = section (Podule_Section)
   ;  R6 = &1
   ;Exit
   ;  R0 = context_out (Int)
   ;  R1 = size (Int)
   ;  R2 = os_id (Byte)
   ;  R4 -> module_name (String)
   ;  R5 -> help_text (String)
   ;  R6 = module_base (pointer to Int)

XPodule_HardwareAddresses       *       &6028B
Podule_HardwareAddresses        *       &4028B
   ;Entry
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = base_addr (pointer to Int)
   ;  R1 = combined_addr (pointer to Int)

XPodule_ReturnNumber            *       &6028C
Podule_ReturnNumber             *       &4028C
   ;Exit
   ;  R0 = expansion_card_count (Int)
   ;  R1 = extension_rom_count (Int)

XPodule_ReadInfo                *       &6028D
Podule_ReadInfo                 *       &4028D
   ;Entry
   ;  R0 = mask (Bits)
   ;  R1 = buffer (pointer to data)
   ;  R2 = size (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R2 = used (Int)

XPodule_SetSpeed                *       &6028E
Podule_SetSpeed                 *       &4028E
   ;Entry
   ;  R0 = speed (Int)
   ;  R3 = section (Podule_Section)
   ;Exit
   ;  R0 = old_speed (Int)

Service_PreReset                *       &45
   ;Entry
   ;  R1 = &45

Service_ADFSPodule              *       &10800
   ;Entry
   ;  R1 = &10800
   ;  R2 = controller (pointer to data)
   ;  R3 = status_location (pointer to Int)
   ;  R4 = status_bits (Bits)
   ;  R5 = irq_location (pointer to Int)
   ;  R6 = irq_bits (Bits)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R2 = controller_out (pointer to data)
   ;  R3 = status_location_out (pointer to Int)
   ;  R4 = status_bits_out (Bits)
   ;  R5 = irq_location_out (pointer to Int)
   ;  R6 = irq_bits_out (Bits)

Service_ADFSPoduleIDE           *       &10801
   ;Entry
   ;  R1 = &10801
   ;  R2 = controller (pointer to data)
   ;  R3 = status_location (pointer to Int)
   ;  R4 = status_bits (Bits)
   ;  R5 = irq_location (pointer to Int)
   ;  R6 = irq_bits (Bits)
   ;  R7 = read_code (pointer to code)
   ;  R8 = write_code (pointer to code)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R2 = controller_out (pointer to data)
   ;  R3 = status_location_out (pointer to Int)
   ;  R4 = status_bits_out (Bits)
   ;  R5 = irq_location_out (pointer to Int)
   ;  R6 = irq_bits_out (Bits)
   ;  R7 = read_code_out (pointer to code)
   ;  R8 = write_code_out (pointer to code)

Service_ADFSPoduleIDEDying      *       &10802
   ;Entry
   ;  R1 = &10802

        ]
        END
