Estex-DSS/SHELL/Commands/INFO.ASM
Tolik b38d6ccd48 removed #55aa for GenIOCTL
new subfunction GetMoreParams for GenIOCTL
2026-03-27 00:16:01 +10:00

199 lines
3.6 KiB
NASM
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;[ ] 24/06/2024
cmd_info: CALL Get_Path
;
LD DE,MAIN_MSG.INFO_1 ; 身丰花 "Drive Label Serial number Size"
CALL ECHO_MESSAGE
;
LD HL,.Collect_Msg
LD C,Dss.PChars
RST ToDSS
;
LD A,":"
LD (Buffers.bat_params.PRM9+1),A
XOR A
LD (Buffers.bat_params.PRM9+2),A ; Drive "X:",0
LD (read_disk_info.full),A
;
LD C,Dss.CurDisk
RST ToDSS
LD B,C
LD C,-1
;
.loop: INC C
PUSH BC
LD A,C
LD (.patch_A),A
ADD "A"
LD (Buffers.bat_params.PRM9),A
LD (.Collect_Msg+1),A
;
LD HL,.Collect_Msg
LD C,Dss.PChars
RST ToDSS
;
.patch_A+1: LD A,0
CALL read_disk_info
JR NC,.info_ok
;
CP DSS_Error.sys.MEDIA_CHANGED
JR NZ,.Unsupported_Partition
;
LD A,(.patch_A)
CALL read_disk_info
JR C,.Unsupported_Partition
; %7 - Volume label
; serial_string - Volume serial number string
; full_space_high \
; full_space_medium - Partition size
; full_space_low /
;
.info_ok: LD HL,serial_string
LD DE,Buffers.bat_params.PRM4 ; Volume serial number string
CALL ncopy_string
; full capacity
ld a,(full_space_high)
ld hl,(full_space_medium) ; 摵. <20>抉鴾
exx
ld hl,(full_space_low) ; 洮. <20>抉鴾
.convert_hex: CALL PRN_DISK_SIZE
; %5..6 - Full size
;
; 銈酮罱兒恥<E58592>言 PRM5
LD HL,Buffers.bat_params.PRM5 - 1
LD DE,Buffers.bat_params.PRM5
.clear_spaces: INC HL
LD A,(HL)
CP " "
JR Z,.clear_spaces
AND A
CALL NZ,copy_string
;
.print_info_2: LD DE,MAIN_MSG.INFO_2 ; 身丰花 "Drive Label Serial number Size"
CALL ECHO_MESSAGE
;
.next_drv: POP BC
DJNZ .loop
;
LD A,"\n"
LD C,Dss.PutChar
RST ToDSS
JP RESTORE_ALL.path
;RET
;
.Unsupported_Partition:
LD HL,.none_string
LD DE,Buffers.bat_params.PRM4 ; Volume serial number string
CALL ncopy_string
LD HL,.none_string
LD DE,Buffers.bat_params.PRM7 ; Volume label
CALL ncopy_string
LD HL,.Unknown_str
LD DE,Buffers.bat_params.PRM8 ; Volume file system
CALL ncopy_string
;
POP BC
PUSH BC
LD A,C
CP "C" - "A"
JR C,.ItIsFDD
;
;LD DE,Dss.DRV.GenIOCTL.Enter
LD BC,Dss.DRV.GenIOCTL.GetParams
RST ToDSS.DRV
JR C,.noMedia
LD A,H
AND %1111'0000 ; 能恥丞<E681A5> <20> 陋洛<E9998B> 嵽芬桌<E88AAC> > 28bit = 郊<> 陋嶁漭恬
JR Z,.calc_size
;
.ItIsFDD: ;
.noMedia: LD HL,.Unknown_str
LD DE,Buffers.bat_params.PRM5 ; Drive size
CALL ncopy_string
JR .print_info_2
/*
312<EFBFBD>585<EFBFBD>200
A H L D E
0000 0000. 0001 0010. 1010 0001. 1010 1011. 1111 0000.
0000 1001. 0101 0000. 1101 0101. 1111 1000. 0000 0000. 128
0001 0010. 1010 256
0010 0101. 512
1001 0101 2048
*/
; <20>花足𠼻鴙諰 <20>妞丞 嵽芬桌<E88AAC><> 砲鄍<E9848D> <20> <20><EFBFBD> - 2048; !FIXIT ; [ ] sector size
; HL:DE * sector_size = A:H'L':HL
.calc_size: LD A,B
CP #FF
JR Z,.ItIsFDD
AND A
JR Z,.ItIsFDD
;
RRA
JR C,.s128
RRA
JR C,.set_regs
;
.RL_LOOP: RL E
RL D
RL L
RL H
RRA
JR NC,.RL_LOOP
;XOR A
;
.set_regs: EXX
LD L,A
EXX
;
LD A,H
EX AF,AF
LD A,E
LD H,L
LD L,D
EXX
LD H,A
EX AF,AF
JP .convert_hex
;
.s128: ; A = 0
SRL H
RR L
RR D
RR E
RRA
JR .set_regs
; ; HL:DE * 512 = A:H'L':HL ;!HARDCODE sector size
; .calc_size: RL E
; RL D
; RL L
; RL H
; LD A,H
; EX AF,AF
; LD A,E
; LD H,L
; LD L,D
; EXX
; LD H,A
; LD L,0
; EX AF,AF
; JR .convert_hex
;
.Collect_Msg: DZ " A: <WAITING>\r" ; <20>瞀兩摬 <EFBD9E> 戈匲<E68888> <20> 璅物<E79285>
.Unknown_str: DZ "unknown"
.none_string: DZ "none"
/*
0 1 2 3 4 5 6 7
01234567890123456789012345678901234567890123456789012345678901234567890123456789;
Drive File System Label Serial number Size in bytes
C: FAT32 NO NAME xxxx-xxxx 147,102,629,888
D: FAT16 SP_SYS xxxx-xxxx 147,102,629,888
;
*/