_self_host_or_shift3_test.nx source
↩ module page · 9 lines · 296 B
1import "nx_syscalls.nx"
2// expect_exit: 86
3
4func main() -> i64 {
5 // (1) | (2 << 8) | (3 << 16) = 0x030201 = 197121. 197121 % 251 = ?
6 // 197121 / 251 = 785.34; 785*251 = 197035; 197121-197035 = 86.
7 let r: i64 = (1 & 0xFF) | ((2 & 0xFF) << 8) | ((3 & 0xFF) << 16)
8 return r % 251
9}