Implemented 64-bit move
This commit is contained in:
parent
8b1af4bea7
commit
de608a74a7
8 changed files with 62 additions and 29 deletions
22
lib/io/io.q
22
lib/io/io.q
|
@ -1,22 +0,0 @@
|
|||
import mem
|
||||
import sys
|
||||
|
||||
printNum(x) {
|
||||
length := 20
|
||||
buffer := mem.alloc(length)
|
||||
end := buffer + length
|
||||
tmp := end
|
||||
digit := 0
|
||||
|
||||
loop {
|
||||
x, digit = x / 10
|
||||
tmp -= 1
|
||||
tmp[0] = '0' + digit
|
||||
|
||||
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