首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在FAT12中计算下一个集群

在FAT12中计算下一个集群
EN

Stack Overflow用户
提问于 2014-03-03 21:39:03
回答 1查看 143关注 0票数 0

这是来自: BrokenThorn的代码

代码语言:javascript
复制
; 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的目的是什么?

有没有一张我可以想象的图表?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-03 21:57:58

FAT元素有12位长,因此必须将元素索引乘以1.5才能得到字节偏移量

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22158025

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档