⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 info.asm

📁 功能强大的磁盘维护工具
💻 ASM
📖 第 1 页 / 共 2 页
字号:
extern GetKey:far,GetCursor:far,ResumeScreen:far	;From Common
extern Dap:byte,DapOffset:word,DapSegment:word,DapBlockNumLL:word,DapBlockNumLH:word	;From Main
extern _CurDisk:byte,DiskBuffer:byte,DrivePacket:byte,_DriveCount:byte,_TempDwordH:word,_TempDwordL:word,_DiskCount:byte,_EInt13Ver:word,_EInt13API:word,OffsetBuffer1:byte,HexBuffer1:byte,ErrorTitle:byte,ConOKSel:byte	;From Main
extern _MaxCylin:word,_MaxHead:word,_MaxSect:word,_MaxSectLH:word,_SectPerTrack:word,_SectSize:word
extern MenuBar:byte,State_Red:byte,State_Black:byte	;From Main
public CHSBuffer,_TempCylin,_TempHead,_TempSector,State_ROnly,DiskSize
public Ascii,Color,Partition,LogDisk,PhyDisk

include MACRO.ASM

.model small
.data
	CHSBuffer byte 9 dup(0)

	HeadLineLogDisk byte 0b3h," Disk Logical Information ",0b3h,"$"
	HeadLinePhyDisk byte 0b3h," Disk Physical Information ",0b3h,"$"
	HeadLinePartition byte 0b3h," Partition Table ",0b3h,"$"
	HeadLineAscii byte 0b3h," ASCII Codes Table ",0b3h,"$"
        HeadLineColor byte 0b3h," Color Codes Table ",0b3h,"$"
        ColorHeader byte "Color Name",5 dup(0),"IRGB",4 dup(0),"HEX",3 dup(0),"E.G","$"
        CBlack byte "BLACK",10 dup(0),"0000B",3 dup(0),"00H",3 dup(0),3 dup(0dbh),"$"
        CBlue byte "BLUE",11 dup(0),"0001B",3 dup(0),"01H",3 dup(0),3 dup(0dbh),"$"
        CGreen byte "GREEN",10 dup(0),"0010B",3 dup(0),"02H",3 dup(0),3 dup(0dbh),"$"
        CCyan byte "CYAN",11 dup(0),"0011B",3 dup(0),"03H",3 dup(0),3 dup(0dbh),"$"
        CRed byte "RED",12 dup(0),"0100B",3 dup(0),"04H",3 dup(0),3 dup(0dbh),"$"
        CMagenta byte "MAGENTA",8 dup(0),"0101B",3 dup(0),"05H",3 dup(0),3 dup(0dbh),"$"
        CBrown byte "BROWN",10 dup(0),"0110B",3 dup(0),"06H",3 dup(0),3 dup(0dbh),"$"
        CLightGray byte "LIGHTGRAY",6 dup(0),"0111B",3 dup(0),"07H",3 dup(0),3 dup(0dbh),"$"
        CDarkGray byte "DARKGRAY",7 dup(0),"1000B",3 dup(0),"08H",3 dup(0),3 dup(0dbh),"$"
        CLightBlue byte "LIGHTBLUE",6 dup(0),"1001B",3 dup(0),"09H",3 dup(0),3 dup(0dbh),"$"
        CLightGreen byte "LIGHTGREEN",5 dup(0),"1010B",3 dup(0),"0AH",3 dup(0),3 dup(0dbh),"$"
        CLightCyan byte "LIGHTCYAN",6 dup(0),"1011B",3 dup(0),"0BH",3 dup(0),3 dup(0dbh),"$"
        CLightRed byte "LIGHTRED",7 dup(0),"1100B",3 dup(0),"0CH",3 dup(0),3 dup(0dbh),"$"
        CLightMagenta byte "LIGHTMAGENTA",3 dup(0),"1101B",3 dup(0),"0DH",3 dup(0),3 dup(0dbh),"$"
        CYellow byte "YELLOW",9 dup(0),"1110B",3 dup(0),"0EH",3 dup(0),3 dup(0dbh),"$"
        CWhite byte "WHITE",10 dup(0),"1111B",3 dup(0),"0FH",3 dup(0),3 dup(0dbh),"$"
	PartitionHeader byte "Drv  Boot  Format  BCylin  BHead  BSect  ECylin  EHead  ESect  PartSects","$"
	PartitionList byte 72 dup(0),"$"
	DiskTCylin byte "Cylinders :","$"
	DiskTHead byte "Heads :","$"
	DiskTSPerT byte "Sectors per Track :","$"
	DiskSize byte "bytes","$"
	DiskLogTNum byte "Numbers of HardDisk :","$"
	DiskLogTCurDisk byte "Current HardDisk :","$"
	DiskLogTEInt13 byte "Support With Extend 13H :  Yes","$"
	DiskLogTEVer byte "Extend Version :","$"
	DiskLogTSupBitmap byte "API Subclass Support Bitmap :","$"
	DiskLogTSectSize byte "Sector Sizes :","$"
	DiskLogTSector byte "Total Sectors :","$"
	DiskLogTDiskSize byte " Disk Total Sizes :","$"
	DiskLogCurDisk byte "Hard Disk ",00,"$"
	DiskLogEVer byte 00,".x","$"
	DiskLogDiskSize byte "MBytes","$"
	DiskPhyTTrackTSize byte "Track Sizes :","$"
	DiskPhyTSerialNo byte "Serial Number :","$"
	DiskPhyTConType byte "Controller Type :","$"
	DiskPhyConType0 byte "Not Set","$"
        DiskPhyConType1 byte "Single-Port,Single-Sector-Buffer","$"
        DiskPhyConType2 byte "Double-Port,Multi-Sector-Buffer","$"
        DiskPhyConType3 byte "Double-Port,Multi-Sector-Buffer,Flip-Latch","$"
        DiskPhyConTypeUn byte "Unknown","$"
        DiskPhyTBufPage byte "Buffer Pages :","$"
	DiskPhyTBufPageNote byte "( 512 bytes per Page )","$"
	DiskPhyTECC byte "ECC Verify Code Length :","$"
	DiskPhyTConVer byte "Controller Version :","$"
	DiskPhyTDiskType byte "HardDisk Type :","$"
	ErrorPhyDisk byte "This Program can Only be Run in Real DOS Mode !","$"

	_TempCylin word 0
	_TempHead word 0
	_TempSector word 0

.code
.startup


LogDisk proc far

        mov ax,@data
        mov es,ax

	Call IntialInfo
        ShowString_DOS HeadLineLogDisk,26,3
	OpenWin 41,5,75,19,9fh
	Call State_ROnly

	ShowString_DOS DiskLogTNum,18,5
	mov al,_DiskCount
	Hex2Ascii al
	GotoXY 41,5
	ShowChar_DOS al

	ShowString_DOS DiskLogTCurDisk,21,6
	mov al,_CurDisk
	sub al,4fh
	mov di,offset DiskLogCurDisk
	mov [di+10],al
	ShowString_DOS DiskLogCurDisk,41,6


	ShowString_DOS DiskLogTEInt13,14,8

	ShowString_DOS DiskLogTEVer,23,9
	mov ax,_EInt13Ver
	Hex2Ascii ah
	mov byte ptr DiskLogEVer,ah
	ShowString_DOS DiskLogEVer,41,9

	ShowString_DOS DiskLogTSupBitmap,10,10
	mov ax,_EInt13API
	Hex2Ascii al
	GotoXY 41,10
	ShowChar_DOS al

	ShowString_DOS DiskTCylin,28,12
	Hex2BCD 0,_MaxCylin,CHSBuffer,4,5
	GotoXY 41,12
	mov di,offset CHSBuffer
	mov cx,5
TrimCylin:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimCylin

	ShowString_DOS DiskTHead,32,13
	Hex2BCD 0,_MaxHead,CHSBuffer,2,3
	GotoXY 41,13
	mov di,offset CHSBuffer
	mov cx,3
TrimHead:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimHead

	ShowString_DOS DiskTSPerT,20,14
	Hex2BCD 0,_SectPerTrack,CHSBuffer,1,2
	GotoXY 41,14
	mov di,offset CHSBuffer
	mov cx,2
TrimSPTrack:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimSPTrack

	ShowString_DOS DiskLogTSector,24,15
	Hex2BCD _MaxSectLH,_MaxSect,CHSBuffer,8,9
	GotoXY 41,15
	mov di,offset CHSBuffer
	mov cx,9
TrimSector:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimSector

	ShowString_DOS DiskLogTSectSize,25,16
	Hex2BCD 0,_SectSize,CHSBuffer,2,3
	GotoXY 41,16
	mov di,offset CHSBuffer
	mov cx,3
TrimSectSize:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimSectSize
	Call GetCursor
	inc dl
	ShowString_DOS DiskSize,dl,16



	ShowString_DOS DiskLogTDiskSize,20,18
	mov dx,_MaxSectLH
	mov ax,_MaxSect

	mov bl,dl
	mov cl,5
	shl bl,cl
	mov cl,3
	shr dx,cl
	shr ah,cl
	or ah,bl

	mov bl,ah
	mov bh,dl
	mov _TempDwordL,bx

	xor bx,bx
	mov bl,dh
	mov _TempDwordH,bx

	Hex2BCD _TempDwordH,_TempDwordL,CHSBuffer,6,7
	GotoXY 41,18
	mov di,offset CHSBuffer
	mov cx,7
TrimSize:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimSize
	Call GetCursor
	inc dl
	ShowString_DOS DiskLogDiskSize,dl,18


KeyCheck:
        Call GetKey
        .if al==1bh                     ;ESC
        jmp Exit
        .endif
        jmp KeyCheck
        
Exit:
        ret
LogDisk endp


PhyDisk proc far

        mov ax,@data
        mov es,ax

	Call IntialInfo
        ShowString_DOS HeadLinePhyDisk,26,3
        OpenWin 32,5,74,17,9fh
	Call State_ROnly

	mov dx,1f7h
	xor cx,cx
	not cx
CheckReady:
	in al,dx
	and al,0c0h
	.if al==40h
	jmp GetData
	.endif
	loop CheckReady
	Call Invalid
	jmp Exit

GetData:
	mov dx,1f6h
	mov al,0a0h
	out dx,al

	mov dx,1f7h
	mov al,0ech
	out dx,al

CheckRead:
	in al,dx
	.if al!=58h
	jmp CheckRead
	.endif

	mov cx,100h
	mov di,offset DiskBuffer
	mov dx,1f0h
ReadOut:
	in ax,dx
	mov word ptr [di],ax
	add di,2
	loop ReadOut


	mov bp,offset DiskBuffer

	ShowString_DOS DiskTCylin,19,5
	Hex2BCD 0,word ptr [bp+2],CHSBuffer,4,5
	GotoXY 32,5
	mov di,offset CHSBuffer
	mov cx,5
TrimCylin:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimCylin

	ShowString_DOS DiskTHead,23,6
	Hex2BCD 0,word ptr [bp+6],CHSBuffer,4,5
	GotoXY 32,6
	mov di,offset CHSBuffer
	mov cx,5
TrimHead:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimHead

	ShowString_DOS DiskTSPerT,11,7
	Hex2BCD 0,word ptr [bp+0ch],CHSBuffer,4,5
	GotoXY 32,7
	mov di,offset CHSBuffer
	mov cx,5
TrimSPTrack:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimSPTrack


        ShowString_DOS DiskPhyTTrackTSize,17,8
	Hex2BCD 0,word ptr [bp+8],CHSBuffer,4,5
        GotoXY 32,8
	mov di,offset CHSBuffer
	mov cx,5
TrimTrackSize:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimTrackSize
        Call GetCursor
        inc dl
        ShowString_DOS DiskSize,dl,8

	ShowString_DOS DiskPhyTConType,13,10
        mov ax,word ptr [bp+28h]
        .if ax==0
	ShowString_DOS DiskPhyConType0,32,10
        .elseif ax==1
	ShowString_DOS DiskPhyConType1,32,10
        .elseif ax==2
	ShowString_DOS DiskPhyConType2,32,10
        .elseif ax==3
	ShowString_DOS DiskPhyConType3,32,10
        .else
        ShowString_DOS DiskPhyConTypeUn,32,10
	.endif

	ShowString_DOS DiskPhyTBufPage,16,11
	Hex2BCD 0,word ptr [bp+2ah],CHSBuffer,4,5
	GotoXY 32,11
	mov di,offset CHSBuffer
	mov cx,5
TrimBufPage:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimBufPage
	Call GetCursor
	inc dl
	ShowString_DOS DiskPhyTBufPageNote,dl,11

	ShowString_DOS DiskPhyTECC,6,12
	Hex2BCD 0,word ptr [bp+2ch],CHSBuffer,4,5
	GotoXY 32,12
	mov di,offset CHSBuffer
	mov cx,5
TrimECC:
	mov al,[di]
	.if al!=0
	ShowChar_DOS al
	.endif
	inc di
	loop TrimECC


	ShowString_DOS DiskPhyTConVer,10,13
	mov cx,4
	mov di,offset DiskBuffer
TradeConVer:
        mov al,[di+2eh]
        mov ah,[di+2fh]
	xchg ah,al
        mov [di+2eh],al
        mov [di+2fh],ah
	add di,2
	loop TradeConVer
	push bp
	add bp,2eh

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -