From Kevin Montgomery: Sid can do the same as DEBUG, although some of the commands are a little different.....with SID. Here are some TXT files from Digital Research to help you better understand how to use SID as DEBUG: Document 1114 SID and DEBUG 04/13/92 SID AND THE DEBUG PATCH Often software manufacturers will have to make changes to their software after it has been released to customers. Usually these are very small changes to the instructions that make up the software, sometimes only affecting 1 or 2 bytes out of the entire program. Since the changes are so small, they can often be completed by the customer by following a patch listing from the manufacturer. These patch listings depend on the use of DEBUG. A typical patch listing will look something like this: 1) COPY BROKFILE.EXE BROKFILE.SAV 2) DEBUG BROKFILE.EXE 3) -S 100 L FFFF B2 01 7C 56 8B 1E 4) -E xxxx:yyyy 91 92 93 94 88 1F 5) -W 6) -Q DR DOS 6.0 has a similar utility called SID. While the function of the two applications is the same, the actual commands are a little different. Below is the typical listing with the purpose of each step explained and the SID equivalent described. The format in each step explained here is: DEBUG COMMAND LINE GENERAL COMMENTS AND CLARIFICATION EQUIVALENT SID COMMAND LINE 1) COPY BROKFILE.EXE BROKFILE.BAK Just in case things do not go as planned, make a back- up. (same command) 2) DEBUG BROKFILE.EXE DEBUG is loading and reading the subject file into memory. To accomplish this in SID, type SID at the command line and then use the R command to read the subject file into memory starting at memory offset address 100. SID will display the starting and ending address of the file in memory in a SEGMENT:OFFSET format. Note these addresses. SID #RBROKFILE.EXE,100 3) -S 100 L FFFF B2 01 7C 56 8B 1E DEBUG is searching from the offset address 100 to the last address of FFFF (a hexadecimal number) for the pattern of bytes listed (B2 01 7C 56 8B 1E B8). this is a pattern that is unique to the area or areas of the file that need to be changed. DEBUG will return the addresses of the desired patterns in a SEGMENT:OFFSET format like 2345:1DF5. The specific values returned will vary. There may be more than one found. The patch listing will usually refer to these values as 'xxxx:yyyy'. The SID SR command is very similar. Some of the arguments are separated with commas instead of spaces. The address or addresses that contain the desired pattern will be returned in the same xxxx:yyyy format. Record the addresses returned. #SR100,FFFF,B2 01 7c 56 8B 1E 4) -E xxxx:yyyy 91 92 93 94 88 1F DEBUG is entering new values for the bytes in memory. This is how the software is actually changed. The xxxx:yyyy is the address at which the new values should be added. The following numbers are the new values themselves. In SID, use the S command and specify where the new values should start. SID will display that starting address and the current value in memory and be waiting for the new value. Enter the first value listed after xxxx:yyyy in the -E command line of the patch listing. Press Enter. SID will now show the next address and its current value and be waiting for the new value. Enter the next value in the -E command line. Continue entering the remaining values. After the last value has been en- tered, SID will display the next address and be waiting for a new value. Simply enter a '.' and press ENTER. SID will return to its '#' prompt. #Sxxxx:yyyy xxxx:yyyy B2 91 xxxx:yyyz 01 92 xxxx:yyya 7C 93 xxxx:yyyb 56 94 xxxx:yyyb 8B 88 xxxx:yyyb 1E 1F xxxx:yyyb 22 . # 5) -W The update version of the software is written from memory to the original file name. In SID use the W command followed by the filename. #WBROKFILE.EXE 6) -Q You're done. Quit. SID's command is the same. #Q On the next page is a sample of what this patch process would look like in SID. [DR DOS] C:\MYFILES>SID -------------------------------------------------- *** Symbolic Instruction Debugger *** Release 3.2 Copyright (c) 1983,1984,1985,1988,1990,1991 Digital Research, Inc. All Rights Reserved -------------------------------------------------- #RBROKFILE.EXE,100 Start End 1056:0100 2056:7BF2 #SR100,FFFF,B2 01 7C 56 8B 1E 1056:2344 #S1056:2344 1056:2344 B2 91 1056:2345 01 92 1056:2346 7C 93 1056:2347 56 94 1056:2348 8B 88 1056:2349 1E 1F 1056:234A B8 . #WBROKFILE.EXE #Q [DR DOS] C:\MYFILES> Document 1115 SID and DEBUG Script 04/13/92 BK SID AND THE DEBUG SCRIPT Below is a generic listing of a typical DEBUG script that one can often find on BBS's or in magazines that will create some nice little utility file using the command: DEBUG < filename.ext What follows are the steps that one would use to adjust a script so that DR DOS 6.0's SID utility will produce the same file using the command: SID < filename.ext These scripts will usually follow a pattern. They will first establish the name of the file. SID does not require the name of the file until it is actually saved at the end. Then they will use the 'A' command to start assembling the instruction. DEBUG defaults to an offset of 100. In SID, one specifies that assembly should begin at offset 100 by the A100 command. Then the instructions for the utility itself are listed. These instructions should be identical under both DEBUG and SID. Finaly, DEBUG is told how many bytes of information to save using the RCX command. When one saves the file using SID, one specifies what the beginning and ending addresses should be. The beginning address is 100. The ending address is 100 + the number of bytes to be saved - 1 (In the example below, the ending address is represented by the word END). Since the arithmetic is in hexadecimal values, one may want to use the H command in SID to do the calculations (See the HEX NOTE below). The last command is to quit. It is the same under both utilities. GENERIC SCRIPT DEBUG SCRIPT SID SCRIPT COMMENTS ----------------------------------------------------------------------- N filename.ext (not required) -SID uses file name when it is saved. A A100 ---------+ -Begin assembling instructions. (instructions (instructions | -Use the original commands. go go | here) here) | | | - to exit assembling RCX (not required) | -DEBUG is preparing to save y bytes y (not required) | of data. +----------------+ W Wfilename.ext,100,END| -SID writes|from offset 100 to END | ( 100 + y - 1 = END ) | | +-------+ Q Q -And Quit. Below is an example of a script that will build BEEP.COM, a program that simply beeps the speaker once. Notice again that the arithmetic is in hexadecimal. (If that is something with which you are unfamilure, see the HEX NOTE at the end of this example.) DEBUG SCRIPT SID SCRIPT COMMENTS ----------------------------------------------------------------------- N BEEP.COM (not required) SID saves file name at end A A100 --------+ Begin assembling instructions MOV AH,2 MOV AH,2 | Use the original commands MOV DL,07 MOV DL,07 | INT 21 INT 21 | MOV AH,4C MOV AH,4C | INT 21 INT 21 | | to exit assembling RCX (not required) | DEBUG is preparing to save 10 (A Hex) A (not required) | of data. +----------------+ W WKEYD.COM,100,109 | SID writes|from offset 100 to 109 Q Q | ( 100 + A - 1 = 109 ) | | +--------+ HEX NOTE: SID can do the hex math for you. In the above example, to do the first addition ( 100 + A ), load SID and type H100 A SID will respond: + 010A - 00F6 * 00000A00 / 0019 (0006) The first value, 010A, is the sum. Use that value in the next command: H10A 1 SID will respond: + 010B - 0109 * 0000010A / 010A (0000) The second value, 0109, is the END value you want to use. Document 1117 SID memory detection of ROMs 04/13/92 BK SID, THE MEMORY DETECTOR Occasionally when loading DR DOS 6.0's EMM386.SYS memory management driver, one will find that the MEM /A display shows an area of upper memory excluded from use. After attempts to access the memory area through the use of the /Include or /Use switches for EMM386.SYS have failed, one might begin to suspect that some memory addressed ROM chips are occupying that area. One can use DR DOS 6.0's SID to check on that. To do this, load SID and have it search the desired areas of memory for a copyright. If one is found, displaying it will probably tell one which piece of hard- ware is using the memory addresses. Below is an example: Here is an excerpt of a MEM /A display that shows an area exclud- ed at D7FF:0000 and a ROM chip at D800:0000 (the exclusion will precede the ROM chip itself to protect the ROM's address). ³ CF00:0000 ³ -------- ³ 9000h, 36,864 ³ ---------- Upper RAM ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ CF00:0000 ³ DR DOS ³ 8FF0h, 36,848 ³ System ³ CFE3:15C0 ³ DR DOS ³ DE0h, 3,552 ³ DR DOS BIOS code ³ D7FF:0000 ³ EXCLUDED ³ 2010h, 8,208 ³ Upper system memory ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ D800:0000 ³ -------- ³ 2000h, 8,192 ³ ------------- ROM --- ³ DA00:0000 ³ -------- ³ 16000h, 90,112 ³ ---------- Upper RAM ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ DA00:0000 ³ DR DOS ³ 9450h, 37,968 ³ System ³ D701:3000 ³ DR DOS ³ 9440h, 37,952 ³ DR DOS kernel code To get SID to investigate that area, first load SID. SID will display its '#' prompt. Tell it to search the area of memory using the SR command looking for all the permutations of copy- right markings. For example, the MEM display shows something at D800:0000, so use the command SRD800:0000,FFFF,"COPYRIGHT |_______|-> Change this number to investigate different areas of memory. "COPYRIGHT","Copyright","copyright","(C)",and "(c)" will usually cover all the bases. Notice that upper case/lower case IS impor- tant. If SID finds some data in memory that matches one's search parameters, it will display the address of that data in the SEGMENT:OFFSET format. There may be more than one. Record those addresses. Then display the data at each of those locations using the D command. The company name should give one some idea of the hardware occupying the area of memory. Below is what the investi- gation of the above machine looks like: [DR DOS] C:\>SID -------------------------------------------------- *** Symbolic Instruction Debugger *** Release 3.2 Copyright (c) 1983,1984,1985,1988,1990,1991 Digital Research, Inc. All Rights Reserved -------------------------------------------------- ( COMMENTS ) #SRD800:0,FFFF,"COPYRIGHT ( Nothing found ) #SRD800:0,FFFF,"copyright ( Nothing found ) #SRD800:0,FFFF,"Copyright D800:0056 ( BINGO !! ) #DD800:0056 ( Display that area ) D800:0056 43 67 68 74 20 28 43 29 20 31 39 Copyright (C) 19 D800:0066 38 42 54 72 61 6E 74 6F 72 20 53 89-90, Trantor S D800:0076 79 73 2C 20 4C 74 64 2E 0D 0A 00 1A ystems, Ltd..... D800:0086 00 07 73 01 CB 8D 36 34 00 E8 A6 04 ....9.s...64.... D800:0096 B8 C6 06 74 00 00 C6 06 75 00 00 C6 .@.....t....u... # The copyright is held by the company that made the card that connects to the CDROM player in this particular machine, thus the presence of the card is why this area of memory is excluded.