; Assembler header file for FPEmulator
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:51 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 29 Apr 1994

; 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: FPEmulator_Hdr
        GBLS    FPEmulator_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
FPEmulator_NoContext            *       &0
FPEmulator_DefaultContext       *       &FFFFFFFF
FPEmulator_CurrentContext       *       &FFFFFFFE
FPEmulator_FPSRCumulativeIVO    *       &1
FPEmulator_FPSRCumulativeDVZ    *       &2
FPEmulator_FPSRCumulativeOFL    *       &4
FPEmulator_FPSRCumulativeUFL    *       &8
FPEmulator_FPSRCumulativeINX    *       &10
FPEmulator_FPSRControlND        *       &100
FPEmulator_FPSRControlNE        *       &200
FPEmulator_FPSRControlSO        *       &400
FPEmulator_FPSRControlEP        *       &800
FPEmulator_FPSRControlAC        *       &1000
FPEmulator_FPSREnableIVO        *       &10000
FPEmulator_FPSREnableDVZ        *       &20000
FPEmulator_FPSREnableOFL        *       &40000
FPEmulator_FPSREnableUFL        *       &80000
FPEmulator_FPSREnableINX        *       &100000
FPEmulator_FPSRSystemID         *       &FF000000
FPEmulator_FPSRSystemIDShift    *       24
FPEmulator_FPSRSystemClass      *       &80000000
FPEmulator_FPSRSystemClassShift *       31
FPEmulator_SystemOldFPE         *       0
FPEmulator_SystemFPE400         *       1
FPEmulator_SystemFPPC           *       128
FPEmulator_SystemFPA            *       129
FPEmulator_ClassSoftware        *       0
FPEmulator_ClassHardware        *       1

;Symbols for structure offsets and sizes
FPEmulator_Context              *       4 ;abstract type
        ^       0
        #       Bits
FPEmulator_FPSR                 *       @

        ^       0
FPEmulator_RegisterDump_fpsr    #       FPEmulator_FPSR
FPEmulator_RegisterDump_f0      #       12*Byte
FPEmulator_RegisterDump_f1      #       12*Byte
FPEmulator_RegisterDump_f2      #       12*Byte
FPEmulator_RegisterDump_f3      #       12*Byte
FPEmulator_RegisterDump_f4      #       12*Byte
FPEmulator_RegisterDump_f5      #       12*Byte
FPEmulator_RegisterDump_f6      #       12*Byte
FPEmulator_RegisterDump_f7      #       12*Byte
FPEmulator_RegisterDump         *       @


;Symbols for SWI's and SWI reason codes
XFPEmulator_Version             *       &60480
FPEmulator_Version              *       &40480
   ;Exit
   ;  R0 = version (Int)

XFPEmulator_DeactivateContext   *       &60481
FPEmulator_DeactivateContext    *       &40481
   ;Exit
   ;  R0 = old_context (FPEmulator_Context)

XFPEmulator_ActivateContext     *       &60482
FPEmulator_ActivateContext      *       &40482
   ;Entry
   ;  R0 = new_context (FPEmulator_Context)

XFPEmulator_ChangedContext      *       &60483
FPEmulator_ChangedContext       *       &40483
   ;Entry
   ;  R0 = new_context (FPEmulator_Context)
   ;Exit
   ;  R0 = old_context (FPEmulator_Context)

XFPEmulator_ContextLength       *       &60484
FPEmulator_ContextLength        *       &40484
   ;Exit
   ;  R0 = context_length (Int)

XFPEmulator_InitContext         *       &60485
FPEmulator_InitContext          *       &40485
   ;Entry
   ;  R0 = context (FPEmulator_Context)

XFPEmulator_ExceptionDump       *       &60486
FPEmulator_ExceptionDump        *       &40486
   ;Exit
   ;  R0 = register_dump (pointer to FPEmulator_RegisterDump)

XFPEmulator_Abort               *       &60487
FPEmulator_Abort                *       &40487
   ;Entry
   ;  R0 = context (FPEmulator_Context)
   ;  R1 = r12_value (Int)
   ;  R2 = pc_value (Int)
   ;Exit
   ;  R0 = frame (pointer to data)

XFPEmulator_LoadContext         *       &60488
FPEmulator_LoadContext          *       &40488
   ;Entry
   ;  R0 = context (FPEmulator_Context)
   ;  R1 -> register_dump (FPEmulator_RegisterDump)

XFPEmulator_SaveContext         *       &60489
FPEmulator_SaveContext          *       &40489
   ;Entry
   ;  R0 = context (FPEmulator_Context)
   ;  R1 = register_dump (pointer to FPEmulator_RegisterDump)
   ;  R2 = pc_value (Int)
   ;Exit
   ;  R0 = has_exception (Bool)

        ]
        END
