global flush_tlb:function global switch_address_space:function flush_tlb: invlpg [rdi] ret switch_address_space: ; clear the reserved bits mov rax, 0x000FFFFFFFFFF018 and rax, rdi mov cr3, rax ret global getcr3:function getcr3: mov rax, cr3 ret section .data switchp: db 'switching to space %llx', 0xA, 0