/kernel/trunk/drivers/fdo.inc |
---|
19,6 → 19,20 |
; __DEBUG__ equ 1 |
; __DEBUG_LEVEL__ equ 5 |
; MOV Immediate. |
; Useful for things like movi eax,10: |
; shorter than regular mov, but slightly slower, |
; do not use it in performance-critical places. |
macro movi dst, imm |
{ |
if imm >= -0x80 & imm <= 0x7F |
push imm |
pop dst |
else |
mov dst, imm |
end if |
} |
macro debug_func name { |
if used name |
name@of@func equ name |
273,8 → 287,7 |
call fdo_debug_outchar |
pop eax |
@@: |
push 10 |
pop ecx |
movi ecx, 10 |
push -'0' |
.l1: |
xor edx, edx |
/kernel/trunk/drivers/usbhid.asm |
---|
234,8 → 234,7 |
; 8 bytes for a packet and 8 bytes for previous packet, used by a keyboard. |
; 9. Initialize device data. |
mov [ebx+device_data.intpipe], eax |
push 8 |
pop ecx |
movi ecx, 8 |
cmp edx, ecx |
jb @f |
mov edx, ecx |
364,8 → 363,7 |
jb .controlloop |
.nocontrol: |
; 3. Initialize before loop for normal keys. esi = index. |
push 2 |
pop esi |
movi esi, 2 |
.normalloop: |
; 4. Process one key which was pressed in the previous packet. |
; 4a. Get the next pressed key from the previous packet. |
486,8 → 484,7 |
; Auxiliary procedure for keyboard_data_ready. |
haskey: |
push 2 |
pop edx |
movi edx, 2 |
@@: |
cmp byte [ecx+edx], al |
jz @f |
/kernel/trunk/drivers/usbstor.asm |
---|
298,8 → 298,7 |
.UserData dd ? ; request_queue_item.UserData |
end virtual |
; 1. Allocate the memory for the request description. |
push request_queue_item.sizeof |
pop eax |
movi eax, request_queue_item.sizeof |
call Kmalloc |
test eax, eax |
jnz @f |
1004,10 → 1003,8 |
; 4. Thus, create a temporary kernel thread which would do it. |
mov edx, [esp+8] |
push ebx ecx |
push 51 |
pop eax |
push 1 |
pop ebx |
movi eax, 51 |
movi ebx, 1 |
mov ecx, new_disk_thread |
; edx = parameter |
int 0x40 |
1069,8 → 1066,7 |
cmp [edx+usb_unit_data.UnitReadyAttempts], 3 |
jz @f |
push ecx edx esi |
push 10 |
pop esi |
movi esi, 10 |
call Sleep |
pop esi edx ecx |
stdcall queue_request, ecx, test_unit_ready_req, 0, test_unit_ready_callback, edx |
1124,8 → 1120,7 |
mov byte [edi-1], 'd' |
push eax |
push -'0' |
push 10 |
pop ecx |
movi ecx, 10 |
@@: |
cdq |
div ecx |