Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; void __stdcall kmain(unsigned int magic, multiboot_info *bootinfo)
- .text:00101540 public _kmain@8
- .text:00101540 _kmain@8 proc near
- .text:00101540
- .text:00101540 magic = dword ptr 8
- .text:00101540 bootinfo = dword ptr 0Ch
- .text:00101540
- .text:00101540 push ebp
- .text:00101541 mov ebp, esp
- .text:00101543 call _k_clearScreen@0 ; k_clearScreen()
- .text:00101548 call _k_hideCursor@0 ; k_hideCursor()
- .text:0010154D push 7 ; color
- .text:0010154F push offset aHelloWorld ; "Hello World!\r\n"
- .text:00101554 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:00101559 push 7 ; color
- .text:0010155B push offset a1234567890 ; "1234567890\r\n"
- .text:00101560 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:00101565 push 7 ; color
- .text:00101567 push offset aUmlaute ; "\tUmlaute:\n"
- .text:0010156C call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:00101571 push 7 ; color
- .text:00101573 push offset asc_102064 ; "รต"
- .text:00101578 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:0010157D push 7 ; color
- .text:0010157F mov eax, [ebp+magic]
- .text:00101582 push eax ; i
- .text:00101583 call ?k_print@@YGXHW4k_ConsoleColor@@@Z ; k_print(int,k_ConsoleColor)
- .text:00101588 push 7 ; color
- .text:0010158A push offset ptr ; "\r\n"
- .text:0010158F call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:00101594 push 7 ; color
- .text:00101596 mov ecx, [ebp+magic]
- .text:00101599 push ecx ; value
- .text:0010159A call _k_printHex@8 ; k_printHex(x,x)
- .text:0010159F push 7 ; color
- .text:001015A1 push offset ptr ; "\r\n"
- .text:001015A6 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:001015AB push 7 ; color
- .text:001015AD push offset ptr ; "\r\n"
- .text:001015B2 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:001015B7 pop ebp
- .text:001015B8 retn 8
- .text:001015B8 _kmain@8 endp
- .text:00101820 ; void __stdcall k_print(int i, k_ConsoleColor color)
- .text:00101820 ?k_print@@YGXHW4k_ConsoleColor@@@Z proc near
- .text:00101820 ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+Ep
- .text:00101820 ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+25p ...
- .text:00101820
- .text:00101820 stellen = dword ptr -0Ch
- .text:00101820 n = dword ptr -8
- .text:00101820 erg = byte ptr -1
- .text:00101820 i = dword ptr 8
- .text:00101820 color = dword ptr 0Ch
- .text:00101820
- .text:00101820 push ebp
- .text:00101821 mov ebp, esp
- .text:00101823 sub esp, 0Ch
- .text:00101826 cmp [ebp+i], 0
- .text:0010182A jnz short loc_101837
- .text:0010182C push 7 ; color
- .text:0010182E push 30h ; c
- .text:00101830 call ?k_print@@YGXDW4k_ConsoleColor@@@Z ; k_print(char,k_ConsoleColor)
- .text:00101835 jmp short loc_101897
- .text:00101837 ; ---------------------------------------------------------------------------
- .text:00101837
- .text:00101837 loc_101837: ; CODE XREF: k_print(int,k_ConsoleColor)+Aj
- .text:00101837 mov eax, [ebp+i]
- .text:0010183A push eax ; v
- .text:0010183B call _k_log10@4 ; k_log10(x)
- .text:00101840 add eax, 1
- .text:00101843 mov [ebp+stellen], eax
- .text:00101846 mov [ebp+n], 0
- .text:0010184D jmp short loc_101858
- .text:0010184F ; ---------------------------------------------------------------------------
- .text:0010184F
- .text:0010184F loc_10184F: ; CODE XREF: k_print(int,k_ConsoleColor)+75j
- .text:0010184F mov ecx, [ebp+n]
- .text:00101852 add ecx, 1
- .text:00101855 mov [ebp+n], ecx
- .text:00101858
- .text:00101858 loc_101858: ; CODE XREF: k_print(int,k_ConsoleColor)+2Dj
- .text:00101858 mov edx, [ebp+n]
- .text:0010185B cmp edx, [ebp+stellen]
- .text:0010185E jge short loc_101897
- .text:00101860 mov eax, [ebp+stellen]
- .text:00101863 sub eax, [ebp+n]
- .text:00101866 sub eax, 1
- .text:00101869 push eax ; stelle
- .text:0010186A call _k_pow10@4 ; k_pow10(x)
- .text:0010186F mov ecx, eax
- .text:00101871 mov eax, [ebp+i]
- .text:00101874 xor edx, edx
- .text:00101876 div ecx
- .text:00101878 xor edx, edx
- .text:0010187A mov ecx, 0Ah
- .text:0010187F div ecx
- .text:00101881 mov [ebp+erg], dl
- .text:00101884 mov edx, [ebp+color]
- .text:00101887 push edx ; color
- .text:00101888 movzx eax, [ebp+erg]
- .text:0010188C add eax, 30h
- .text:0010188F push eax ; c
- .text:00101890 call ?k_print@@YGXDW4k_ConsoleColor@@@Z ; k_print(char,k_ConsoleColor)
- .text:00101895 jmp short loc_10184F
- .text:00101897 ; ---------------------------------------------------------------------------
- .text:00101897
- .text:00101897 loc_101897: ; CODE XREF: k_print(int,k_ConsoleColor)+15j
- .text:00101897 ; k_print(int,k_ConsoleColor)+3Ej
- .text:00101897 mov esp, ebp
- .text:00101899 pop ebp
- .text:0010189A retn 8
- .text:0010189A ?k_print@@YGXHW4k_ConsoleColor@@@Z endp
- .text:001018A0 ; void __stdcall k_print(const char *ptr, k_ConsoleColor color)
- .text:001018A0 ?k_print@@YGXPBDW4k_ConsoleColor@@@Z proc near
- .text:001018A0 ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+1Ap
- .text:001018A0 ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+31p ...
- .text:001018A0
- .text:001018A0 var_18 = dword ptr -18h
- .text:001018A0 videomemory = dword ptr -14h
- .text:001018A0 bufferSize = word ptr -10h
- .text:001018A0 numRows = word ptr -0Ch
- .text:001018A0 numColumns = word ptr -8
- .text:001018A0 step = word ptr -4
- .text:001018A0 ptr = dword ptr 8
- .text:001018A0 color = dword ptr 0Ch
- .text:001018A0 push ebp
- .text:001018A1 mov ebp, esp
- .text:001018A3 sub esp, 18h
- .text:001018A6 mov [ebp+videomemory], 0B8000h
- .text:001018AD mov eax, 4
- .text:001018B2 mov [ebp+step], ax
- .text:001018B6 mov ecx, 50h
- .text:001018BB mov [ebp+numColumns], cx
- .text:001018BF mov edx, 19h
- .text:001018C4 mov [ebp+numRows], dx
- .text:001018C8 mov eax, 7D0h
- .text:001018CD mov [ebp+bufferSize], ax
- .text:001018D1 jmp short loc_1018EE
- .text:001018D3 ; ---------------------------------------------------------------------------
- .text:001018D3
- .text:001018D3 loc_1018D3: ; CODE XREF: k_print(char const *,k_ConsoleColor)+EFj
- .text:001018D3 ; k_print(char const *,k_ConsoleColor)+105j ...
- .text:001018D3 mov ecx, [ebp+ptr]
- .text:001018D6 add ecx, 1
- .text:001018D9 mov [ebp+ptr], ecx
- .text:001018DC mov dx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:001018E3 add dx, 1
- .text:001018E7 mov ?cursorPosition@@3GA, dx ; ushort cursorPosition
- .text:001018EE
- .text:001018EE loc_1018EE: ; CODE XREF: k_print(char const *,k_ConsoleColor)+31j
- .text:001018EE mov eax, [ebp+ptr]
- .text:001018F1 movsx ecx, byte ptr [eax]
- .text:001018F4 test ecx, ecx
- .text:001018F6 jz loc_101AC1
- .text:001018FC movzx edx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101903 cmp edx, 7D0h
- .text:00101909 jl short loc_10191D
- .text:0010190B movzx eax, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101912 sub eax, 7D0h
- .text:00101917 mov ?cursorPosition@@3GA, ax ; ushort cursorPosition
- .text:0010191D
- .text:0010191D loc_10191D: ; CODE XREF: k_print(char const *,k_ConsoleColor)+69j
- .text:0010191D mov ecx, [ebp+ptr]
- .text:00101920 movsx edx, byte ptr [ecx]
- .text:00101923 mov [ebp+var_18], edx
- .text:00101926 mov eax, [ebp+var_18]
- .text:00101929 add eax, 3Ch
- .text:0010192C mov [ebp+var_18], eax
- .text:0010192F cmp [ebp+var_18], 49h ; switch 74 cases
- .text:00101933 ja short loc_101946 ; jumptable 0010193F default case
- .text:00101935 mov ecx, [ebp+var_18]
- .text:00101938 movzx edx, ds:byte_101AF4[ecx]
- .text:0010193F jmp ds:off_101AC8[edx*4] ; switch jump
- .text:00101946
- .text:00101946 loc_101946: ; CODE XREF: k_print(char const *,k_ConsoleColor)+93j
- .text:00101946 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101946 movzx eax, ?cursorPosition@@3GA ; jumptable 0010193F default case
- .text:0010194D mov ecx, [ebp+videomemory]
- .text:00101950 mov edx, [ebp+ptr]
- .text:00101953 mov dl, [edx]
- .text:00101955 mov [ecx+eax*2], dl
- .text:00101958 movzx eax, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:0010195F mov ecx, [ebp+videomemory]
- .text:00101962 mov dl, byte ptr [ebp+color]
- .text:00101965 mov [ecx+eax*2+1], dl
- .text:00101969 jmp loc_101ABC
- .text:0010196E ; ---------------------------------------------------------------------------
- .text:0010196E
- .text:0010196E $LN10: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:0010196E ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:0010196E movzx eax, ?cursorPosition@@3GA ; jumptable 0010193F case 73
- .text:00101975 cdq
- .text:00101976 mov ecx, 50h
- .text:0010197B idiv ecx
- .text:0010197D add edx, 1
- .text:00101980 movzx eax, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101987 sub eax, edx
- .text:00101989 mov ?cursorPosition@@3GA, ax ; ushort cursorPosition
- .text:0010198F jmp loc_1018D3
- .text:00101994 ; ---------------------------------------------------------------------------
- .text:00101994
- .text:00101994 $LN9: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101994 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101994 movzx ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 70
- .text:0010199B add ecx, 4Fh
- .text:0010199E mov ?cursorPosition@@3GA, cx ; ushort cursorPosition
- .text:001019A5 jmp loc_1018D3
- .text:001019AA ; ---------------------------------------------------------------------------
- .text:001019AA
- .text:001019AA $LN8: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:001019AA ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:001019AA movzx edx, ?cursorPosition@@3GA ; jumptable 0010193F case 69
- .text:001019B1 add edx, 4
- .text:001019B4 mov ?cursorPosition@@3GA, dx ; ushort cursorPosition
- .text:001019BB jmp loc_1018D3
- .text:001019C0 ; ---------------------------------------------------------------------------
- .text:001019C0
- .text:001019C0 $LN7: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:001019C0 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:001019C0 movzx eax, ?cursorPosition@@3GA ; jumptable 0010193F case 56
- .text:001019C7 mov ecx, [ebp+videomemory]
- .text:001019CA mov byte ptr [ecx+eax*2], 81h
- .text:001019CE movzx edx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:001019D5 mov eax, [ebp+videomemory]
- .text:001019D8 mov cl, byte ptr [ebp+color]
- .text:001019DB mov [eax+edx*2+1], cl
- .text:001019DF jmp loc_1018D3
- .text:001019E4 ; ---------------------------------------------------------------------------
- .text:001019E4
- .text:001019E4 $LN6: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:001019E4 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:001019E4 movzx edx, ?cursorPosition@@3GA ; jumptable 0010193F case 32
- .text:001019EB mov eax, [ebp+videomemory]
- .text:001019EE mov byte ptr [eax+edx*2], 84h
- .text:001019F2 movzx ecx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:001019F9 mov edx, [ebp+videomemory]
- .text:001019FC mov al, byte ptr [ebp+color]
- .text:001019FF mov [edx+ecx*2+1], al
- .text:00101A03 jmp loc_1018D3
- .text:00101A08 ; ---------------------------------------------------------------------------
- .text:00101A08
- .text:00101A08 $LN5: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101A08 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101A08 movzx ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 0
- .text:00101A0F mov edx, [ebp+videomemory]
- .text:00101A12 mov byte ptr [edx+ecx*2], 8Eh
- .text:00101A16 movzx eax, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101A1D mov ecx, [ebp+videomemory]
- .text:00101A20 mov dl, byte ptr [ebp+color]
- .text:00101A23 mov [ecx+eax*2+1], dl
- .text:00101A27 jmp loc_1018D3
- .text:00101A2C ; ---------------------------------------------------------------------------
- .text:00101A2C
- .text:00101A2C $LN4: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101A2C ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101A2C movzx eax, ?cursorPosition@@3GA ; jumptable 0010193F case 50
- .text:00101A33 mov ecx, [ebp+videomemory]
- .text:00101A36 mov byte ptr [ecx+eax*2], 94h
- .text:00101A3A movzx edx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101A41 mov eax, [ebp+videomemory]
- .text:00101A44 mov cl, byte ptr [ebp+color]
- .text:00101A47 mov [eax+edx*2+1], cl
- .text:00101A4B jmp loc_1018D3
- .text:00101A50 ; ---------------------------------------------------------------------------
- .text:00101A50
- .text:00101A50 $LN3: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101A50 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101A50 movzx edx, ?cursorPosition@@3GA ; jumptable 0010193F case 18
- .text:00101A57 mov eax, [ebp+videomemory]
- .text:00101A5A mov byte ptr [eax+edx*2], 99h
- .text:00101A5E movzx ecx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101A65 mov edx, [ebp+videomemory]
- .text:00101A68 mov al, byte ptr [ebp+color]
- .text:00101A6B mov [edx+ecx*2+1], al
- .text:00101A6F jmp loc_1018D3
- .text:00101A74 ; ---------------------------------------------------------------------------
- .text:00101A74
- .text:00101A74 $LN2: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101A74 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101A74 movzx ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 24
- .text:00101A7B mov edx, [ebp+videomemory]
- .text:00101A7E mov byte ptr [edx+ecx*2], 9Ah
- .text:00101A82 movzx eax, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101A89 mov ecx, [ebp+videomemory]
- .text:00101A8C mov dl, byte ptr [ebp+color]
- .text:00101A8F mov [ecx+eax*2+1], dl
- .text:00101A93 jmp loc_1018D3
- .text:00101A98 ; ---------------------------------------------------------------------------
- .text:00101A98
- .text:00101A98 $LN1: ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
- .text:00101A98 ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
- .text:00101A98 movzx eax, ?cursorPosition@@3GA ; jumptable 0010193F case 27
- .text:00101A9F mov ecx, [ebp+videomemory]
- .text:00101AA2 mov byte ptr [ecx+eax*2], 0E1h
- .text:00101AA6 movzx edx, ?cursorPosition@@3GA ; ushort cursorPosition
- .text:00101AAD mov eax, [ebp+videomemory]
- .text:00101AB0 mov cl, byte ptr [ebp+color]
- .text:00101AB3 mov [eax+edx*2+1], cl
- .text:00101AB7 jmp loc_1018D3
- .text:00101ABC ; ---------------------------------------------------------------------------
- .text:00101ABC
- .text:00101ABC loc_101ABC: ; CODE XREF: k_print(char const *,k_ConsoleColor)+C9j
- .text:00101ABC jmp loc_1018D3
- .text:00101AC1 ; ---------------------------------------------------------------------------
- .text:00101AC1
- .text:00101AC1 loc_101AC1: ; CODE XREF: k_print(char const *,k_ConsoleColor)+56j
- .text:00101AC1 mov esp, ebp
- .text:00101AC3 pop ebp
- .text:00101AC4 retn 8
- .text:00101AC4 ; ---------------------------------------------------------------------------
- .text:00101AC7 align 4
- .text:00101AC8 off_101AC8 dd offset $LN5, offset $LN3, offset $LN2, offset $LN1
- .text:00101AC8 ; DATA XREF: k_print(char const *,k_ConsoleColor)+9Fr
- .text:00101AC8 dd offset $LN6, offset $LN4, offset $LN7, offset $LN8 ; jump table for switch statement
- .text:00101AC8 dd offset $LN9, offset $LN10, offset loc_101946
- .text:00101AF4 byte_101AF4 db 0, 0Ah, 0Ah, 0Ah
- .text:00101AF4 ; DATA XREF: k_print(char const *,k_ConsoleColor)+98r
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah ; indirect table for switch statement
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 1, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 2, 0Ah, 0Ah, 3
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 4, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 5, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 6, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 0Ah, 0Ah, 0Ah
- .text:00101AF4 db 0Ah, 7, 8, 0Ah
- .text:00101AF4 db 0Ah, 9
- .text:00101AF4 ?k_print@@YGXPBDW4k_ConsoleColor@@@Z endp
- ; int __stdcall k_clearScreen()
- .text:00101B40 _k_clearScreen@0 proc near ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+3p
- .text:00101B40 ; kmain(x,x)+3p
- .text:00101B40
- .text:00101B40 videomemory = dword ptr -8
- .text:00101B40 i = dword ptr -4
- .text:00101B40
- .text:00101B40 push ebp
- .text:00101B41 mov ebp, esp
- .text:00101B43 sub esp, 8
- .text:00101B46 mov [ebp+videomemory], 0B8000h
- .text:00101B4D mov [ebp+i], 0
- .text:00101B54 jmp short loc_101B5F
- .text:00101B56 ; ---------------------------------------------------------------------------
- .text:00101B56
- .text:00101B56 loc_101B56: ; CODE XREF: k_clearScreen()+3Dj
- .text:00101B56 mov eax, [ebp+i]
- .text:00101B59 add eax, 1
- .text:00101B5C mov [ebp+i], eax
- .text:00101B5F
- .text:00101B5F loc_101B5F: ; CODE XREF: k_clearScreen()+14j
- .text:00101B5F cmp [ebp+i], 7D0h
- .text:00101B66 jge short loc_101B7F
- .text:00101B68 mov ecx, [ebp+i]
- .text:00101B6B mov edx, [ebp+videomemory]
- .text:00101B6E mov byte ptr [edx+ecx*2], 20h
- .text:00101B72 mov eax, [ebp+i]
- .text:00101B75 mov ecx, [ebp+videomemory]
- .text:00101B78 mov byte ptr [ecx+eax*2+1], 7
- .text:00101B7D jmp short loc_101B56
- .text:00101B7F ; ---------------------------------------------------------------------------
- .text:00101B7F
- .text:00101B7F loc_101B7F: ; CODE XREF: k_clearScreen()+26j
- .text:00101B7F xor edx, edx
- .text:00101B81 mov ?cursorPosition@@3GA, dx ; ushort cursorPosition
- .text:00101B88 mov esp, ebp
- .text:00101B8A pop ebp
- .text:00101B8B retn
- .text:00101B8B _k_clearScreen@0 endp
- .text:00101B90 ; int __stdcall k_hideCursor()
- .text:00101B90 _k_hideCursor@0 proc near ; CODE XREF: kmain(x,x)+8p
- .text:00101B90
- .text:00101B90 position = word ptr -4
- .text:00101B90
- .text:00101B90 push ebp
- .text:00101B91 mov ebp, esp
- .text:00101B93 push ecx
- .text:00101B94 mov eax, 7D0h
- .text:00101B99 mov [ebp+position], ax
- .text:00101B9D mov edx, 3D4h
- .text:00101BA2 mov al, 0Fh
- .text:00101BA4 out dx, al ; Video: CRT cntrlr addr
- .text:00101BA4 ; Cursor location (low)
- .text:00101BA5 movzx eax, [ebp+position]
- .text:00101BA9 and eax, 0FFh
- .text:00101BAE mov edx, 3D5h
- .text:00101BB3 out dx, al ; Video: CRT controller internal registers
- .text:00101BB4 mov edx, 3D4h
- .text:00101BB9 mov al, 0Eh
- .text:00101BBB out dx, al ; Video: CRT cntrlr addr
- .text:00101BBB ; Cursor location (high)
- .text:00101BBC movzx eax, [ebp+position]
- .text:00101BC0 sar eax, 8
- .text:00101BC3 and eax, 0FFh
- .text:00101BC8 mov edx, 3D5h
- .text:00101BCD out dx, al ; Video: CRT controller internal registers
- .text:00101BCE mov esp, ebp
- .text:00101BD0 pop ebp
- .text:00101BD1 retn
- .text:00101BD1 _k_hideCursor@0 endp
- .text:00101BE0 ; void __stdcall k_printHex(unsigned int value, k_ConsoleColor color)
- .text:00101BE0 _k_printHex@8 proc near ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+53p
- .text:00101BE0 ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+6Ap ...
- .text:00101BE0
- .text:00101BE0 output = byte ptr -1Ch
- .text:00101BE0 var_10 = dword ptr -10h
- .text:00101BE0 n = dword ptr -0Ch
- .text:00101BE0 tmp = dword ptr -8
- .text:00101BE0 i = dword ptr -4
- .text:00101BE0 value = dword ptr 8
- .text:00101BE0 color = dword ptr 0Ch
- .text:00101BE0
- .text:00101BE0 push ebp
- .text:00101BE1 mov ebp, esp
- .text:00101BE3 sub esp, 1Ch
- .text:00101BE6 mov eax, [ebp+value]
- .text:00101BE9 mov [ebp+n], eax
- .text:00101BEC mov [ebp+i], 7
- .text:00101BF3 mov ecx, dword ptr ds:a00000000 ; "00000000"
- .text:00101BF9 mov dword ptr [ebp+output], ecx
- .text:00101BFC mov edx, dword ptr ds:a00000000+4
- .text:00101C02 mov dword ptr [ebp+output+4], edx
- .text:00101C05 mov al, byte ptr ds:a00000000+8
- .text:00101C0A mov [ebp+output+8], al
- .text:00101C0D
- .text:00101C0D loc_101C0D: ; CODE XREF: k_printHex(x,x)+7Aj
- .text:00101C0D mov ecx, [ebp+n]
- .text:00101C10 and ecx, 8000000Fh
- .text:00101C16 jns short loc_101C1D
- .text:00101C18 dec ecx
- .text:00101C19 or ecx, 0FFFFFFF0h
- .text:00101C1C inc ecx
- .text:00101C1D
- .text:00101C1D loc_101C1D: ; CODE XREF: k_printHex(x,x)+36j
- .text:00101C1D mov [ebp+tmp], ecx
- .text:00101C20 cmp [ebp+tmp], 0Ah
- .text:00101C24 jge short loc_101C31
- .text:00101C26 mov edx, [ebp+tmp]
- .text:00101C29 add edx, 30h
- .text:00101C2C mov [ebp+var_10], edx
- .text:00101C2F jmp short loc_101C3A
- .text:00101C31 ; ---------------------------------------------------------------------------
- .text:00101C31
- .text:00101C31 loc_101C31: ; CODE XREF: k_printHex(x,x)+44j
- .text:00101C31 mov eax, [ebp+tmp]
- .text:00101C34 add eax, 37h
- .text:00101C37 mov [ebp+var_10], eax
- .text:00101C3A
- .text:00101C3A loc_101C3A: ; CODE XREF: k_printHex(x,x)+4Fj
- .text:00101C3A mov ecx, [ebp+i]
- .text:00101C3D mov dl, byte ptr [ebp+var_10]
- .text:00101C40 mov [ebp+ecx+output], dl
- .text:00101C44 mov eax, [ebp+i]
- .text:00101C47 sub eax, 1
- .text:00101C4A mov [ebp+i], eax
- .text:00101C4D mov ecx, [ebp+n]
- .text:00101C50 sar ecx, 4
- .text:00101C53 mov [ebp+n], ecx
- .text:00101C56 cmp [ebp+i], 0
- .text:00101C5A jge short loc_101C0D
- .text:00101C5C mov edx, [ebp+color]
- .text:00101C5F push edx ; color
- .text:00101C60 lea eax, [ebp+output]
- .text:00101C63 push eax ; ptr
- .text:00101C64 call ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
- .text:00101C69 mov esp, ebp
- .text:00101C6B pop ebp
- .text:00101C6C retn 8
- .text:00101C6C _k_printHex@8 endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement