Added main prefix
This commit is contained in:
parent
e537e543cc
commit
6510166ae0
9 changed files with 34 additions and 20 deletions
|
@ -4,6 +4,11 @@ import sys
|
|||
number(x) {
|
||||
length := 20
|
||||
buffer := mem.alloc(length)
|
||||
itoa(x, buffer, length)
|
||||
mem.free(buffer, length)
|
||||
}
|
||||
|
||||
itoa(x, buffer, length) {
|
||||
end := buffer + length
|
||||
tmp := end
|
||||
digit := 0
|
||||
|
@ -15,7 +20,6 @@ number(x) {
|
|||
|
||||
if x == 0 {
|
||||
sys.write(1, tmp, end - tmp)
|
||||
mem.free(buffer, length)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue