I am reading sectors from my extended drive in Real Mode using the interrupt 0x13
with the function of extended drives 0x42
.
I define DAP to be 16 bytes in the following structure:
DAP:
db 0x10 ; size of DAP
db 0 ; Reserved zero
dw 0x0001 ; Number of sectors to read
dd 0x00000200 ; Memory Location to load the sector (s)
dq 0 ; Start of the sectors to be read
The DAP segment is of 8-bytes length as you could notice. During seeking for my sector (looping over sectors), I increment the segment and compare it to the real size of my drive. The wrong code that I am using to increment is limited to 16-bit mode:
mov ax, [DAP+0x08]
inc ax
mov [DAP+0x08], ax
I don't want to use several general purpose registers in a complicated addressing mode to achieve my purpose, I guess you have some simple and efficient way.