From a772f5b96f0aef2af4dea0d4750e89a6ef16d846 Mon Sep 17 00:00:00 2001 From: "Rustem Gimadutdinov (rgimad)" Date: Sat, 17 Feb 2024 20:25:06 +0000 Subject: [PATCH] Change "mov reg, 0" to "xor reg, reg" where it's possible git-svn-id: svn://kolibrios.org@9977 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../trunk/bootloader/uefi4kos/uefi32kos.asm | 2 +- .../trunk/bootloader/uefi4kos/uefi64kos.asm | 2 +- kernel/trunk/core/apic.inc | 2 +- kernel/trunk/core/conf_lib.inc | 37 +++++++++---------- kernel/trunk/core/ext_lib.inc | 2 +- kernel/trunk/video/vga.inc | 2 +- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/kernel/trunk/bootloader/uefi4kos/uefi32kos.asm b/kernel/trunk/bootloader/uefi4kos/uefi32kos.asm index ae6e0baf1e..b20ef00eb6 100644 --- a/kernel/trunk/bootloader/uefi4kos/uefi32kos.asm +++ b/kernel/trunk/bootloader/uefi4kos/uefi32kos.asm @@ -115,7 +115,7 @@ proc skip_line endp proc dec2bin - mov edx, 0 + xor edx, edx .next_char: movzx eax, byte[esi] test eax, eax diff --git a/kernel/trunk/bootloader/uefi4kos/uefi64kos.asm b/kernel/trunk/bootloader/uefi4kos/uefi64kos.asm index 85080f669d..bd86503f29 100644 --- a/kernel/trunk/bootloader/uefi4kos/uefi64kos.asm +++ b/kernel/trunk/bootloader/uefi4kos/uefi64kos.asm @@ -131,7 +131,7 @@ skip_line: ret dec2bin: - mov edx, 0 + xor edx, edx .next_char: movzx eax, byte[rsi] test eax, eax diff --git a/kernel/trunk/core/apic.inc b/kernel/trunk/core/apic.inc index b961abe3ab..7cb243fb8e 100644 --- a/kernel/trunk/core/apic.inc +++ b/kernel/trunk/core/apic.inc @@ -179,7 +179,7 @@ LAPIC_init: mov [esi + APIC_TPR], eax ; Flush the queue - mov edx, 0 + xor edx, edx .nxt2: mov ecx, 32 mov eax, [esi + APIC_ISR + edx] diff --git a/kernel/trunk/core/conf_lib.inc b/kernel/trunk/core/conf_lib.inc index 28a1488192..1188dd37d8 100644 --- a/kernel/trunk/core/conf_lib.inc +++ b/kernel/trunk/core/conf_lib.inc @@ -14,39 +14,39 @@ $Revision$ iglobal conf_path_sect: - db 'path',0 + db 'path',0 conf_fname db '/sys/sys.conf',0 endg -; set soke kernel configuration +; set kernel configuration proc set_kernel_conf locals par db 30 dup(?) endl pushad -;[gui] -;mouse_speed +; [gui] +; mouse_speed lea eax, [par] push eax invoke ini.get_str, conf_fname, ugui, ugui_mouse_speed, \ - eax,30, ugui_mouse_speed_def + eax, 30, ugui_mouse_speed_def pop eax stdcall strtoint, eax mov [mouse_speed_factor], ax -;mouse_delay +; mouse_delay lea eax, [par] push eax invoke ini.get_str, conf_fname, ugui, ugui_mouse_delay, \ - eax,30, ugui_mouse_delay_def + eax, 30, ugui_mouse_delay_def pop eax stdcall strtoint, eax mov [mouse_delay], eax -;midibase +; midibase lea eax, [par] push eax invoke ini.get_str, conf_fname, udev, udev_midibase, eax, 30, udev_midibase_def @@ -88,7 +88,7 @@ else end if unet_def db 0 endg -; convert string to DWord +; convert string to dword proc strtoint stdcall,strs pushad @@ -113,11 +113,11 @@ proc strtoint stdcall,strs ret endp -; convert string to DWord for decimal value +; convert string to dword for decimal value proc strtoint_dec stdcall,strs pushad xor edx, edx - ; поиск конца + ; search for the end mov esi, [strs] @@: lodsb @@ -133,16 +133,13 @@ proc strtoint_dec stdcall,strs dec ebx or ebx, ebx jz @f - imul ecx, ecx, 10; порядок + imul ecx, ecx, 10 ; order jmp @b @@: - xchg ebx, ecx - xor ecx, ecx - @@: xor eax, eax lodsb @@ -166,8 +163,8 @@ proc strtoint_dec stdcall,strs ret endp -;convert string to DWord for hex value -proc strtoint_hex stdcall,strs +; convert string to dword for hex value +proc strtoint_hex stdcall, strs pushad xor edx, edx @@ -221,12 +218,12 @@ proc strtoint_hex stdcall,strs endp -; convert string to DWord for IP addres -proc do_inet_adr stdcall,strs +; convert string to dword for IP address +proc do_inet_adr stdcall, strs pushad mov esi, [strs] - mov ebx, 0 + xor ebx, ebx .next: push esi @@: diff --git a/kernel/trunk/core/ext_lib.inc b/kernel/trunk/core/ext_lib.inc index eeab723047..92450191b9 100644 --- a/kernel/trunk/core/ext_lib.inc +++ b/kernel/trunk/core/ext_lib.inc @@ -136,7 +136,7 @@ proc load_k_library stdcall, file_name:dword @@: mov edx, [coff] movzx ebx, [edx + CFH.nSections] - mov edi, 0 + xor edi, edi lea eax, [edx+20] @@: add [eax + CFS.VirtualAddress], edi ;patch user space offset diff --git a/kernel/trunk/video/vga.inc b/kernel/trunk/video/vga.inc index 0cc93cf7d7..869699e4a3 100644 --- a/kernel/trunk/video/vga.inc +++ b/kernel/trunk/video/vga.inc @@ -168,7 +168,7 @@ align 4 align 4 novesal: mov [novesachecksum], ecx - xor ecx, ecx ;mov ecx, 0 + xor ecx, ecx movzx eax, word [MOUSE_Y] cmp eax, 100 jge m13l3