From 1bad40143eb2e228e56cd15c82703366c1b3e511 Mon Sep 17 00:00:00 2001 From: pantonshire Date: Wed, 3 Jul 2024 09:22:21 +0100 Subject: [PATCH] explain div weirdness --- boot0.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot0.s b/boot0.s index 16a60cc..a5d2c8c 100644 --- a/boot0.s +++ b/boot0.s @@ -59,7 +59,7 @@ bits 16 setne cl ; sector - 1 = LBA % (sectors per track) inc cl xor ah, ah ; zero-extend temp - xor dx, dx ; TODO: explain why this is needed for div + xor dx, dx ; div by 16-bit register divides dx:ax, so we zero dx div bx ; ah = mod (head), al = div (cylinder) mov dh, ah ; head