Load File From FAT 12 Problem.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
smainoo
Posts: 8
Joined: Tue Dec 11, 2012 1:41 pm

Load File From FAT 12 Problem.

Post 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 ??
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Load File From FAT 12 Problem.

Post by egos »

One FAT cell in FAT12 occupies 1.5 bytes.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Load File From FAT 12 Problem.

Post by bluemoon »

Are you talking about FAT12? If so, each cluster index is 12bit width, or 1.5 bytes long.
Post Reply