Commit diff
Commit 942b876bd46561f8140e0cc6ecb70e2e05c3447
commit 942b876bd46561f8140e0cc6ecb70e2e05c34474
Author: Greg Haerr <greg@censoft.com>
Date: Thu Feb 19 19:03:07 2026 -0700
Remove ASM instruction by reusing BX value
---
elks/arch/i86/drivers/char/serfast.S | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/elks/arch/i86/drivers/char/serfast.S b/elks/arch/i86/drivers/char/serfast.S
index 5600291a..a5e7cdbe 100644
--- a/elks/arch/i86/drivers/char/serfast.S
+++ b/elks/arch/i86/drivers/char/serfast.S
@@ -72,10 +72,9 @@ common_entry:
mov 0x4(%si),%bx // bx = q->head
mov 0x8(%si),%di // di = q->base
mov %dl,(%bx,%di) // q->base[q->head] = c
- mov 0x4(%si),%ax // ax = q->head
- inc %ax
- mov %ax,0x4(%si) // ++q->head
- cmp 0x2(%si),%ax // if (q->size < q->head)
+ inc %bx
+ mov %bx,0x4(%si) // ++q->head
+ cmp 0x2(%si),%bx // if (q->size < q->head)
jl 1f
movw $0x0,0x4(%si) // q->head = 0
1: incw (%si) // q->len++