For instance the following instructions provides wrong result, how to make it right ?? (i heard something of 0x66 prefix and incase of address 0x67 -- but how to use them ??)
Code:
Code: Select all
;; just to remind you [BITS 16]
AND EAX, 0x0000FFFF
SUB EAX, 2
XOR ECX, ECX
MOV CL, [SectorsPerCluster]
MUL ECX
ADD EAX, DWORD [DataAreaStart]
ADD EAX, [LBAStart]
;MOV EAX, 969434
MOV [DAP + 8], EAX
CALL ReadSectorsLBA_
The formula i am using is
LBA_addr = offset_from_partition_table + DataAreaStart + (cluster_no - 2) * sectors_per_cluster
In my code
offset_from_partition_table = LBAStart
DataAreaStart = DataAreaStart
cluster_no = AX
sectors_per_clusetr = SectorsPerCluster
Just assume other values of my bootloaders are correct, i have tested it.
U c the Sector Number field of DAP and the LBAStart is both DWORD so had no way but resort to EAX.
Regards and thanx in advance.