请教8086汇编文件指针移动问题

heitiantan 2011-06-28 09:26:10
用的是扩充文件管理方式,当CX=0000H,DX=0108H,AX=4200H,移动后为什么变成DX=0000H,而AX=0018H,怎么就变小了呢,我要向后移动啊,怎么比原来的DX还小?求救啊。
...全文
308 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
budao3 2011-06-30
  • 打赏
  • 举报
回复
Inp.:
AH = 42h
AL = origin of move
00h start of file
01h current file position
02h end of file
BX = file handle
CX:DX = offset from origin of new file position
Return: CF clear if successful
DX:AX = new file position in bytes from start of file
CF set on error
AX = error code (01h,06h) (see #1020 at AH=59h/BX=0000h)
Notes: for origins 01h and 02h, the pointer may be positioned before the
start of the file; no error is returned in that case, but subsequent
attempts at I/O will produce errors
if the new position is beyond the current end of file, the file will
be extended by the next write (see AH=40h)

首先,输入的BX是不是指向文件指针,不是的话,要先打开文件,并让bx指向文件指针
其次,你先确认下,在中断执行完之后,CF是否被置1了(八成是已经被置了),如果是有的话,就是出错了;
18h的错误提示是 bad request structure length,是不是你要移动的位置超过文件的长度。
cnzdgs 2011-06-28
  • 打赏
  • 举报
回复
看CF标志,失败了吧?
Areslee 2011-06-28
  • 打赏
  • 举报
回复
返回值是设置前的文件指针位置吧
canmeng 2011-06-28
  • 打赏
  • 举报
回复
是不是程序编写出错了?

21,453

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧