help help me!!!!!!!!!!!!!!!!!!!!!!!!!!!

cache333 2002-12-16 12:20:05


问题1:
请解释CHECKDOS的执行原理!!
StringComp proc uses es ds si di,
source: WORD,
dest : WORD,
number: WORD

mov ax, cs
mov ds, ax
mov es, ax
mov si, source
mov di, dest
mov cx, number
cld
repe cmpsb
mov ax, cx
ret
StringComp endp






CheckDos proc uses si di es ds
mov si, offset MSDOS1 ; io.sys
mov di, offset buff
INVOKE StringComp, si, di , 11
.if ax != 0 ;how read??
jmp NoDos
.endif

add di, 32 ;11 32 what?????
add si, 11 ; msdos.sys
INVOKE StringComp, si, di , 11
.if ax != 0
jmp NoDos
.endif
mov cx, 14
add si, 11 ; command.com
@@:
add di, 32
INVOKE StringComp, si, di , 11
.if ax != 0
loop @B ;@B what's mean??
jmp NoDos
.endif
.if di != offset buff+64
mov si, di
mov di, offset buff+64
mov cx, 32
mov ax, cs
mov ds, ax
mov es, ax
cld
rep movsb
.endif
mov havewrited, 0
INVOKE ReadWriteLogSector,3, 0,0 ,hidecyln, 0
inc havewrited

xor ax, ax
jmp the_ret
NoDos:
push cs
pop ds
mov ah,09h
mov dx,offset string_NoDos
int 21h

the_ret:
ret
CheckDos endp


问题2:
那么WRITEDOS怎样编写??
ReadDos proc
mov bx, offset buff
invoke ReadFile, word ptr [bx+1ah], dword ptr [bx+1ch]
invoke ReadFile, word ptr [bx+1ah+32], dword ptr [bx+1ch+32]
invoke ReadFile, word ptr [bx+1ah+64], dword ptr [bx+1ch+64]
ret
ReadDos endp


WriteDos proc uses eax ebx ecx edx ax bx cx,


?????????????????????????



ret
WriteDos endp

问题3:
GetDiskType proc near uses ax bx cx dx es
LOCAL currentdisk : BYTE
LOCAL detectedhdnumber: BYTE
LOCAL tableindex : WORD

mov currentdisk, 80h
xor ax, ax
mov detectedhdnumber, al
mov tableindex, ax

@@: mov dl, currentdisk
mov ah,8
int 13h ; Disk dl=drive 0 ah=func 08h
; get drive parameters, bl=type
; cx=cylinders, dh=max heads
jc @F

mov cs:HDnumber, dl

mov dl,cl /*具体在干什么????
and dl,3Fh ; '?'
xchg cl,ch
shr ch,6 ; Shift w/zeros fill
clc ; Clear carry flag
*/
mov bx, tableindex
mov cs:diskinfo[bx].track, cx
mov cs:diskinfo[bx].sector, dl
mov cs:diskinfo[bx].head, dh

inc detectedhdnumber
mov al, cs:HDnumber
.IF (detectedhdnumber < al) && ( al < 5)

add bx, type DISK
mov tableindex, bx
inc currentdisk
jmp @B
.ENDIF


@@:
ret
GetDiskType endp

YES_NT EQU 0
NO_NT EQU 1

...全文
33 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

21,459

社区成员

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

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