Use 286 shifts and rotates

This commit is contained in:
Juhani Krekelä 2023-03-18 14:31:35 +02:00
parent 8e47898c7a
commit f465c642c4
1 changed files with 3 additions and 6 deletions

View File

@ -100,8 +100,7 @@ mainloop:
mov bx, [mouse_x] mov bx, [mouse_x]
shr bx, 1 shr bx, 1
mov cx, [mouse_y] mov cx, [mouse_y]
shr cx, 1 shr cx, 2
shr cx, 1
cmp [mouse_column], bl cmp [mouse_column], bl
jne .update_cursor jne .update_cursor
cmp [mouse_row], cl cmp [mouse_row], cl
@ -155,8 +154,7 @@ flip_mouse_cursor:
; Swap foreground and background colours ; Swap foreground and background colours
inc bx inc bx
mov al, [es:bx] mov al, [es:bx]
mov cl, 4 ror al, 4
ror al, cl
mov [es:bx], al mov [es:bx], al
popa popa
@ -404,8 +402,7 @@ hexprint16:
hexprint8: hexprint8:
push ax push ax
push cx push cx
mov cl, 4 shr al, 4
shr al, cl
call hexprint4 call hexprint4
pop cx pop cx
pop ax pop ax