fix pointer test

This commit is contained in:
Irmen de Jong
2025-07-07 23:09:45 +02:00
parent 9f6106452e
commit 9c63ef39c7
3 changed files with 36 additions and 116 deletions
+3 -3
View File
@@ -13,18 +13,18 @@ main {
uword prime
uword k
const uword SIZEPL = 8191
uword @zp flags_ptr = memory("flags", SIZEPL, $100)
^^bool @zp flags_ptr = memory("flags", SIZEPL, $100)
txt.print("calculating...\n")
sys.memset(flags_ptr, SIZEPL, 1)
count = 1
for i in 0 to SIZEPL-1 {
if flags_ptr[i]!=0 {
if flags_ptr[i] {
prime = i + i + 3
k = i + prime
while k <= SIZEPL-1 {
flags_ptr[k] = 0 ; false
flags_ptr[k] = false
k += prime
}
; txt.print_uw(prime)