supermario/base/SuperMarioProj.1994-02-09/OS/FPUEmulation/FPEmulation.a
2019-06-29 23:17:50 +08:00

111 lines
3.9 KiB
Plaintext

;
; File: FPEmulation.a
;
; Contains: Main file where FPU Emulation Package is assembled from
; - also contains only EXPORTed entry point (InstallFPSP).
;
; Originally Written by: Motorola Inc.
; Adapted to Apple/MPW: Jon Okada
;
; Copyright: © 1990-1993 by Apple Computer, Inc., all rights reserved.
;
; This file is used in these builds: Mac32
;
; Change History (most recent first):
;
; <SM2> 2/3/93 CSS Update from Horror:
; <H2> 11/18/92 BG Added a check to the InstallFPSP code so that it does NOT
; install itself if running on an 68LC040.
; ———————————————————————————————————————————————————————————————————————————————————————
; Pre-Horror ROM comments begin here.
; ———————————————————————————————————————————————————————————————————————————————————————
; <3> 3/30/91 BG New package based on Motorola Release 1.0 with numerous bug
; fixes added
; <2> 2/1/91 BG Added code to go to the original system F-Line handler if the
; FPU emulation package does not know what to do with a given
; F-Line instruction that it encounters.
; <1> 12/14/90 BG First checked into TERROR/BBS.
MACHINE MC68040
BLANKS OFF
INCLUDE 'fpsp.h'
INCLUDE 'SysEqu.a' ; get the names of various Exception Vectors
PrNonPortable EQU 1 ; needed to get HWCfgFlags to be defined in Private.a <H2>
INCLUDE 'Private.a' ; get definition of HWCfgFlags <H2>
INCLUDE 'HardwarePrivateEqu.a'; get definition of hwCbFPU, etc. <H2>
; ________________________________________________________________________________
;
; subroutine InstallFPSP()---installs MC68040 FPSP (MC68881/2 emulation) and
; dummy user handlers.
; uses: a0/a1.
; ________________________________________________________________________________
InstallFPSP PROC EXPORT
ALIGN 16
; Don't install on 040s that don't have FPUs. <H2>
btst.b #hwCbFPU-8,HWCfgFlags; FPU installed on board? <H2>
beq.s @exit ; exit if we don't have a HW FPU <H2>
movec.l VBR,a0 ; get vector base register
move.l Line1111(a0),(FLINE_VEC040).W; save original vector for unknown F-Lines <T2>
lea fline,a1
move.l a1,Line1111(a0) ; vector FLINE to emulation code
lea bsun,a1
move.l a1,BSUNVector(a0) ; vector BSUN to emulation code
lea unfl,a1
move.l a1,UNFLVector(a0) ; vector UNFL to emulation code
lea operr,a1
move.l a1,OPERRVector(a0) ; vector OPERR to emulation code
lea ovfl,a1
move.l a1,OVFLVector(a0) ; vector OVFL to emulation code
lea snan,a1
move.l a1,SNANVector(a0) ; vector SNAN to emulation code
lea unsupp,a1
move.l a1,UNIMPDTVector(a0); vector UNSUPP to emulation code
@exit ; <H2>
RTS
; ________________________________________________________________________________
;
; All of the FPU Emulation package is included below in one big assembly.
INCLUDE 'FPSPMain.a'
INCLUDE 'XBSUN.a'
INCLUDE 'XOpErr.a'
INCLUDE 'XOvfl.a'
INCLUDE 'XSNAN.a'
INCLUDE 'XUnfl.a'
INCLUDE 'XFLine.a'
INCLUDE 'XUnSupp.a'
INCLUDE 'XUnImp.a'
INCLUDE 'BugFix.a' ; special fix for D43B hardware bug
INCLUDE 'GenExcept.a'
INCLUDE 'GetOp.a'
INCLUDE 'DecBin.a'
INCLUDE 'XStore.a'
INCLUDE 'ResFunc.a'
INCLUDE 'Round.a'
INCLUDE 'BinDec.a'
INCLUDE 'Util.a'
INCLUDE 'KernelEx.a'
INCLUDE 'DoFunc.a'
INCLUDE 'GetEM.a'
INCLUDE 'Int.a'
INCLUDE 'MoveCR.a'
INCLUDE 'RemMod.a'
INCLUDE 'Scale.a'
INCLUDE 'Hyperbolic.a'
INCLUDE 'Trig.a'
INCLUDE 'Power.a'
INCLUDE 'InvTrig.a'
INCLUDE 'Log.a'
INCLUDE 'Constants.a'
END