@ GNU AS assembler header file for FPEmulator
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:45:17 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.

#ifndef FPEmulator_Hdr
#  define FPEmulator_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

@Symbols for constants
#  define FPEmulator_NoContext 0x0
#  define FPEmulator_DefaultContext 0xffffffff
#  define FPEmulator_CurrentContext 0xfffffffe
#  define FPEmulator_FPSRCumulativeIVO 0x1
#  define FPEmulator_FPSRCumulativeDVZ 0x2
#  define FPEmulator_FPSRCumulativeOFL 0x4
#  define FPEmulator_FPSRCumulativeUFL 0x8
#  define FPEmulator_FPSRCumulativeINX 0x10
#  define FPEmulator_FPSRControlND 0x100
#  define FPEmulator_FPSRControlNE 0x200
#  define FPEmulator_FPSRControlSO 0x400
#  define FPEmulator_FPSRControlEP 0x800
#  define FPEmulator_FPSRControlAC 0x1000
#  define FPEmulator_FPSREnableIVO 0x10000
#  define FPEmulator_FPSREnableDVZ 0x20000
#  define FPEmulator_FPSREnableOFL 0x40000
#  define FPEmulator_FPSREnableUFL 0x80000
#  define FPEmulator_FPSREnableINX 0x100000
#  define FPEmulator_FPSRSystemID 0xff000000
#  define FPEmulator_FPSRSystemIDShift 0x18
#  define FPEmulator_FPSRSystemClass 0x80000000
#  define FPEmulator_FPSRSystemClassShift 0x1f
#  define FPEmulator_SystemOldFPE 0x0
#  define FPEmulator_SystemFPE400 0x1
#  define FPEmulator_SystemFPPC 0x80
#  define FPEmulator_SystemFPA 0x81
#  define FPEmulator_ClassSoftware 0x0
#  define FPEmulator_ClassHardware 0x1

@Symbols for structure offsets and sizes
@ abstract type
#  define FPEmulator_Context 4

        .struct 0
        .skip   Bits
FPEmulator_FPSR                : 

        .struct 0
FPEmulator_RegisterDump_fpsr   : .skip   FPEmulator_FPSR
FPEmulator_RegisterDump_f0     : .skip   12*Byte
FPEmulator_RegisterDump_f1     : .skip   12*Byte
FPEmulator_RegisterDump_f2     : .skip   12*Byte
FPEmulator_RegisterDump_f3     : .skip   12*Byte
FPEmulator_RegisterDump_f4     : .skip   12*Byte
FPEmulator_RegisterDump_f5     : .skip   12*Byte
FPEmulator_RegisterDump_f6     : .skip   12*Byte
FPEmulator_RegisterDump_f7     : .skip   12*Byte
FPEmulator_RegisterDump        : 


@Symbols for SWI's and SWI reason codes
.set XFPEmulator_Version,0x60480
.set FPEmulator_Version,0x40480
   @Exit
   @  R0 = version (Int)

.set XFPEmulator_DeactivateContext,0x60481
.set FPEmulator_DeactivateContext,0x40481
   @Exit
   @  R0 = old_context (FPEmulator_Context)

.set XFPEmulator_ActivateContext,0x60482
.set FPEmulator_ActivateContext,0x40482
   @Entry
   @  R0 = new_context (FPEmulator_Context)

.set XFPEmulator_ChangedContext,0x60483
.set FPEmulator_ChangedContext,0x40483
   @Entry
   @  R0 = new_context (FPEmulator_Context)
   @Exit
   @  R0 = old_context (FPEmulator_Context)

.set XFPEmulator_ContextLength,0x60484
.set FPEmulator_ContextLength,0x40484
   @Exit
   @  R0 = context_length (Int)

.set XFPEmulator_InitContext,0x60485
.set FPEmulator_InitContext,0x40485
   @Entry
   @  R0 = context (FPEmulator_Context)

.set XFPEmulator_ExceptionDump,0x60486
.set FPEmulator_ExceptionDump,0x40486
   @Exit
   @  R0 = register_dump (pointer to FPEmulator_RegisterDump)

.set XFPEmulator_Abort,0x60487
.set FPEmulator_Abort,0x40487
   @Entry
   @  R0 = context (FPEmulator_Context)
   @  R1 = r12_value (Int)
   @  R2 = pc_value (Int)
   @Exit
   @  R0 = frame (pointer to data)

.set XFPEmulator_LoadContext,0x60488
.set FPEmulator_LoadContext,0x40488
   @Entry
   @  R0 = context (FPEmulator_Context)
   @  R1 -> register_dump (FPEmulator_RegisterDump)

.set XFPEmulator_SaveContext,0x60489
.set FPEmulator_SaveContext,0x40489
   @Entry
   @  R0 = context (FPEmulator_Context)
   @  R1 = register_dump (pointer to FPEmulator_RegisterDump)
   @  R2 = pc_value (Int)
   @Exit
   @  R0 = has_exception (Bool)

#endif
