阅读:1374回复:3
为何用扩展int13读不出任何扇区?
我用软盘上的dos7.1启动系统并加载了himen.sys后,进入debug,在cs:100写了下列的代码:
mov ah,42h mov dl,80h mov di,1000 int 13 int 3 在ds:1000处写入了下列16进制码 10 00 01 00 13 0E 00 20 01 00 00 00 00 00 00 00 其中0E13是ds的值 原本想把第2个扇区读入内存ds:2000处,却在执行了上面的代码后cf返回1,ah返回4,经过查询返回的错误码ah=4的意思为:所寻找的扇区没找到。小弟初学扩展int13,根据资料所做,不知是何故,总是读不出任何扇区,求教高手帮我一把,非常感谢! |
|
沙发#
发布于:2003-12-30 08:22
我用软盘上的dos7.1启动系统并加载了himen.sys后,进入debug,在cs:100写了下列的代码: DS:SI -> disk address packet Format of disk address packet: Offset Size Description (Table 00272) 00h BYTE 10h (size of packet) 01h BYTE reserved (0) 02h WORD number of blocks to transfer (max 007Fh for Phoenix EDD) 04h DWORD -> transfer buffer 08h QWORD starting absolute block number (for non-LBA devices, compute as (Cylinder*NumHeads + SelectedHead) * SectorPerTrack + SelectedSector - 1 |
|
|
板凳#
发布于:2003-12-30 11:55
看看我的例子
.286 .model tiny DiskAddressPacket struc PacketSize db ? Reserver db ? BlockCount dw ? BufferAddr dw ? dw ? BlockNum dd ? dd ? DiskAddressPacket ends .code org 100h Start: push cs pop ds push cs pop es lea si,block mov byte ptr[si],16 mov word ptr[si+2],1 lea di,buffer mov word ptr[si+4],di mov word ptr[si+6],es mov word ptr[si+8],3fh mov dl,80h mov ax,4200h int 13h jc Failure mov ah,9 mov dx,offset Readmsg int 21h Exit: mov ax,4c00h int 21h Failure: mov ah,9 mov dx,offset Failmsg int 21h jmp Exit align 16 buffer db 512 dup(\"S\") Block DiskAddressPacket<> Readmsg db \"Section read OK!\",\"$\" Failmsg db \"Section read error!\",\"$\" end Start |
|
|
地板#
发布于:2003-12-30 13:04
非常感谢大家对我的帮助,我已经找到问题所在了,谢谢。
|
|