arch/x86_64: replaced loop construct with rep movsb

Replaces inefficient loop construct with rep movsb string instruction.

Signed-off-by: cqb <cqb@sideways.engineering>
This commit is contained in:
cqb
2026-02-01 17:46:28 +01:00
committed by Xiang Xiao
parent 3fb776e45c
commit 7b1e9eb8bc
+2 -8
View File
@@ -54,15 +54,9 @@ _start:
movl $realmode_start, %esi
movl $0, %edi
copy_loop:
/* Copy by bytes, make sure the addresses are not overlapped */
movb (%esi), %al
movb %al, (%edi)
inc %esi
inc %edi
loop copy_loop
cld
rep movsb
/* Jump to bin_start + 0x30, skip the multiboot1 header */