DEBUG.TXT A good help file for those who know assembly, and want to use it to create .com files or crack softw but aren't aware of how to use the features in DOS's Debug program. Divided into 5 sections: (1): The debug command; entering debug from DOS (2): Commands in the debug machine language environment (3): Creating and saving your .com file (4): Scripting through the DOS Editor (5): A sample .com file (1) -- DEBUG COMMAND SYNTAX DEBUG [[drive:][path]filename [parameters][>[scriptfile]] [drive:][path]filename Specifies the file you want to test. parameters Specifies command-line information scriptfile Specifies script (preceded by a '>') example: 'DEBUG C:\DOS\FLASH.COM' or: 'DEBUG > C:\FLASH.SCR' (2) -- DEBUG COMMANDS ASSEMBLE -- A [address] type 'A' and the hex address where the file is located. COMPARE -- C [range] [address] compares the commands in two memory locations. DUMP -- D [range] ENTER -- E [address] [list] type 'E' and address where you want to begin programming. FILL -- F [range list] GO -- G [=address] [addresses] go to a specific memory location, eg: 'G = 1A6F' HEX -- H [decvalue] [hexvalue] convert a base-10 number to hexidecimal INPUT -- I [port] reroute input through another serial port, ie: COM1, like the DOS 'CTTY' command. to return to keyd type 'I CON' LOAD -- L [address] [drive] [firstsector] [num] loads a file from disk MOVE -- M [range address] NAME -- N [pathname] [argumentlist] name an assembly file. (always use .com extension) OUTPUT -- O [port byte] reroute output to another device such as external CRT PROCEED -- P [=address] [number] QUIT -- Q quits Microsoft Debug REGISTER -- R [register] examine the contents of a register SEARCH -- S [range] [list] search for a particular hex or ASCII command string TRACE -- T [=address] [value] display the current memory location as the command is processed UNASSEMBLE -- U [range] unassemble .com & .exe file machine code into assembly WRITE -- W [address] [drive] [firstsector] [num] write the file stored in memory and defined by the 'N' variable ALLOCATE EXPANDED MEMORY -- XA [#pages] DEALLOCATE XMS -- XD [handle] MAP XMS PAGES -- XM [lpage] [ppage] [handle] DISPLAY XMS STATUS -- XS (3) CREATING AND SAVING A .COM FILE This is a realitively simple task, assuming that you have assembly language experience. The first sts to enter the assembly language environment, acheivable through the DEBUG command followed by 'E10.this assumes that you want to start your program at memory location 0100 but that is fairly sae o o f the program is not longer than 3000 or so commands, which is a good bet. Obviously the net sep s t type out the program. when you get to the last line of the code, hit [return] twice to xit he asember. Now type 'U xxxx-yyyy' where x = the starting hex location and y = the ending loction.Then ype ' CX' [return] and the number of bytes (lines) that your program consists of. Addin anothr lineor twoto the total is a generally considered a good measure because it can't ruin theprogram and ifyou couted wrong and gave a smaller number the program won't work at all. The next ommand yu shouldtype is N [program name]' where program name = the name of the file with a .com etension. hen type W' to wrie the file. There are parameters that can be attached to the write comand, (listd above), ut they ar usually unnecessary. The default is for the file to be written to he director that you wre in when ou started debug. To quit debug, type 'Q'. (4) CREATING A SCRIPT FOR DEBUG Creating a script is hella easy. just type out the commands one would type out while in debug and in assembler in the editor. make sure to include the commands such as 'E 100' and 'N' and 'W' just syuwould in debug. very importantly, LEAVE A BLANK LINE AFTER THE LAST ASSEMBLY COMMAND. This quis heasembler and returns to the code debugger, just like typing [return] on a blank line would doin mmeiat mode. failing to do this will result in all of the following commands to be taken as asembl lanuagecommands. End the script with the 'Q' command and name the script what the com file'sname ill b excet with the extension '.SCR' instead of '.COM'. to load the sript copy it into the oot diectory and sart debug with the command 'DEBUG > [scriptname].SCR' The commands will be run s thoug you tyed themin. Make sure that the script is a text file. (5) SAMPLE SCRIPT This com file is kinda weak but it gives an example of what a finished script would look like. This was created in a couple of minutes so that when I view gifs in dos with the cshow '+' command I o' et a garbled EGA prompt. I use it also to return to the standard dos font after I use a differnton. he file simply returns the computer to VGA mode by altering the memory locations that cshowandfonmana use. The second com file is shorter and displays ANSI characters to the screen. It is xite wit [ctl-c]. I have found that the first file sometimes affects TIE fighters ability to playsamb\led sunds.If you want to run TIE fighter after using VGA.COM, you will have to restart or lod anoter lare exe ile. (which would fix this problem by re-altering the memory) -------------------- VGA.SCR A100 MOV AX,1202 MOV BL,30 INT 10 MOV AX,0003 INT 10 MOV AL,00 MOV AH,4C INT 21 PUSH BP JO 0144 PUSH AX DB 67 INC SP DB 6E AND [BX+SI],AH PUSH AX JB 0183 JBE 0189 R CX 18 N VGA.COM W Q -------------------- FLASH.SCR A 100 MOV BH,0 MOV CX,7D0 MOV AH,2 MOV DX,0 INT 10 MOV AH,8 INT 21 MOV AH,A INT 10 JMP 105 R CX 16 N FLASH.COM W Q This file smeared across cyberspace by: \\\\/ \/ \ /\ \\ (| /\ \/\ \/ / \ ------ \/ \ \ \/ \ < ]=======__ |======| /-----/ ======= | () | / \ -------- ) | . | | \ ------- / ------ \ **-=-=-=-\ *\ /* *-=-==-=-* **-=-=-=-* \| || \\ // \/ \| || || \\ // || || || |/ \\// || |\ ||======| \/ || ||===== || |\ || || |/ || || || || || /| || || || /| **-=-=-=-/ ** ** **-=-=-=-* \\ // |====\ \|====\ |====\ |====\ | \\ // | | | | | | | \\// /====| | | | | /====| | \/ \====/ | | |====/ \====/ |====*