From ed9ac9655290211ad46328e960cc4fb2c016a88c Mon Sep 17 00:00:00 2001 From: mykola2312 <49044616+mykola2312@users.noreply.github.com> Date: Wed, 7 Aug 2024 07:35:48 +0300 Subject: [PATCH] apparently "signed divide by 2" is "bit shift right" and I misread this shit documentation. Props to Intel for making up shit --- src/test_disk_params.s | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test_disk_params.s b/src/test_disk_params.s index d3857f3..d277bca 100644 --- a/src/test_disk_params.s +++ b/src/test_disk_params.s @@ -23,7 +23,7 @@ test_disk_params: mov %ch, %al # write higher part mov %cl, %ah - shr $3, %ah # shift 6 bits to right, because cylinder num's high part is in high 2 bits + shr $6, %ah # shift 6 bits to right, because cylinder num's high part is in high 2 bits mov %ax, disk_cylinders # write sectors per cylinder xor %ax, %ax @@ -31,6 +31,11 @@ test_disk_params: and $0b00111111, %al # 6 lower bits are sector count mov %ax, disk_sectors + # these values are MAX value, so to get TOTAL need to add 1 to each one + incw disk_heads + incw disk_cylinders + incw disk_sectors + # now we can print all this info movw disk_slaves, %ax mov $str_slaves, %si