limine/common/lib/mem.s2.asm_ia32

36 lines
435 B
Plaintext
Raw Normal View History

2023-06-20 14:24:49 +03:00
section .text
global memcpy32to64
memcpy32to64:
push ebp
mov ebp, esp
push esi
push edi
push 0x28
call .p1
.p1:
add dword [esp], .mode64 - .p1
retfd
bits 64
.mode64:
mov rdi, [rbp + 8]
mov rsi, [rbp + 16]
mov rcx, [rbp + 24]
rep movsb
push 0x18
call .p2
.p2:
add qword [rsp], .mode32 - .p2
retfq
bits 32
.mode32:
pop edi
pop esi
pop ebp
ret