From e9d4359bc2021d6e4a7257e34cbacd4ed83e694a Mon Sep 17 00:00:00 2001 From: zbyti Date: Sun, 20 Sep 2020 22:58:20 +0200 Subject: [PATCH] A8 Monte Carlo PI refactor (__mul_u16u8u16) --- examples/a8/montecarlo_pi_benchmark.mfk | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/a8/montecarlo_pi_benchmark.mfk b/examples/a8/montecarlo_pi_benchmark.mfk index 9e840953..846ed70e 100644 --- a/examples/a8/montecarlo_pi_benchmark.mfk +++ b/examples/a8/montecarlo_pi_benchmark.mfk @@ -33,7 +33,8 @@ void printScore(word val) { void main() { array(bool) flags[size] align(1024) word i@$e0, bingo@$e2 - word x@$e4, y@$e6, n@$e8, p@$ea + word x@$e4, y@$e6, p@$e8, t@$ea + byte n@$82 screen = os_SAVMSC @@ -46,19 +47,19 @@ void main() { for i,0,to,probe { n = pokey_random & 127 - x = n * n + x = n * word(n) n = pokey_random & 127 - y = n * n + y = n * word(n) if ((x + y) <= radius) { bingo += 1 } } p = 4 * bingo - n = os_RTCLOK.b2 + (os_RTCLOK.b1 * 256) + t = os_RTCLOK.b2 + (os_RTCLOK.b1 * 256) - printScore(n) + printScore(t) printScore(p) while true {} -} +} \ No newline at end of file