Rev 3589 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3589 | Rev 3626 | ||
---|---|---|---|
Line 232... | Line 232... | ||
232 | jz .free |
232 | jz .free |
233 | ; We use 12 bytes for device type, interrupt pipe and interrupt packet size, |
233 | ; We use 12 bytes for device type, interrupt pipe and interrupt packet size, |
234 | ; 8 bytes for a packet and 8 bytes for previous packet, used by a keyboard. |
234 | ; 8 bytes for a packet and 8 bytes for previous packet, used by a keyboard. |
235 | ; 9. Initialize device data. |
235 | ; 9. Initialize device data. |
236 | mov [ebx+device_data.intpipe], eax |
236 | mov [ebx+device_data.intpipe], eax |
237 | push 8 |
- | |
238 | pop ecx |
237 | movi ecx, 8 |
239 | cmp edx, ecx |
238 | cmp edx, ecx |
240 | jb @f |
239 | jb @f |
241 | mov edx, ecx |
240 | mov edx, ecx |
242 | @@: |
241 | @@: |
243 | xor eax, eax |
242 | xor eax, eax |
Line 362... | Line 361... | ||
362 | inc esi |
361 | inc esi |
363 | cmp esi, 8 |
362 | cmp esi, 8 |
364 | jb .controlloop |
363 | jb .controlloop |
365 | .nocontrol: |
364 | .nocontrol: |
366 | ; 3. Initialize before loop for normal keys. esi = index. |
365 | ; 3. Initialize before loop for normal keys. esi = index. |
367 | push 2 |
- | |
368 | pop esi |
366 | movi esi, 2 |
369 | .normalloop: |
367 | .normalloop: |
370 | ; 4. Process one key which was pressed in the previous packet. |
368 | ; 4. Process one key which was pressed in the previous packet. |
371 | ; 4a. Get the next pressed key from the previous packet. |
369 | ; 4a. Get the next pressed key from the previous packet. |
372 | movzx eax, byte [ebx+esi+keyboard_data.prevpacket] |
370 | movzx eax, byte [ebx+esi+keyboard_data.prevpacket] |
373 | ; 4b. Ignore special codes. |
371 | ; 4b. Ignore special codes. |
Line 484... | Line 482... | ||
484 | @@: |
482 | @@: |
485 | ret 20 |
483 | ret 20 |
Line 486... | Line 484... | ||
486 | 484 | ||
487 | ; Auxiliary procedure for keyboard_data_ready. |
485 | ; Auxiliary procedure for keyboard_data_ready. |
488 | haskey: |
- | |
489 | push 2 |
486 | haskey: |
490 | pop edx |
487 | movi edx, 2 |
491 | @@: |
488 | @@: |
492 | cmp byte [ecx+edx], al |
489 | cmp byte [ecx+edx], al |
493 | jz @f |
490 | jz @f |
494 | inc edx |
491 | inc edx |