Page 1 of 1

Load File From FAT 12 Problem.

Posted: Tue Dec 11, 2012 2:56 pm
by smainoo
Hi

I'm New in OS development, I have some Problems With Codes.

mov ax, WORD [cluster] ; identify current cluster
shr ax, 0x0001 ; divide by two
add cx, dx ; sum for (3/2)
mov bx, 0x0200 ; location of FAT in memory
add bx, cx ; index into FAT
mov dx, WORD [bx] ; read two bytes from FAT

I found That to get the 2nd cluster , you Multiply the 1st cluster By 1.5 !! But I can't understand why ??

Re: Load File From FAT 12 Problem.

Posted: Tue Dec 11, 2012 3:18 pm
by egos
One FAT cell in FAT12 occupies 1.5 bytes.

Re: Load File From FAT 12 Problem.

Posted: Tue Dec 11, 2012 3:18 pm
by bluemoon
Are you talking about FAT12? If so, each cluster index is 12bit width, or 1.5 bytes long.