From 79472fe7229c898fa9a700e4c117aacfb9daa397 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Fri, 25 Dec 2020 15:23:35 +0800 Subject: move out iobp --- iobp.asm | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 iobp.asm (limited to 'iobp.asm') diff --git a/iobp.asm b/iobp.asm new file mode 100644 index 0000000..7a302ed --- /dev/null +++ b/iobp.asm @@ -0,0 +1,251 @@ +iobp_write: +push ebp +mov ebp, esp +push esi +mov esi, dword [ebp + 8] +push ebx +lea ebx, [esi + 0x2338] + +loc_00009c83: +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +test al, 1 +jne short loc_00009c83 ; jne 0x9c83 +push eax +push eax +push dword [ebp + 0xc] +lea eax, [esi + 0x2330] +push eax +call write32 ; call 0x17e8f +add esp, 0xc +push 0x700 +push 0xff +push ebx +call fcn_00018981 ; call 0x18981 +lea eax, [esi + 0x2334] +add esi, 0x233a +pop edx +pop ecx +push dword [ebp + 0x10] +push eax +call write32 ; call 0x17e8f +pop eax +pop edx +push 0xf000 +push esi +call write16 ; call 0x17e04 +pop ecx +pop esi +push 1 +push ebx +call or_16 ; call 0x18927 +add esp, 0x10 + +loc_00009ce8: +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +test al, 1 +jne short loc_00009ce8 ; jne 0x9ce8 +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +and eax, 6 +cmp al, 1 +sbb eax, eax +not eax +lea esp, [ebp - 8] +and eax, 0x80000007 +pop ebx +pop esi +pop ebp +ret + +iobp_read: +push ebp +mov ebp, esp +push esi +mov esi, dword [ebp + 8] +push ebx +lea ebx, [esi + 0x2338] + +loc_00009d27: +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +test al, 1 +jne short loc_00009d27 ; jne 0x9d27 +push eax +push eax +push dword [ebp + 0xc] +lea eax, [esi + 0x2330] +push eax +call write32 ; call 0x17e8f +add esp, 0xc +push 0x600 +push 0xff +push ebx +call fcn_00018981 ; call 0x18981 +lea eax, [esi + 0x233a] +pop edx +pop ecx +push 0xf000 +push eax +call write16 ; call 0x17e04 +pop eax +pop edx +push 1 +push ebx +call or_16 ; call 0x18927 +add esp, 0x10 + +loc_00009d7b: +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +test al, 1 +jne short loc_00009d7b ; jne 0x9d7b +sub esp, 0xc +push ebx +call read8 ; call 0x17d8b +add esp, 0x10 +mov edx, 0x80000007 +test al, 6 +jne short loc_00009db9 ; jne 0x9db9 +sub esp, 0xc +add esi, 0x2334 +push esi +call read32 ; call 0x17e4e +mov edx, dword [ebp + 0x10] +add esp, 0x10 +mov dword [edx], eax +xor edx, edx + +loc_00009db9: +lea esp, [ebp - 8] +mov eax, edx +pop ebx +pop esi +pop ebp +ret + +program_iobp: +push ebp +mov ebp, esp +push edi +push esi +push ebx +sub esp, 0x20 +mov esi, dword [ebp + 0xc] +lea eax, [ebp - 0x1c] +mov edi, dword [ebp + 0x14] +push eax +push esi +push dword [ebp + 8] +call iobp_read ; call 0x9d19 +add esp, 0x10 +mov ebx, eax +test eax, eax +jns short loc_00009e40 ; jns 0x9e40 +call fcn_00015479 ; call 0x15479 +test al, al +je short loc_00009e0a ; je 0x9e0a +sub esp, 0xc +push edi +push dword [ebp + 0x10] +push esi +push ref_00022017 ; push 0x22017 +push 0x80000000 +call efi_console_out ; call 0x15487 +add esp, 0x20 + +loc_00009e0a: +call dummy_15480 ; call 0x15480 +mov edx, ebx +test al, al +je loc_00009ec3 ; je 0x9ec3 +call fcn_00015479 ; call 0x15479 +test al, al +je short loc_00009e36 ; je 0x9e36 +push edi +push ebx +push ref_000206d3 ; push 0x206d3 +push 0x80000000 +call efi_console_out ; call 0x15487 +add esp, 0x10 + +loc_00009e36: +push esi +push ref_000206f4 ; push 0x206f4 +push 0x34 +jmp short loc_00009eb4 ; jmp 0x9eb4 + +loc_00009e40: +mov eax, dword [ebp + 0x10] +and eax, dword [ebp - 0x1c] +push ecx +or eax, edi +push eax +push esi +push dword [ebp + 8] +mov dword [ebp - 0x1c], eax +call iobp_write ; call 0x9c75 +add esp, 0x10 +mov ebx, eax +mov edx, eax +test eax, eax +jns short loc_00009ec3 ; jns 0x9ec3 +call fcn_00015479 ; call 0x15479 +test al, al +je short loc_00009e84 ; je 0x9e84 +sub esp, 0xc +push edi +push dword [ebp + 0x10] +push esi +push ref_00022084 ; push 0x22084 +push 0x80000000 +call efi_console_out ; call 0x15487 +add esp, 0x20 + +loc_00009e84: +call dummy_15480 ; call 0x15480 +mov edx, ebx +test al, al +je short loc_00009ec3 ; je 0x9ec3 +call fcn_00015479 ; call 0x15479 +test al, al +je short loc_00009eac ; je 0x9eac +push edx +push ebx +push ref_000206d3 ; push 0x206d3 +push 0x80000000 +call efi_console_out ; call 0x15487 +add esp, 0x10 + +loc_00009eac: +push eax +push ref_000206f4 ; push 0x206f4 +push 0x40 + +loc_00009eb4: +push ref_00022050 ; push 0x22050 +call fcn_0001548c ; call 0x1548c +add esp, 0x10 +mov edx, ebx + +loc_00009ec3: +lea esp, [ebp - 0xc] +mov eax, edx +pop ebx +pop esi +pop edi +pop ebp +ret + + -- cgit v1.2.3