Skip to content

Commit 840cec2

Browse files
committed
Use mov <reg>, offset <label> instead of lea <label>
1 parent a0ade68 commit 840cec2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/stage_1.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ check_int13h_extensions:
7878
jc no_int13h_extensions
7979

8080
load_rest_of_bootloader_from_disk:
81-
lea eax, _rest_of_bootloader_start_addr
81+
mov eax, offset _rest_of_bootloader_start_addr
8282

8383
# dap buffer segment
8484
mov ebx, eax
@@ -90,7 +90,7 @@ load_rest_of_bootloader_from_disk:
9090
sub eax, ebx
9191
mov [dap_buffer_addr], ax
9292

93-
lea eax, _rest_of_bootloader_start_addr
93+
mov eax, offset _rest_of_bootloader_start_addr
9494

9595
# number of disk blocks to load
9696
lea ebx, _rest_of_bootloader_end_addr

src/stage_2.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ load_kernel_from_disk:
4040
mov word ptr [dap_blocks], 1
4141

4242
# number of start block
43-
lea eax, _kernel_start_addr
44-
lea ebx, _start
43+
mov eax, offset _kernel_start_addr
44+
mov ebx, offset _start
4545
sub eax, ebx
4646
shr eax, 9 # divide by 512 (block size)
4747
mov [dap_start_lba], eax

0 commit comments

Comments
 (0)