1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-12 06:29:34 +00:00

A8 Monte Carlo PI refactor (__mul_u16u8u16)

This commit is contained in:
zbyti 2020-09-20 22:58:20 +02:00
parent 07b6adf6bc
commit e9d4359bc2

View File

@ -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 {}
}
}