mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
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:
@@ -54,15 +54,9 @@ _start:
|
|||||||
movl $realmode_start, %esi
|
movl $realmode_start, %esi
|
||||||
movl $0, %edi
|
movl $0, %edi
|
||||||
|
|
||||||
copy_loop:
|
|
||||||
|
|
||||||
/* Copy by bytes, make sure the addresses are not overlapped */
|
/* Copy by bytes, make sure the addresses are not overlapped */
|
||||||
|
cld
|
||||||
movb (%esi), %al
|
rep movsb
|
||||||
movb %al, (%edi)
|
|
||||||
inc %esi
|
|
||||||
inc %edi
|
|
||||||
loop copy_loop
|
|
||||||
|
|
||||||
/* Jump to bin_start + 0x30, skip the multiboot1 header */
|
/* Jump to bin_start + 0x30, skip the multiboot1 header */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user