import mem import sys number(x) { length := 20 buffer := mem.alloc(length) tmp := itoa(x, buffer, length) sys.write(1, tmp, buffer + length - tmp) mem.free(buffer, length) } itoa(x, buffer, length) { tmp := buffer + length digit := 0 loop { x, digit = x / 10 tmp -= 1 tmp[0] = '0' + digit if x == 0 { return tmp } } }