Skip to content

Commit

Permalink
mbf64: Add pow/exp
Browse files Browse the repository at this point in the history
  • Loading branch information
suborb committed Apr 22, 2019
1 parent 55cad6c commit 476638d
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
41 changes: 41 additions & 0 deletions libsrc/math/mbf64/c/sccz80/___mbf64_setup_two_single.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
SECTION code_fp_mbf64

PUBLIC ___mbf64_setup_single_two
EXTERN ___mbf32_FPREG
EXTERN ___mbf32_VALTYP


; Used for the routines which accept single precision
;
; Entry: -
; Stack: +0 defw return address
; +2 defw callee return address
; +4 defw right hand LSW
; +6 defw right hand NLSW
; +8 defw right hand NMSW
; +10 defw right hand MSW
; +12 defw left hand LSW
; +14 defw left hand NLSW
; +16 defw left hand NMSW
; +18 defw lefthand MSW
___mbf64_setup_single_two:
ld a,4
ld (___mbf32_VALTYP),a
ld hl,8
add hl,sp
ld de,___mbf32_FPREG ;Store the right hand
ld bc,4
ldir
ld bc,4
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld c,(hl)
inc hl
ld b,(hl)
pop hl
push ix
push hl
ret
13 changes: 13 additions & 0 deletions libsrc/math/mbf64/c/sccz80/exp.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SECTION code_fp_mbf64

PUBLIC exp
EXTERN ___mbf64_setup_two_single
EXTERN ___mbf32_EXP
EXTERN ___mbf64_return_single
EXTERN msbios

exp:
call ___mbf64_setup_two_single
ld ix,___mbf32_EXP
call msbios
jp ___mbf64_return_single
13 changes: 13 additions & 0 deletions libsrc/math/mbf64/c/sccz80/pow.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SECTION code_fp_mbf64

PUBLIC pow
EXTERN ___mbf64_setup_two_single
EXTERN ___mbf32_POW
EXTERN ___mbf64_return_single
EXTERN msbios

pow:
call ___mbf64_setup_two_single
ld ix,___mbf32_POW
call msbios
jp ___mbf64_return_single

0 comments on commit 476638d

Please sign in to comment.