run exe arg, deref -> read

This commit is contained in:
2025-08-21 10:34:32 +02:00
parent 3fd62c6083
commit ca8ae6e110
6 changed files with 55 additions and 40 deletions

View File

@@ -15,15 +15,15 @@ func main[] : I64
else if op == '<'
p = p - 1
else if op == '+'
str.set(memory, p, str.nth(memory, p)+1)
str.set(memory, p, mem.read8(memory + p)+1)
else if op == '-'
str.set(memory, p, str.nth(memory, p)-1)
str.set(memory, p, mem.read8(memory + p)-1)
else if op == '.'
c.printf("%c", str.nth(memory, p))
c.printf("%c", mem.read8(memory + p))
else if op == ','
str.set(memory, p, c.getchar())
else if op == '['
if !str.nth(memory, p)
if !mem.read8(memory + p)
i = i + 1
let opened: I64 = 0
while i < src_len & !(str.nth(src, i) == ']' & !opened)
@@ -33,7 +33,7 @@ func main[] : I64
opened = opened - 1
i = i + 1
else if op == ']'
if str.nth(memory, p)
if mem.read8(memory + p)
i = i - 1
let closed: I64 = 0
while i >= 0 & !(str.nth(src, i) == '[' & !closed)