// Demonstrate different output formats of writei() #define DELAY 1000 main() { loop { writei('d', 00001, DELAY); // leading 0s will be ignored! writei('d', 0x100, DELAY); // hex number display in signed decimal writei('o', 0x100, DELAY); // hex number display in octal writei('x', 0x100, DELAY); // hex number display in hexidecimal writei('u', 65535, DELAY); // maximum unsigned decimal integer writei('x', 65535, DELAY); // maximum unsigned hexadecimal integer writei('o', 65535, DELAY); // maximum unsigned octal integer writei('d', 32767, DELAY); // maximum +ve signed integer writei('d', -32768, DELAY); // maximum -ve signed integer } }