程序集 INT 13h - 读磁盘问题
我需要能够用汇编语言编写一个程序来读取磁盘的第一个扇区(MBR)并将其写入软盘或至少显示数据。 我知道 INT 13h 和 25h 在 Windows 保护模式下不起作用,我什至在 Dos 中尝试了我的代码,但当我运行程序时,dos 系统挂起。这是代码:
MOV byte ptr es:[bx], offset result
MOV AL,1 ;number ofsectors to read
MOV Cl,1
MOV ch,0
mov dl,80h ;the HDD
mov dh,1
mov ah,02h
INT 13h
结果是缓冲区变量。
提前致谢。
I need to be able to write a program in assembly to read the first sector of a disk (The MBR) and write it to a floppy disk or at least show the data.
I understand that INT 13h and 25h do not work in the windows protected mode and i even tried my code in Dos but the dos system hangs when I run the program. This is the code:
MOV byte ptr es:[bx], offset result
MOV AL,1 ;number ofsectors to read
MOV Cl,1
MOV ch,0
mov dl,80h ;the HDD
mov dh,1
mov ah,02h
INT 13h
result is the buffer variable.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这行是错误的
它应该是
也许你还必须恢复
ES
,例如I think this line is wrong
It should be
And maybe you also have to restore the
ES
, example是的。终于成功了。这是代码(仅在 DOS 中运行,因为 INT 13h 无法在 Windows 操作系统中运行。
Yeb. it finally worked. This is the code (only runs in DOS because the INT 13h can't run in windows OSes.