程序集INT 13h-读取磁盘问题 [英] Assembly INT 13h - read disk problem

查看:116
本文介绍了程序集INT 13h-读取磁盘问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够以汇编形式编写程序,以读取磁盘的第一个扇区(MBR)并将其写入软盘或至少显示数据. 我知道INT 13h和25h在Windows保护模式下不起作用,我什至在Dos中尝试了我的代码,但是在运行程序时dos系统挂起.这是代码:

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是缓冲区变量.

result is the buffer variable.

谢谢.

推荐答案

是.终于奏效了.这是代码(仅在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.

            mov dx,80h
        mov cx,1
        mov bx,ds
        mov es,bx
        mov bx,offset result
        mov ax,0201h
        int 13h     

这篇关于程序集INT 13h-读取磁盘问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆