Replaced builtin store function with a new syntax

This commit is contained in:
2025-04-11 14:21:51 +02:00
parent a9d783c675
commit 43a006e4af
12 changed files with 54 additions and 46 deletions

View File

@ -7,6 +7,6 @@ alloc(length int) -> []byte {
return x
}
store(x, 8, length)
[x] = length
return x + 8
}

View File

@ -5,7 +5,7 @@ alloc(length int) -> []byte {
return x
}
store(x, 8, length)
[x] = length
return x + 8
}

View File

@ -4,9 +4,9 @@ import sys
create(func *any) -> int {
stack := sys.mmap(0, 4096, 0x1|0x2, 0x02|0x20|0x100)
stack += 4096 - 8
store(stack, 8, core.exit)
[stack] = core.exit
stack -= 8
store(stack, 8, func)
[stack] = func
return sys.clone(clone.vm|clone.fs|clone.files|clone.sighand|clone.parent|clone.thread|clone.io, stack, 0, 0, 0)
}