# paste.ha -rw-r--r-- 357 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
fn stupid_print(what: str, x: u64) void = {
	static const bytes: [_]u8 = [
		'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
		'a', 'b', 'c', 'd', 'e', 'f',
	];
	log::printf(what);
	log::printf(": 0x");
	for (let i = 0u64; i < 8; i += 1) {
		const nibble = (x >> ((7 - i) * 4) & 0xF): u8;
		log::write(bytes[nibble..nibble+1]);
	};
	log::printfln("");
};