1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
.text .extern begin_userspace .global jump_userspace jump_userspace: mov $0x23, %ax mov %ax, %ds mov %ax, %es mov %ax, %fs mov %ax, %gs mov %esp, %eax push $0x23 push %rax pushf push $0x1b sub $8, %rsp movabs $begin_userspace, %rsp iretq