diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt index f0e4fa047..5113e58fd 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AugmentableAssignmentAsmGen.kt @@ -422,7 +422,8 @@ internal class AugmentableAssignmentAsmGen(private val program: PtProgram, ldy #>$tempvar sta P8ZP_SCRATCH_W1 sty P8ZP_SCRATCH_W1+1 - ply + pla + tay txa jsr floats.copy_float""") // copy from array into float temp var, clobbers A,Y } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 94458fa1a..16f2208e1 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -1,6 +1,13 @@ TODO ==== +- examples/bench8/pow.p8: result value 0 is borked, fix array[j] += testpow(2.5/(i+1.0), j) assignment in 6502 codegen +- examples/bench8/crc16 produces wrong answer (expected ffd0 in 4.6 sec) +- examples/bench8/crc32 produces wrong answer (expected e1fa84c6 in 40.1 sec) + +- add bench8/sieve and sieve-bit ports + + - prefix prog8 subroutines with p8s_ instead of p8_ to not let them clash with variables in the asm?? - [on branch: shortcircuit] investigate McCarthy evaluation again? this may also reduce code size perhaps for things like if a>4 or a<2 .... - IR: reduce the number of branch instructions such as BEQ, BEQR, etc (gradually), replace with CMP(I) + status branch instruction diff --git a/examples/bench8/crc16.p8 b/examples/bench8/crc16.p8 index c9200fd38..389da80d8 100644 --- a/examples/bench8/crc16.p8 +++ b/examples/bench8/crc16.p8 @@ -18,13 +18,13 @@ main { } sub start() { - txt.print("calculating...") + txt.print("calculating (expecting $ffd0)...") cbm.SETTIM(0,0,0) uword crc = crc16($e000, $2000) - txt.print_uwhex(crc, true) ; should be $ffd0 + txt.print_uwhex(crc, true) txt.nl() txt.print_uw(cbm.RDTIM16()) txt.print(" jiffies") - sys.wait(100) + sys.wait(300) } } diff --git a/examples/bench8/crc32.p8 b/examples/bench8/crc32.p8 index b231a6e91..f83f571ac 100644 --- a/examples/bench8/crc32.p8 +++ b/examples/bench8/crc32.p8 @@ -29,7 +29,7 @@ main { } sub start() { - txt.print("calculating...") + txt.print("calculating (expecting $e1fa84c6)...\n") cbm.SETTIM(0,0,0) crc32($e000, $2000) txt.print_uwhex(cx16.r0, true) @@ -37,6 +37,6 @@ main { txt.nl() txt.print_uw(cbm.RDTIM16()) txt.print(" jiffies") - sys.wait(100) + sys.wait(300) } } diff --git a/examples/bench8/crc8.p8 b/examples/bench8/crc8.p8 index 600851c04..58e18c4d5 100644 --- a/examples/bench8/crc8.p8 +++ b/examples/bench8/crc8.p8 @@ -18,13 +18,13 @@ main { } sub start() { - txt.print("calculating...") + txt.print("calculating (expecting $a2)...") cbm.SETTIM(0,0,0) ubyte crc = crc8($e000, $2000) - txt.print_ubhex(crc, true) ; should be $a2 + txt.print_ubhex(crc, true) txt.nl() txt.print_uw(cbm.RDTIM16()) txt.print(" jiffies") - sys.wait(100) + sys.wait(300) } } diff --git a/examples/bench8/pow.p8 b/examples/bench8/pow.p8 index 4c677d582..995f7ecc5 100644 --- a/examples/bench8/pow.p8 +++ b/examples/bench8/pow.p8 @@ -18,10 +18,10 @@ main { } sub start() { - txt.print("calculating...") - cbm.SETTIM(0,0,0) + txt.print("calculating (expecting 3.614007e+12)... ") + ; cbm.SETTIM(0,0,0) - float res + float res=0.0 uword i ubyte j for i in 0 to N_ITER-1 { @@ -35,8 +35,8 @@ main { floats.print_f(res) txt.nl() - txt.print_uw(cbm.RDTIM16()) - txt.print(" jiffies") - sys.wait(100) +; txt.print_uw(cbm.RDTIM16()) +; txt.print(" jiffies") + sys.wait(300) } }