📄 info.asm
字号:
ShowString_BIOS 8,32,13,9fh
pop bp
ShowString_DOS DiskPhyTSerialNo,15,15
mov cx,10
mov di,offset DiskBuffer
TradeSerialNo:
mov al,[di+14h]
mov ah,[di+15h]
xchg ah,al
mov [di+14h],al
mov [di+15h],ah
add di,2
loop TradeSerialNo
push bp
add bp,14h
ShowString_BIOS 20,32,15,9fh
pop bp
ShowString_DOS DiskPhyTDiskType,15,17
mov cx,20
mov di,offset DiskBuffer
TradeDiskType:
mov al,[di+36h]
mov ah,[di+37h]
xchg ah,al
mov [di+36h],al
mov [di+37h],ah
add di,2
loop TradeDiskType
push bp
add bp,36h
ShowString_BIOS 40,32,17,9fh
pop bp
KeyCheck:
Call GetKey
.if al==1bh ;ESC
jmp Exit
.endif
jmp KeyCheck
Exit:
ret
PhyDisk endp
Partition proc far
mov ax,@data
mov es,ax
Call IntialInfo
OpenWin 3,6,76,19,9fh
Call State_ROnly
ShowString_DOS HeadLinePartition,31,3
ShowString_DOS PartitionHeader,4,5
ClearArr DapBlockNumLL,4
ClearArr _TempDwordL,2
xor cx,cx
mov cl,_DriveCount
mov dh,6
mov di,offset DrivePacket
mov si,offset PartitionList
mov bp,offset DiskBuffer
DisplayPart:
push cx
push dx
ClearArr PartitionList,36
.if dh==6
mov byte ptr [si+1],"C"
mov DapBlockNumLH,0
mov DapBlockNumLL,0
.else
mov al,[di]
mov [si+1],al
mov ax,WORD ptr [di+3]
mov DapBlockNumLH,ax
mov ax,WORD ptr [di+1]
mov DapBlockNumLL,ax
add di,5
.endif
EInt13 42h,DiskBuffer
.if byte ptr [bp+1beh]==80h
mov byte ptr [si+6],"Y"
mov word ptr [si+7],"se" ;Yes
.else
mov word ptr [si+7],"oN"
.endif
.if byte ptr [bp+1c2h]==06h
mov byte ptr [si+12],"F"
mov word ptr [si+13],"TA"
mov word ptr [si+15],"61" ;FAT16
.elseif byte ptr [bp+1c2h]==0bh
mov byte ptr [si+12],"F"
mov word ptr [si+13],"TA"
mov word ptr [si+15],"23" ;FAT32
.else
mov word ptr [si+13],"??"
mov word ptr [si+15],"??" ;????
.endif
DivCySe [bp+1c0h],[bp+1c1h],_TempCylin,byte ptr _TempSector
Hex2BCD 0,_TempCylin,PartitionList,24,5
mov al,[bp+1bfh]
mov byte ptr _TempHead,al
Hex2BCD 0,_TempHead,PartitionList,31,3
Hex2BCD 0,_TempSector,PartitionList,38,2
DivCyse [bp+1c4h],[bp+1c5h],_TempCylin,byte ptr _TempSector
Hex2BCD 0,_TempCylin,PartitionList,46,5
mov al,[bp+1c3h]
mov byte ptr _TempHead,al
Hex2BCD 0,_TempHead,PartitionList,53,3
Hex2BCD 0,_TempSector,PartitionList,60,2
mov ax,WORD ptr [bp+1cah]
mov _TempDwordL,ax
mov ax,WORD ptr [bp+1cch]
mov _TempDwordH,ax
Hex2Bcd _TempDwordH,_TempDwordL,PartitionList,71,9
pop dx
ShowString_DOS PartitionList,4,dh
inc dh
pop cx
dec cx
.if cx!=0
jmp DisplayPart
.endif
KeyCheck:
Call GetKey
.if al==1bh ;ESC
jmp Exit
.endif
jmp KeyCheck
Exit:
ret
Partition endp
Ascii proc far
mov ax,@data
mov es,ax
Call IntialInfo
ShowString_DOS HeadLineAscii,29,3
Call State_ROnly
;---| 2.1 Create Ascii Table List |---
xor ax,ax
mov di,offset DiskBuffer
mov cx,256
MakeAscii:
mov [di],al
inc di
inc al
loop MakeAscii
;---| 2.2 Create Offset List |---
xor bx,bx
mov di,offset OffsetBuffer1
inc di
mov cx,16
MakeOffset:
push cx
HexByte2Ascii bl,[di],[di+1]
pop cx
inc bx
add di,5
loop MakeOffset
;---| 2.3 Convert ASCII Codes to Hex Codes |===
mov bx,offset DiskBuffer
mov bp,offset HexBuffer1
xor di,di
xor si,si
mov cx,256
MakeHex:
push cx
HexByte2Ascii [bx+di],[bp+si],[bp+si+1]
pop cx
inc di
add si,3
loop MakeHex
;---| 2.4 Filter ASCII Codes |---
mov bx,offset DiskBuffer
xor di,di
mov cx,256
FilterAscii:
mov al,[bx+di]
.if al==07h || al==08h || al==0ah || al==0bh || al==0dh
mov al,2eh
.endif
mov [bx+di],al
inc di
loop FilterAscii
;---| 3.1 Display Offset List |---
mov bp,offset OffsetBuffer1
mov cx,16
mov dh,4
DisplayOffset:
push cx
ShowString_BIOS 5,4,dh,9fh
pop cx
inc dh
add bp,5
loop DisplayOffset
;---| 3.2 Display Hex Codes |---
mov bp,offset HexBuffer1
mov cx,16
mov dh,4
DisplayHex:
push cx
ShowString_BIOS 48,0bh,dh,9fh
pop cx
inc dh
add bp,48
loop DisplayHex
;---| 3.3 Display ASCII Codes |---
mov bp,offset DiskBuffer
mov cx,16
mov dh,4
DisplayAscii:
push cx
ShowString_BIOS 16,3ch,dh,9fh
pop cx
inc dh
add bp,16
loop DisplayAscii
;---| 3.4 Fix Display Missing |--
GotoXY 67,4
MulShowChar 07h,1
GotoXY 68,4
MulShowChar 08h,1
GotoXY 70,4
MulShowChar 0ah,1
GotoXY 71,4
MulShowChar 0bh,1
GotoXY 73,4
MulShowChar 0dh,1
;===| 4. Check Key |===
KeyCheck:
Call GetKey
.if al==1bh ;ESC
jmp Exit
.endif
jmp KeyCheck
Exit:
ret
Ascii endp
Color proc far
mov ax,@data
mov es,ax
Call IntialInfo
ShowString_DOS HeadLineColor,29,3
OpenWin 3,6,76,13,9fh
Call State_ROnly
ShowString_DOS ColorHeader,5,5
ShowString_DOS CBlack,5,6
ShowString_DOS CBlue,5,7
ShowString_DOS CGreen,5,8
ShowString_DOS CCyan,5,9
ShowString_DOS CRed,5,10
ShowString_DOS CMagenta,5,11
ShowString_DOS CBrown,5,12
ShowString_DOS CLightGray,5,13
ShowString_DOS ColorHeader,43,5
ShowString_DOS CDarkGray,43,6
ShowString_DOS CLightBlue,43,7
ShowString_DOS CLightGreen,43,8
ShowString_DOS CLightCyan,43,9
ShowString_DOS CLightRed,43,10
ShowString_DOS CLightMagenta,43,11
ShowString_DOS CYellow,43,12
ShowString_DOS CWhite,43,13
xor bx,bx
mov dh,6
mov dl,34
mov cx,16
DisplayLoop:
push cx
GotoXY dl,dh
MulShowCharA 0dbh,bl,3
inc dh
inc bl
.if bl==08h
mov dh,6
mov dl,72
.endif
pop cx
loop DisplayLoop
KeyCheck:
Call GetKey
.if al==1bh ;ESC
jmp Exit
.endif
jmp KeyCheck
Exit:
ret
Color endp
State_ROnly proc far
OpenWin 0,24,79,24,0f0h
mov bp,offset State_Red
ShowString_BIOS 3,2,24,0fch
mov bp,offset State_Black
add bp,5
ShowString_BIOS 5,5,24,0f0h
ret
State_ROnly endp
IntialInfo proc near
OpenWin 0,1,79,1,70h
ShowString_DOS MenuBar,3,1
GotoXY 0,2
MulShowCharA 0b1h,9fh,1760
OpenWin 3,4,78,21,08h
OpenWin 2,3,77,20,9eh
DRectangle 2,3,77,20
ret
IntialInfo endp
Invalid proc near
OpenWin 15,10,66,16,00h
OpenWin 14,9,65,15,0cfh
Rectangle 14,9,65,15
OpenWin 14,9,65,9,0f4h
ShowString_DOS ErrorTitle,37,9
ShowString_DOS ErrorPhyDisk,17,11
OpenWin 37,13,42,13,0f4h
ShowString_DOS ConOKSel,37,13
DialogKeyCheck:
Call GetKey
.if al==1bh || al==0dh
ret
.endif
jmp DialogKeyCheck
Invalid endp
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -