home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d183
/
pcq
/
runtime
/
math.asm
< prev
next >
Wrap
Assembly Source File
|
1989-02-25
|
2KB
|
108 lines
* Math.asm (of PCQ Pascal runtime library)
* Copyright (c) 1989 Patrick Quaid
* This file has the stubs that implement floating point math. This
* is yet another group of routines for which you don't need to open
* your own library. The only trick here is that if the divisor in
* SPDiv is zero, you'll get a run-time error. If you look at
* the code for this you may get confused. It works because it turns
* out that floating point zero and integer zero have the same
* representation.
XREF _p%MathBase
XREF _exit
SECTION MATH
XDEF _SPFix
_SPFix
move.l 4(sp),d0
move.l _p%MathBase,a6
jsr _LVOSPFix(a6)
rts
XDEF _SPFloat
_SPFloat
move.l 4(sp),d0
move.l _p%MathBase,a6
jsr _LVOSPFlt(a6)
rts
XDEF _SPCmp
_SPCmp
move.l 8(sp),d0
move.l 4(sp),d1
move.l _p%MathBase,a6
jsr _LVOSPCmp(a6)
rts
XDEF _SPTst
_SPTst
move.l 4(sp),d1
move.l _p%MathBase,a6
jsr _LVOSPTst(a6)
rts
XDEF _SPAbs
_SPAbs
move.l 4(sp),d0
move.l _p%MathBase,a6
jsr _LVOSPAbs(a6)
rts
XDEF _SPNeg
_SPNeg
move.l 4(sp),d0
move.l _p%MathBase,a6
jsr _LVOSPNeg(a6)
rts
XDEF _SPAdd
_SPAdd
move.l 8(sp),d0
move.l 4(sp),d1
move.l _p%MathBase,a6
jsr _LVOSPAdd(a6)
rts
XDEF _SPSub
_SPSub
move.l 8(sp),d0
move.l 4(sp),d1
move.l _p%MathBase,a6
jsr _LVOSPSub(a6)
rts
XDEF _SPMul
_SPMul
move.l 8(sp),d0
move.l 4(sp),d1
move.l _p%MathBase,a6
jsr _LVOSPMul(a6)
rts
XDEF _SPDiv
_SPDiv
move.l 8(sp),d0
move.l 4(sp),d1
bne.s 1$
move.l #51,d0
jmp _exit
1$ move.l _p%MathBase,a6
jsr _LVOSPDiv(a6)
rts
XREF _LVOSPFix
XREF _LVOSPFlt
XREF _LVOSPCmp
XREF _LVOSPTst
XREF _LVOSPAbs
XREF _LVOSPNeg
XREF _LVOSPAdd
XREF _LVOSPSub
XREF _LVOSPMul
XREF _LVOSPDiv
END