mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-09 13:33:26 +00:00
Add fppow sample test
This commit is contained in:
parent
54fba4e12f
commit
177c621364
@ -198,6 +198,7 @@ cp samplesrc/gfxdemo.pla prodos/bld/samples/GFXDEMO.PLA.TXT
|
||||
cp samplesrc/lz4cat.pla prodos/bld/samples/Z4CAT.PLA.TXT
|
||||
cp samplesrc/sfm.pla prodos/bld/samples/SFM.PLA.TXT
|
||||
cp samplesrc/sfmsprt.pla prodos/bld/samples/SFMSPRT.PLA.TXT
|
||||
cp samplesrc/fppow.pla prodos/bld/samples/FPPOW.PLA.TXT
|
||||
cp utilsrc/apple/mon.pla prodos/bld/samples/MON.PLA.TXT
|
||||
cp utilsrc/apple/zipchip.pla prodos/bld/samples/ZIPCHIP.PLA.TXT
|
||||
|
||||
|
44
src/samplesrc/fppow.pla
Normal file
44
src/samplesrc/fppow.pla
Normal file
@ -0,0 +1,44 @@
|
||||
include "inc/cmdsys.plh"
|
||||
include "inc/sane.plh"
|
||||
include "inc/fpstr.plh"
|
||||
|
||||
var xT[t_extended]
|
||||
char sT[32] // extra space
|
||||
byte str = "123456789.123456789E+80"
|
||||
byte i
|
||||
|
||||
// mul div
|
||||
def test(iM, iD)#0
|
||||
sane:saveZP()
|
||||
sane:op2FP(FFINT|FOMUL, @xT, @iM)
|
||||
sane:op2FP(FFINT|FODIV, @xT, @iD)
|
||||
sane:restoreZP(0)
|
||||
|
||||
putc('x')
|
||||
if iM<10; putc(' '); fin
|
||||
puti(iM); putc('/'); puti(iD)
|
||||
if iD<10; putc(' '); fin
|
||||
puts("=>")
|
||||
ext2str(@xT,@sT,6,9,FPSTR_FLEX|FPSTR_FIXED) // fixed
|
||||
puts(@sT); putc('[')
|
||||
puti( sT); putc(']')
|
||||
putln
|
||||
end
|
||||
|
||||
puts("Float Format Text\n\n")
|
||||
sane:initFP()
|
||||
strcpy(@sT,@str); str2ext(@sT,@xT)
|
||||
puts("begin: ")
|
||||
puts(@sT); putc('[')
|
||||
puti( sT); putc(']')
|
||||
putln
|
||||
test(1,1)
|
||||
for i=1 to 10
|
||||
test(32000,1)
|
||||
next
|
||||
strcpy(@sT,@str); str2ext(@sT,@xT)
|
||||
for i=1 to 10
|
||||
test(1,2)
|
||||
next
|
||||
puts("Done\n")
|
||||
done
|
@ -57,5 +57,6 @@ echo "BLD/SAMPLES/GFXDEMO.PLA"; atftp $1 --put -l samplesrc/gfxdemo.pla -r $
|
||||
echo "BLD/SAMPLES/LZ4CAT.PLA"; atftp $1 --put -l samplesrc/lz4cat.pla -r $2/BLD/SAMPLES/LZ4CAT.PLA#040000
|
||||
echo "BLD/SAMPLES/SFM.PLA"; atftp $1 --put -l samplesrc/sfm.pla -r $2/BLD/SAMPLES/SFM.PLA#040000
|
||||
echo "BLD/SAMPLES/SFMSPRT.PLA"; atftp $1 --put -l samplesrc/sfmsprt.pla -r $2/BLD/SAMPLES/SFMSPRT.PLA#040000
|
||||
echo "BLD/SAMPLES/FPPOW.PLA"; atftp $1 --put -l samplesrc/fppow.pla -r $2/BLD/SAMPLES/FPPOW.PLA#040000
|
||||
echo "BLD/SAMPLES/MON.PLA"; atftp $1 --put -l utilsrc/apple/mon.pla -r $2/BLD/SAMPLES/MON.PLA#040000
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user