From 6b424844e901ff3dc9a43913573b824bfcf15927 Mon Sep 17 00:00:00 2001 From: Nathan Frost <41307858+nero@users.noreply.github.com> Date: Mon, 24 Jun 2019 17:05:57 +0000 Subject: [PATCH] Optimize fix_chs code --- boot/chs.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/chs.inc b/boot/chs.inc index 53c5c4b..1cceb56 100644 --- a/boot/chs.inc +++ b/boot/chs.inc @@ -4,10 +4,10 @@ fix_chs: jc chs_end ; skip if function does not exist inc dh mov [cs:fdc.nos], dh - mov ax, cx - and ax, 0x003F - mov [cs:fdc.spt], ax ; no adjustment because sectors are 1-indexed - mov ax, cx + push cx + and cx, 0x003F + mov [cs:fdc.spt], cx ; no adjustment because sectors are 1-indexed + pop ax xchg al, ah mov cl,6 shr ah,cl