2014-03-03 93 views
0

這是代碼:BrokenThorn下一個計算集羣中的FAT12

; compute next cluster 

      mov  ax, WORD [cluster] ; identify current cluster from FAT 

    ; is the cluster odd or even? Just divide it by 2 and test! 

      mov  cx, ax    ; copy current cluster 
      mov  dx, ax    ; copy current cluster 
      shr  dx, 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 

我不明白add cx, dx 什麼是增加CX和DX的目的邏輯?

有沒有一個圖表,我可以想象這個?

回答

1

FAT元素長12位,因此您必須將元素索引乘以1.5以獲得字節偏移量

相關問題