1 // clang -masm=intel -nostdlib docs/example.s -lSystem -Wl,-e,_start -g -o target/example
4 #define SYS(X) (SYS_OFFSET + X)
12 MAP_ANONYMOUS = 0x1000
19 // args: RDI RSI RDX RCX R8 R9
24 // 16-byte align the stack
48 cmp qword ptr [rdi], 1
49 jne ivy_check_int_fail
53 jnz ivy_check_lam_fail
54 cmp qword ptr [rdi], 0
55 jne ivy_check_lam_fail
59 mov rsi, [rip + EXPECT_INT_ERROR]
60 mov rdx, [rip + EXPECT_INT_ERROR_LEN]
63 mov rsi, [rip + EXPECT_LAM_ERROR]
64 mov rdx, [rip + EXPECT_LAM_ERROR_LEN]
68 EXPECT_INT_ERROR: .ascii "Error: typecheck expected an integer type"
69 EXPECT_INT_ERROR_LEN: .quad . - EXPECT_INT_ERROR
70 EXPECT_LAM_ERROR: .ascii "Error: typecheck expected a lambda type"
71 EXPECT_LAM_ERROR_LEN: .quad . - EXPECT_LAM_ERROR
97 add rbx, 'A' - '0' - 10
103 jl ivy_debug_log_loop