diff options
-rw-r--r-- | src/kernel/serial.asm | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/kernel/serial.asm b/src/kernel/serial.asm index 9077d99..6318bc5 100644 --- a/src/kernel/serial.asm +++ b/src/kernel/serial.asm @@ -22,18 +22,14 @@ send_byte:;void send_byte(uint8_t value, uint8_t port) push ebp mov ebp, esp - mov cl, byte [ebp + 8] ;value - xor edx, edx - mov dl, byte [ebp + 12];port + xor ecx, ecx + mov cl, byte [ebp + 12];port - test dl, 0xfc + test cl, 0xfc jnz .leave - xchg ebx, edx - shl bl, 1 - mov ax, word [ebx + com_ports] - mov ebx, edx - mov dx, ax + shl cl, 1 + mov dx, word [ecx + com_ports] or dx, 5 @@ -44,7 +40,7 @@ send_byte:;void send_byte(uint8_t value, uint8_t port) and dx, 0xfff8 - mov al, cl + mov al, byte [ebp + 8];value out dx, al .leave: @@ -57,17 +53,14 @@ read_byte:;uint8_t read_byte(uint8_t port) xor eax, eax - xor edx, edx - mov dl, byte [ebp + 8];port + xor ecx, ecx + mov cl, byte [ebp + 8];port - test dl, 0xfc + test cl, 0xfc jnz .leave - xchg ebx, edx - shl bl, 1 - mov cx, word [ebx + com_ports] - mov ebx, edx - mov dx, cx + shl cl, 1 + mov dx, word [ecx + com_ports] or dx, 5 |