Get rid of one (1) jump

This commit is contained in:
shikhin 2023-03-19 19:32:28 +05:30
parent e900a60d4a
commit 8178c7a715
1 changed files with 9 additions and 13 deletions

View File

@ -42,7 +42,7 @@ initialize_mouse:
mov ax, 0xc205
mov bh, 3 ; TODO: This is the usual PS/2 mouse packet size, but is it correct here?
int 0x15
jc .error
jc initialize_mouse_error
; Set handler address
; https://www.ctyme.com/intr/rb-1603.htm
@ -50,24 +50,14 @@ initialize_mouse:
; es is already set correctly
mov bx, mouse_handler
int 0x15
jc .error
jc initialize_mouse_error
; Enable mouse
; https://www.ctyme.com/intr/rb-1596.htm
mov ax, 0xc200
mov bh, 1
int 0x15
jc .error
jmp .done
.error:
; https://www.ctyme.com/intr/rb-1601.htm
mov ax, 0xc201
int 0x15
jmp initialize_mouse
.done:
jc initialize_mouse_error
load_shell:
push word 0x1000
@ -117,6 +107,12 @@ mainloop:
call flip_mouse_cursor
jmp mainloop
initialize_mouse_error:
; https://www.ctyme.com/intr/rb-1601.htm
mov ax, 0xc201
int 0x15
jmp initialize_mouse
; ------------------------------------------------------------------
; Drawing subroutines
; ------------------------------------------------------------------