apparently "signed divide by 2" is "bit shift right" and I misread this shit documentation. Props to Intel for making up shit

This commit is contained in:
mykola2312 2024-08-07 07:35:48 +03:00
parent 7f35d3770b
commit ed9ac96552

View file

@ -23,7 +23,7 @@ test_disk_params:
mov %ch, %al mov %ch, %al
# write higher part # write higher part
mov %cl, %ah 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 mov %ax, disk_cylinders
# write sectors per cylinder # write sectors per cylinder
xor %ax, %ax xor %ax, %ax
@ -31,6 +31,11 @@ test_disk_params:
and $0b00111111, %al # 6 lower bits are sector count and $0b00111111, %al # 6 lower bits are sector count
mov %ax, disk_sectors 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 # now we can print all this info
movw disk_slaves, %ax movw disk_slaves, %ax
mov $str_slaves, %si mov $str_slaves, %si