;Assembler header file for HAL
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:03:53 2005
;Tom Hughes, tom@compton.nu, 23 Nov 2002

        [       :LNOT: :DEF: HAL_Hdr
        GBLS    HAL_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 structure offsets and sizes
                                ^       0
                                #       Int
HAL_Device                      *       @

                                ^       0
                                #       Int
HAL_Timer                       *       @


;Symbols for SWI's and SWI reason codes
HAL_IRQEnable                   *       &1
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &1
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQDisable                  *       &2
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &2
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQClear                    *       &3
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &3
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQSource                   *       &4
   ;Entry
   ;  R8 = &0
   ;  R9 = &4
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQStatus                   *       &5
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &5
   ;Exit
   ;  R0 = requested (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQEnable                   *       &6
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &6
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQDisable                  *       &7
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &7
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQDisableAll               *       &8
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &8
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQClear                    *       &9
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &9
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQSource                   *       &A
   ;Entry
   ;  R8 = &0
   ;  R9 = &A
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQStatus                   *       &B
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &B
   ;Exit
   ;  R0 = requested (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_Timers                      *       &C
   ;Entry
   ;  R8 = &0
   ;  R9 = &C
   ;Exit
   ;  R0 = timers (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerDevice                 *       &D
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &D
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerGranularity            *       &E
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &E
   ;Exit
   ;  R0 = granularity (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerMaxPeriod              *       &F
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &F
   ;Exit
   ;  R0 = max_period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerSetPeriod              *       &10
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R1 = period (Int)
   ;  R8 = &0
   ;  R9 = &10
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerPeriod                 *       &11
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &11
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerReadCountdown          *       &12
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &12
   ;Exit
   ;  R0 = time_remaining (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterRate                 *       &13
   ;Entry
   ;  R8 = &0
   ;  R9 = &13
   ;Exit
   ;  R0 = rate (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterPeriod               *       &14
   ;Entry
   ;  R8 = &0
   ;  R9 = &14
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterRead                 *       &15
   ;Entry
   ;  R8 = &0
   ;  R9 = &15
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterDelay                *       &16
   ;Entry
   ;  R0 = delay (Int)
   ;  R8 = &0
   ;  R9 = &16
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

        ]
        END
