level 7
⚡天气雷达⚡
楼主
Fill: F range list This command can also be used to clear a whole segment of Memory as well as filling smaller areas with a continuously repeating phrase or single byte. Examples: -f 100 12f 'BUFFER'-d 100 12fxxxx:0100 42 55 46 46 45 52 42 55-46 46 45 52 42 55 46 46 BUFFERBUFFERBUFFxxxx:0110 45 52 42 55 46 46 45 52-42 55 46 46 45 52 42 55 ERBUFFERBUFFERBUxxxx:0120 46 46 45 52 42 55 46 46-45 52 42 55 46 46 45 52 FFERBUFFERBUFFER -f 100 ffff 0This last example fills almost all of the assigned Segment with zero bytes (which can also be thought of as clearing the Segment). You should use this command whenever you want to be sure that the bytes you'll be looking at in DEBUG's Segment are those you've manually entered or loaded; not just previously used code in memory! If you want to examine a file from a disk in a 'clean' Segment, you'll first have to start DEBUG without any filename, clear the Segment using: f 100 ffff 0 and then finally load the file using the Name (n) and Load (L) commands in that order.NOTE: Filling (clearing) any bytes in the area from 00h through FFh of the Segment used by DEBUG can sometimes lead to problems; especially when file I/O is involved. DEBUG stores data for its own use in those locations, so we recommend that you never overwrite bytes in that area; unless you know for sure they won't be necessary!Example: A student in an Assembly class was told to enter a string of commands under DEBUG, the last one being: JMP 0 which he was supposed to Trace (T) to the next command and then execute it. He was told it would be an INT 20 instruction. Well in most cases this is true, because DEBUG always sets the first two bytes of its working segment to "CD 20" for just this purpose. Let's test this out. First, open a new instance of DEBUG, then enter the following commands:-f 100 ffff 0 [Zero-out 100 through FFFF]-e 100 e9 fd fe [Enters a 'JMP 0' at 100]-u 100 102 [Check for correct entry]xxxx:0100 E9FDFE JMP 0000-rAX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000DS=xxxx ES=xxxx SS=xxxx CS=xxxx IP=0100 NV UP EI PL NZ NA PO NCxxxx:0100 E9FDFE JMP 0000-u 0 1xxxx:0000 CD20 INT 20If you don't see "INT 20" after entering "u 0 1", then restart DEBUG and try again.-t [The "T"(Trace) command]AX=0000 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000DS=xxxx ES=xxxx SS=xxxx CS=xxxx IP=0000 NV UP EI PL NZ NA PO NCxxxx:0000 CD20 INT 20-p [Always make sure you use a "P"(Proceed) command for Interrupts!]Program terminated normally-q [Quit]Well, this never worked for those students. Why? Because the teacher had mistakenly told them to Fill the whole segment with zero bytes (f 0 ffff 0), in essence telling them to delete the very instruction he'd wanted them to execute!
2008年05月03日 01点05分
1