From 012813f07b7e769ee9b4e04701eeec05aa8a138c Mon Sep 17 00:00:00 2001 From: Ian Seyler Date: Thu, 1 May 2025 22:02:45 -0400 Subject: [PATCH] Replace signed condtional jumps --- src/init/acpi.asm | 4 ++-- src/init/hpet.asm | 2 +- src/pure64.asm | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/init/acpi.asm b/src/init/acpi.asm index cca11b1..f66d51f 100644 --- a/src/init/acpi.asm +++ b/src/init/acpi.asm @@ -23,7 +23,7 @@ searchingforACPI: cmp rax, rbx ; Verify the Signature je foundACPI cmp esi, 0x000FFFFF ; Keep looking until we get here - jge noACPI ; ACPI tables couldn't be found, fail + jae noACPI ; ACPI tables couldn't be found, fail jmp searchingforACPI ; Find the ACPI RSDP Structure on a UEFI system @@ -185,7 +185,7 @@ parseAPICTable: readAPICstructures: cmp ebx, ecx - jge parseAPICTable_done + jae parseAPICTable_done lodsb ; APIC Structure Type cmp al, 0x00 ; Processor Local APIC je APICapic diff --git a/src/init/hpet.asm b/src/init/hpet.asm index 9375141..6ad0568 100644 --- a/src/init/hpet.asm +++ b/src/init/hpet.asm @@ -23,7 +23,7 @@ init_hpet: ; Verify the Counter Clock Period is valid cmp eax, 0x05F5E100 ; 100,000,000 femtoseconds is the maximum - jg os_hpet_init_error + ja os_hpet_init_error cmp eax, 0 ; The Period has to be greater than 1 femtosecond je os_hpet_init_error diff --git a/src/pure64.asm b/src/pure64.asm index 69595be..adb5544 100644 --- a/src/pure64.asm +++ b/src/pure64.asm @@ -478,12 +478,12 @@ uefi_memmap_next: je uefi_memmap_end mov rax, [rsi+8] cmp rax, 0x100000 ; Test if the Physical Address less than 0x100000 - jl uefi_memmap_next ; If so, skip it + jb uefi_memmap_next ; If so, skip it mov rax, [rsi] cmp rax, 0 ; EfiReservedMemoryType (Not usable) je uefi_memmap_next cmp rax, 7 ; EfiConventionalMemory (Free) - jle uefi_memmap_usable + jbe uefi_memmap_usable mov bl, 0 jmp uefi_memmap_next uefi_memmap_usable: @@ -524,7 +524,7 @@ uefi_purge: stosq lodsq cmp rax, 0x300 - jl uefi_purge_remove + jb uefi_purge_remove stosq jmp uefi_purge uefi_purge_remove: @@ -666,7 +666,7 @@ pde_next_range: cmp rax, 0 ; Check if at end of records je pde_end ; Bail out if so cmp rax, 0x00200000 - jg skipfirst4mb + ja skipfirst4mb add rax, 0x00200000 ; Add 2 MiB to the base sub rcx, 2 ; Subtract 2 MiB from the length skipfirst4mb: @@ -788,7 +788,7 @@ lfb_wc_1GB: mov rax, [0x00005F00] ; Base address of video memory mov rbx, 0x100000000 ; Compare to 4GB cmp rax, rbx - jle lfb_wc_end ; If less, don't set WC + jbe lfb_wc_end ; If less, don't set WC shr rax, 27 ; Quick divide mov edi, 0x00003000 ; Address of low PDPTEs add edi, eax ; Add the offset