Skip to content

Commit ebf5f81

Browse files
committed
Fix movsd: We need to explicitly specify operands to use 32-bit addressing
1 parent 98ff4e8 commit ebf5f81

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/second_stage.s

+2-12
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,9 @@ load_next_kernel_block_from_disk:
4949
# copy block to 2MiB
5050
push ecx
5151
push esi
52-
mov ecx, 512
52+
mov ecx, 512 / 4
5353
movzx esi, word ptr [dap_buffer_addr]
54-
55-
copy_loop:
56-
# movsd # doesn't work, no idea why (same with rep movsd)
57-
mov eax, [esi]
58-
mov es:[edi], eax
59-
add esi, 4
60-
add edi, 4
61-
sub ecx, 1
62-
jnz copy_loop
63-
64-
copy_done:
54+
rep movsd [edi], [esi]
6555
pop esi
6656
pop ecx
6757

0 commit comments

Comments
 (0)