Ink Blot welcomes you to Lance's Web Site!

I've decided to resurrect my web site on a limited basis; mainly to discuss FAT32X, but also to test a new site build process. LC

(best viewed at 800x600 full screen!)


Home
Boot Sectors
FAT32X
Utility Programs
Site Map

DBLFIX

Debug Output Fixup

Download

DBLFIX.ZIP or DBLFIX.EXE

Description

This program cleans up disassembled code from DEBUG.

Help

C:>dblfix -?

DBLFIX (01.02, 02/01/98) - Fixup output from debug

usage: DBLFIX (INPUTFILE) (OUTPUTFILE)

DBLFIX (01.02, 02/01/98)

DBLFIX fixes up the output from DEBUG.

(INPUTFILE) should be text lines from the debug -u command.

(OUTPUTFILE) will be the fixed up file.
   Only lines with a ':' will be included,
   The SEG: part will be removed (1st 4 chars)
   The remaining line will be untabbed and trimmed.

This program was used while I was disassembling the boot sectors.
I needed a bit cleaner output for my amusement.
It has little (if any) utility past that.

Sample Execution

C:>debug \dos\format.com <debug.cmd >debug.dbl
C:>dblfix debug.dbl debug.lst
Where DEBUG.CMD contains something like:
u 100
u 
q
And DEBUG.DBL, the output from DEBUG and the input to DBLFIX would contain:
-u 100
298B:0100 B8A3AA        MOV	AX,AAA3                            
298B:0103 BAFC57        MOV	DX,57FC                            
298B:0106 3BC4          CMP	AX,SP                              
298B:0108 7369          JNB	0173                               
298B:010A 8BC4          MOV	AX,SP                              
298B:010C 2D4403        SUB	AX,0344                            
298B:010F 90            NOP	                                   
298B:0110 25F0FF        AND	AX,FFF0                            
298B:0113 8BF8          MOV	DI,AX                              
298B:0115 B9A200        MOV	CX,00A2                            
298B:0118 90            NOP	                                   
298B:0119 BE7E01        MOV	SI,017E                            
298B:011C FC            CLD	                                   
298B:011D F3            REPZ	                                   
298B:011E A5            MOVSW	                                   
298B:011F 8BD8          MOV	BX,AX                              
-u
298B:0121 B104          MOV	CL,04                              
298B:0123 D3EB          SHR	BX,CL                              
298B:0125 8CD9          MOV	CX,DS                              
298B:0127 03D9          ADD	BX,CX                              
298B:0129 53            PUSH	BX                                 
298B:012A 33DB          XOR	BX,BX                              
298B:012C 53            PUSH	BX                                 
298B:012D CB            RETF	                                   
298B:012E 0E            PUSH	CS                                 
298B:012F 01504B        ADD	[BX+SI+4B],DX                      
298B:0132 4C            DEC	SP                                 
298B:0133 49            DEC	CX                                 
298B:0134 54            PUSH	SP                                 
298B:0135 45            INC	BP                                 
298B:0136 20436F        AND	[BP+DI+6F],AL                      
298B:0139 7072          JO	01AD                               
298B:013B 2E            CS:	                                   
298B:013C 2031          AND	[BX+DI],DH                         
298B:013E 3939          CMP	[BX+DI],DI                         
298B:0140 3220          XOR	AH,[BX+SI]                         
-q
And DEBUG.LST, the output from DBLFIX would contain:
0100 B8A3AA        MOV  AX,AAA3
0103 BAFC57        MOV  DX,57FC
0106 3BC4          CMP  AX,SP
0108 7369          JNB  0173
010A 8BC4          MOV  AX,SP
010C 2D4403        SUB  AX,0344
010F 90            NOP
0110 25F0FF        AND  AX,FFF0
0113 8BF8          MOV  DI,AX
0115 B9A200        MOV  CX,00A2
0118 90            NOP
0119 BE7E01        MOV  SI,017E
011C FC            CLD
011D F3            REPZ
011E A5            MOVSW
011F 8BD8          MOV  BX,AX
0121 B104          MOV  CL,04
0123 D3EB          SHR  BX,CL
0125 8CD9          MOV  CX,DS
0127 03D9          ADD  BX,CX
0129 53            PUSH BX
012A 33DB          XOR  BX,BX
012C 53            PUSH BX
012D CB            RETF
012E 0E            PUSH CS
012F 01504B        ADD  [BX+SI+4B],DX
0132 4C            DEC  SP
0133 49            DEC  CX
0134 54            PUSH SP
0135 45            INC  BP
0136 20436F        AND  [BP+DI+6F],AL
0139 7072          JO   01AD
013B 2E            CS:
013C 2031          AND  [BX+DI],DH
013E 3939          CMP  [BX+DI],DI
0140 3220          XOR  AH,[BX+SI]

Functionality

Open (INPUT) and (OUTPUT) files. Read lines from (INPUT), trim trailing spaces, convert tabs to spaces. If there is a ':' in the line, then write the line to (OUTPUT). Close files.

Notes

I wrote this program to provide myself with easier to read output from DEBUG. The program itself is crude, providing no error handling and mininal defaults.
Lance Costanzo, [email protected]