pow_f implemented

This commit is contained in:
Irmen de Jong 2019-03-31 14:28:38 +02:00
parent 83ace753b2
commit 03d0411679
2 changed files with 52 additions and 34 deletions

View File

@ -540,7 +540,8 @@ pop_2_floats_f2_in_fac1 .proc
ldy #>fmath_float2
jmp c64flt.MOVFM
.pend
fmath_float1 .byte 0,0,0,0,0 ; storage for a mflpt5 value
fmath_float2 .byte 0,0,0,0,0 ; storage for a mflpt5 value
@ -555,7 +556,25 @@ push_fac1_as_result .proc
jmp push_float
.pend
pow_f .proc
; -- push f1 ** f2 on stack
lda #<fmath_float2
ldy #>fmath_float2
jsr pop_float
lda #<fmath_float1
ldy #>fmath_float1
jsr pop_float
stx c64.SCRATCH_ZPREGX
lda #<fmath_float1
ldy #>fmath_float1
jsr c64flt.CONUPK ; fac2 = float1
lda #<fmath_float2
ldy #>fmath_float2
jsr c64flt.FPWR
ldx c64.SCRATCH_ZPREGX
jmp push_fac1_as_result
.pend
div_f .proc
; -- push f1/f2 on stack
jsr pop_2_floats_f2_in_fac1

View File

@ -13,52 +13,51 @@
float fl=2.3
float fl2=20
ub = ub ** 7
c64scr.print_ub(ub)
c64.CHROUT('\n')
uw = uw ** 5
c64scr.print_uw(uw)
c64.CHROUT('\n')
; ub = ub ** 7
; c64scr.print_ub(ub)
; c64.CHROUT('\n')
; uw = uw ** 5
; c64scr.print_uw(uw)
; c64.CHROUT('\n')
fl = fl ** 20.0
c64flt.print_f(fl)
c64.CHROUT('\n')
ub=3 ; @todo no instruction?
ub **=7 ; @todo no instruction?
c64scr.print_ub(ub)
c64.CHROUT('\n')
uw = 9 ; @todo no instruction?
uw **=5 ; @todo no instruction?
c64scr.print_uw(uw)
c64.CHROUT('\n')
fl = 2 ; @todo no instruction?
; ub=3 ; @todo no instruction?
; ub **=7 ; @todo no instruction?
; c64scr.print_ub(ub)
; c64.CHROUT('\n')
; uw = 9 ; @todo no instruction?
; uw **=5 ; @todo no instruction?
; c64scr.print_uw(uw)
; c64.CHROUT('\n')
fl = 2.3 ; @todo no instruction?
fl **=20.0 ; @todo no instruction?
c64flt.print_f(fl)
c64.CHROUT('\n')
ub=3
ub **= 7
c64scr.print_ub(ub)
c64.CHROUT('\n')
uw = 9
uw **= 5
c64scr.print_uw(uw)
c64.CHROUT('\n')
; ub=3
; ub **= 7
; c64scr.print_ub(ub)
; c64.CHROUT('\n')
; uw = 9
; uw **= 5
; c64scr.print_uw(uw)
; c64.CHROUT('\n')
fl = 2.3
fl **= 20.0
c64flt.print_f(fl)
c64.CHROUT('\n')
ub=3
ub **= ub2
c64scr.print_ub(ub)
c64.CHROUT('\n')
uw = 9
uw **= uw2
c64scr.print_uw(uw)
c64.CHROUT('\n')
; ub=3
; ub **= ub2
; c64scr.print_ub(ub)
; c64.CHROUT('\n')
; uw = 9
; uw **= uw2
; c64scr.print_uw(uw)
; c64.CHROUT('\n')
fl = 2.3
fl **= fl2
c64flt.print_f(fl)