+
+ ; allocate some heap memory
+ (emit "mov $9, %rax") ; mmap
+ (emit "xor %rdi, %rdi") ; addr = null
+ (emit "movq $1024, %rsi") ; length = 1kb
+ (emit "movq $0x3, %rdx") ; prot = read | write = 0x2 | 0x1
+ (emit "movq $0x22, %r10") ; flags = anonymous | private = 0x20 | 0x02
+ (emit "movq $-1, %r8") ; fd = -1
+ (emit "xor %r9, %r9") ; offset = 0
+ (emit "syscall")
+
+ ; %rax now contains pointer to the start of the heap
+ ; keep track of it
+ (emit "movq %rax, (heap_start)")
+