Debug-PC opened the mountain

xiaoxiao2021-03-06  42

Debug is originally to kill. Here is the machine debugging tool. In fact, the origin of Debug, there is also a statement, in the early United States, a computer room, scientists are working in nervousness. At the same time, many large computers are still running. It is probably due to overheating the machine, causing a small bug, so that the computer cannot operate normally. Scientific, I have to stop, catching insects ... The bug is caught up, the computer is running is normal. Later, this noun is still used to this .... Although, now the good software is getting more and more, but some, we Just do it, you can solve it with Debug! Next, we learn Debug in all aspects! (In anti-virus, addess, system ...) I will learn some, debug's usage, although, now good software is getting more and more, but some, we only need to do it, you can solve it with Debug. And fast!

Debug Common Command Set Name Interpretation Format A (Assemble) Classified Compilation A [Address] C (Compare) Compare two memory block c Range Addressd (dump) memory 16-binding D [address] or d [Range] e (enter) Modify memory byte E address [list] f (fin) Preset a memory F Range Listg (GO) executor g [= address] [address ...] h (Hexavithmetic) arithmetic operation h value valueii (input) Specify Port Address Enter I PATADDRESSL (LOAD) Read Dial L [Address [Driver Seetor]] M (MOVE) Memory Block Transfer M Range Addressn (Name) Distribution Will Name N FileSpec [Filespec ...] O (Output) from the specified port Address OutaDress Byteq (QUIT) End QR (Register) Display and Modify Register R [Register Name] S (Search) Find byte Stroke S Range Listt (Trace) Tracking Perform T [= address] [Value] u (unssemble) Disassembly U [Address] or RANGEW (WRITE) storage W [Address [Driver SECNUM]]? Online help?

Debug small assembly A command

The Debug Small Compilation A command is a very useful feature, and many applets have to do it.

Compare some small procedures than compilation, fast. In Debug, the interrupt is very useful, first let us first understand the interrupt. The so-called interruption, in fact, that is, when you do something, some people come over to find you have other things, you first put down the things in your hand (in the computer, call the protection site), go to the person who calls you, etc. After it, you will return again, then do just now. This is a very popular speech. This will happen when the computer is running, and we call it. Here is some of his usual interrupt vectors detailed: (Remember, very useful ... huh)

IBM PC Interrupt INT1000H Screen Method Settings

Entrance: AH = 0, Al = Display method code (0--6) 0: 40 * 25 black and white 1: 40 * 25 color 2: 80 * 25 black and white 3: 80 * 25 color text 4: 320 * 200 color 5: 320 * 200 black and white 6: 640 * 200 black and white graphics mode 7: 80 * 25 monochrome characters (monochrome display) 0BH color setting entry: AH = 0b, BL = 0 set background color, BH = 0--15 BL = 1 Set the color code, BH = 0--10CH Write graphic point entry: AH = 0C, CX: DX = color number: line number, Al = color ODH reading graphic entry: AH = 0D, CX: DX = color number: Line number returns: Al = color 0EH in the current page, the current cursor is written by the entry: AH = 0E, Al = Character's ASCII code, BL = foreground version OFH display status portal: AH = 0f Return: Al = Current display method, AH = screen column, BH = current page number

01H cursor setting entry: AH = 1, CH = cursor start line number (00--0C), CL = cursor end line number (00--0C) Note: CH> CL02H cursor positioning entry: AH = 2, BH = Page number, DH: DL = starting line: Column 03H read cursor position entry: AH = 3, BH = page number. Return: DH: DL = Starting line: Column 06H window Volume Export: AH = 6, Al = Window, CH: CL-DH: DL Window Coordinate Note: Al = 0 Rolling Overall Window 07H Window Volume 8: AH = 7, Al = window Row, CH: CL-DH: DL window coordinate 08H Read the current cursor Character and attribute entry: AH = 8, BH = page number. Returns: AH: Al = Character Color: Character ASCII Code: Color code See the comparison table 09h: Writing characters and attributes at the current cursor: Note: AH = 9, bh = page number, BL: Al = Character Color: ASCII code of characters, CX = Repeat number 1 2 3 4 5 6 7 8BL RGBIRGB Blinking character background color brown character color

0 Black Black 1 Blue Blue 2 Green Green 3 CYAN Cyan 4 Red Red 5 Magenta Magenta 6 Brown Brown 7 Light Gray Giant Gray 8 Dark Gray Dark Gray 9 Light Blue Galas Highlight Blue A Light Green Green B Light Cyan High Bright blue c light red high bright red d Light Magenta high bright ocean red eleow yellow f White white interrupt vector number table

Interrupt No. Interpretation 0 Component 0 Wrong 1 Swap Interrupt 2 Implementable Interrupt NMI 3 Discharge Interrupt (CCH) 4 Overflow Interrupt 5 Screen Print Interrupt 6-7 Reserved 1F 1KB Graphics Mode 8 Timer Interrupt (18.2 seconds) 9 Keyboard Interrupt AD Reserved 22 End Address (EXEC) EQ Soft Drive Interrupt F Reserved 10 Screen I / O Call 11 Device Check 12 Memory Check Truck 13 Soft Path Machine I / O Call 15 RS-233i / O Call 15 Box Trigue I / O Call 16 Keyboard I / O Call 17 Printer I / O Call 18 ROM-BASIC Entrance 19 Boot Load Program 1A Date When calling 1B keyboard blocking When the control 1C clock is broken, get control 1D points to CRT initial parameters Table 1E Pointing to cartridge Parameter Table 20 End DOS Program 21 DOS Function Call 23 DOS CRTL-BREAK Exit Address 24 DOS Deadly Wrong Vector 25 DOS Absolute Disk Read 26 DOS Absolute Disk Write 27 End Procedure and Resident (Construction 31H) 28-3f DOS Retain 40-7f unused 86-F0 Basic Interpretation of the 86-F0 Basic Interpretation

Detailed Call instruction (process call) (process call) (process call)

Detailed explanation:

Direct calls

Indirect calls (registers)

Indirect calls (memory)

Direct calls

Intercount interconnection

Directive name JMP instruction (unconditional transfer instruction) (Control Directive - Long Transfer)

Detailed explanation: Direct jump directly

Direct jump in short sections

Indirect jump (register)

Indirect jump in the section (memory)

Direct jump

Interior jump

Directive name RET instruction (process return) (control command - long transfer)

Detailed explanation:

Segment return

Return to SP within the segment

Segment return

Return to SP during the period

NA / JNBE instruction (control instruction - short transfer) is not less than or not equal to time transfer

JAE / JNB instruction (control instruction - short transfer) is greater than or equal to time transfer

JB / JNAE directive (control instruction - short transfer) is less than transfer

JBE / JNA instruction (control instruction - short transfer) is less than or equal to transfer

JG / JNLE instruction (control instruction - short transfer) is greater than the transfer

JGE / JNL instruction (control instruction - short transfer) is greater than or equal to transfer

JL / JNGE instruction (control instruction - short transfer) is less than transfer

JLE / JNG instruction (control instruction - short transfer) is less than or equal to transfer

JE / JZ instruction (control instruction - short transfer) is equal to transfer

JNE / JNZ instruction (control instruction - short transfer) is not equal to transfer

JC instruction (control instruction - short transfer) is transferred

JNC instruction (control command - short transfer) column Transfer JNO instruction (control command - short transfer) When the JNP / JPO instruction (control command - short transfer) parity is odd, the JNS command (control command - short Transfer) symbol bit is "0" transfer

JO directive (control instruction - short transfer) overflow transfer

JP / JPE instruction (control instruction - short transfer) parity is even when even

JS instruction (Control Command - Short Transfer) Symbol Bits Transfer when "1"

LOOP instruction (loop control instruction - short transfer) CX is not 0 time loop

LOOPE / LOOPZ instruction (loop control instruction - short transfer) CX is not 0 and flag z = 1 time loop loopne / loopnz command (loop control command - short transfer) CX is not 0 and flag z = 0 cycle

JCXZ instruction (cyclic control command - short transfer) CX is 0

★ INT command (interrupt instruction) interrupt command (after detailed)

INTO instruction (interrupt instruction) overflow interrupt

IRET Directive (Interrupt Direction) Interrupt Back

Command name SHL instruction (logical left shift) SAL command (logical right shift) SAR command (algorithography right shift) register, 1ROL instruction (loop left shift) register, CLROR instruction (loop right shift) memory, 1RCL instructions (transmissive through the transmissions) memory, CLRCR instruction (transmissions by the transvenment) (logical operation)

NOT command (refueling operation) register

(Logical operation) memory

AND instructions (logical) register and register register register and memory registers

Memory and register memory

Summer and memory memory

Some and accumulator accumulator

OR instruction (or calculation) (logical operation)

Register OR Register Register Register OR Memory Register

Memory OR register memory

MUM Memory Memory

MUSE OR Cumulator Cumulator

TEST Direction (Test) Register Test Register Test Memory Register TEST Immediate Number Memory Test Immediate Cumulator TEST Immediate MOVS Direction (String Transfer) A Single Transfer Duplicate Transfer CMPS Dress (String Comparison) (String Operation Directive) Single Compare Duplicate Compare SCAS Direction (String Scan) Single Search Repeat Search LODS Directive (Load String) (String Operation Instruction) Single Load Repeat STOS Instruction (Save String) String Operational Instruction) Single Storage Repeat Storage MOV command (Data Transfer Command) (Data Transfer Command) Register and Register Transmission Memory and Register Transfer EFM Transport Immediate Memory Immediate Send to Register Memory Transfer to Cumulator Acupillator Transfer Memory Register Transports Segment Register Memory Transfer to Segment Register Segment Register Transfer to Register Segment Register Transfer to Save POP Directions (Popped Stacking Stack) (Data Transfer Command)

PUSH instruction (Pressing Stack) Memory Register Segment Regulator XCHG Instruction (Data Transfer Command) Register and Register Switching Memory and Register Switching Register and Accurator Switching in Instruction (Port Enter) (Data Transfer) Command) Direct input indirect input OUT command (port output) (Data transfer instruction) Direct output direct output Indirect output add instruction (addition) (arithmetic instruction) ADC instruction (with carry-on) Register Register Register Register Memory Register Memory Register Memory Immediate Number Memory Memory Immediate Number Accumulator Acupuna InC Directive (Plus 1) (Arithmetic Directive) Memory Increment Register Increment SUB Direction (subtraction) (Arithmetic Directive) SBB Instruction (with Borrow Destination) Register - Register Register Register - Memory Register Memory - Register Memory Immediately - Memory Memory Immediate Number - Accumulator Acupuna Decs (Decrease 1) (Arithmetic Directive) Memory Removal Regime Removal NEC Directive (Forversion, Taking 0 Decrease) Register Reputation Monem Finding CMP instructions (comparison) (Arithmetic Directive) Register and Register Compare Register and Memory Compare Register and Immediate Compare Memory and Immediate Compare Acupuncture Comparison Cumulator Comparison MUL Directive (No Symbol Multiplication) (Arithmetic Directive) IMUL Directive (Integer) Multiplication) The multiplication of 8-bit registers multiplied by the 16-bit register multiplied by the 8-bit storage unit multiplied DIV command (no symbol division) (arithmetic instruction) IDIV instruction (integer division) is divided by 8-bit register The 16-bit register is divided by an 8-bit memory unit by an 8-bit memory unit divided by 16-bit storage unit

Debug actual combat 1. Check the production date of the motherboard, version D fff: 05D Fe00: 0e2. Simulation REST key function A: 100 JMP fff: 0000: 105g

3. Quick formatting floppy disk L 100 0 0 * 'Insert a formatted floppy disk W 100 0 0 * put into a formatted floppy disk note: * Sizes: 720K E | 1.2M ID | 1.44M 21

4. Two methods of hard disk formatting (1) g = c800: 05 (2) a 100mov AX, 0703MOV CX, 0001MOV DX, 0080INT 13INT 3G 1005. Accelerator Keyboard A MOV AX, 0305MOV BX, 0000INT 16INT 20RCX10N Fast.comwq

6. Turn off the display (press any key when recover)

AMOV AX, 1201MOV BL, 36INT 10MOV AH, 0INT 16MOV AX, 1200INT 10RCX10N CRT-OF.comWQ q7. Hard Disk DOS Boot Record Repair in the floppy drive into a formatted floppy disk DEBUG-L 100 2 0 1-W 100 0 50 1 floppy disk into the failed machine floppy DEBUG-L 100 0 50 1-W 100 2 0 1-Q8. Clear COMS SETUP password debug-amov BX, 0038MOV CX, 0000MOV AX, BXOUT 70, ALINC CXCMP CX, 0006JNZ 0106INT 20-RCX: 20-NCLEARPASSWORD.COM-WQ Note: The above is suitable for Super and DTK machines, for AST, because his password is placed at the 4ch-51h address of COMS, as long as it is: MOV BX, 0038 to: MOVBX , 004c can be 9. Cancel the COMS password (initialize COMS data is initialized) -O 70, 10-O 71, 10-G-Q10. Save the hard disk main boot record to the file

DEBUG-AMOV AX, 0201MOV BX, 0200MOV CX, 0001MOV DX, 0080MOV INT 13INT 3-RCX: 200-NBOOT.DAT-WQ 11. Call interrupt implementation restart computer (can be file) debug-aint 19int 20-RCX: 2- NRESET.COM-WQ

Debug main order

Debug is a highly tool for assembly language design, which provides a very effective debugging means for assembly language programmers by single-step, setting breakpoints, etc. First, the DEBUG program is called in the DOS prompt, can type command: c: / debug [d:] [PATH] [filename [.ext]] [PARM1] [PARM2] where the file name is debug file first name. If the user typed file, DEBUG loads the specified file into the memory, and the user can debug it. If the file name is not typed, the user can work with the content of the current memory, or put the required files into the memory with the debug command n and l and then debug. The D specified drive path is path, PARM1 and PARM2, the command parameters required to run the debug file. After the Debug program is transferred, a prompt will appear, and the debug command can be used to debug the program. Second, the main command 1 of DEBUG, display the command D (DUMP) of the storage unit, the format is: _d [address] or _d [RANGE], for example, the method of displaying the storage unit according to the specified range is: -d100 12018e4: 0100 C7 06 04 02 38 01 C7 06-06 02 00 02 C7 06 08 02 g ... 8.g ..... g ... 18E $: 0110 02 02 BB 04 02 E8 02 00-CD 20 50 51 56 57 8b 37 ..; .. h..m pqvw.718e4: 0120 8b Where 0100 to 0120 is the unit content displayed by Debug, with hexadecimal to each byte with hexadecimal, and the right side is used to represent each byte. , · Indicates that the characters cannot be displayed. There is no specified segment address here, and the D command automatically displays the contents of the DS segment. If only the first address is specified, the 80-byte content starting from the first address is displayed. If there is no specified address at all, the content after the last unit displayed on the previous D command is displayed. 2. There are two commands to modify the content of the storage unit. · Enter the command E (Enter), there are two formats as follows: The first format can replace the designated range of storage units with a given content table. The command format is: -e address [list], for example, -e DS: 100 f3'xyz'8d where F3, 'X', 'Y', 'Z' and each byte, this command can use these five Bytes replace the original content of the storage unit DS: 0100 to 0104. The second format is a method of modifying a unit-by-unit unit. The command format is: -e address, for example, -E DS: 100 may be displayed as: 18E4: 0100 89.- If you need to modify the contents of the unit to 78, the user can type 78 directly, then press the "space" button Then, the content of the next unit is displayed, as follows: 18e4: 0100 89.78 1b. - Thus, the user can constantly modify the contents of the successive unit until the command is ended with the Enter key. · Fill in the command f (Fill), its format: -f Range List, for example: -f 4ba: 0100 5 F3'XYZ'8D makes 04ba: 0100 ~ 0104 unit contains the designated five bytes. If the number of bytes in the list exceeds the specified range, the exceeding item is ignored; if the number of bytes of the LIST is less than the specified range, repeatedly fill it until all the specified units are filled.

3) Check and modify the command R (register) of the register content, which format is as follows: • Display all registers and flag status in the CPU, the format is: -r, -Rax = 0000 bx = 0000 CX = 010A DX = 0000 sp = fffe bp = 0000 si = 0000 di = 0000DS = 18E4 ES = 18e4 ss = 18e4 cs = 18e4 IP = 0100 NV UP Di PL NZ NA PO NC18E4: 0100 C70604023801 MOV Word PTR [0204], 0138 DS: 0204 = 0000 · Display and modify a register content, the format is: -r register name For example, type the -R AX system will respond as follows: AX F1F4: The current content of the AX register is F1F4, if not modified, press Enter Otherwise, click on the content you want to modify, such as:

-R BXBX 0369: 059F The contents of the BX register are modified to 059F. • Display and modify the flag bit status, the command format is: -rf system will respond, such as: OV DN EI NG ZR AC PE CY- At this time, if you do not modify its content, press Enter, otherwise, click on the content you want to modify ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 4) Run the command G, its format is: -g [= address1] [Address2 [address3 ...]] where address 1 specifies the starting address of the run, if not specified, starting from the current CS: IP. The following address is a breakpoint address. When the instruction is executed, the content of all registers and flags, and the instructions to be executed will be stopped. 5) Tracking Commands T (Trace), there are two formats: • By command tracking - T [= address] After executing a command from the specified address, stop, display all registers content and flags. If the address is not specified, execute from the current CS: IP. · Multiple instructions track -t [= address] [value] is stopped from the specified address, and then stop, n is specified by value. 6) Assemble Command A (Assemble), its format is: -A [address] This command allows you to enter the assembly language statement and can assemble them into machine code, which is stored in the storage area starting from the specified address. Must note: Debug looks into a hexadecimal number of numbers, so if you want to type a decimal number, then it should be described, such as 100D. 7) There are two formats in the disassembly command u (UNASSEMBLE). · From the designated address, it is adjacent to 32 bytes, its format: -u10018e4: 0100 C70604023801 MOV Word PTR [0204], 013818E4: 0106 C70606020002 MOV Word PTR [0206], 020018E4: 010C C70606020202 MOV WORD PTR [0208], 020218E4: 0112 BBO4O2 MOV BX, 020418E4: 0115 E80200 CALL 011A18E4: 0118 CD20 INT 2018E4: 011A 50 PUSH AX18E4: 011B 51 PUSH CX18E4: 011C 56 PUSH SI18E4: 011D 57 PUSH DI18E4: 011E 8B37 MOV Si, [bx] If the address is omitted, 32 bytes are displayed from the next unit of the last U command. · Configuring the storage unit within the specified range, format: -u [RANGE],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Mov Word Ptr [0208E4: 0100 C70604023801 MOV WORD PT [0204], 013818E4: 0106 C70606020002 MOV Word PT [0206], 020018E4: 010C C706060202 MOV WORD PTR [0208], 0202

It can be seen that these two formats are equivalent. 8) Name Command N (Name), its format is: -n filespecs [files "command to format two file identifiers in two file control blocks in CS: 5ch and CS: 6ch, so that La Or w command to load the file into the storage disk. Filespecs can be: [D:] [path] filename [.ext], for example, -n myprog-l-can load file MyProg into the memory. 9) Load Command (LOAD), there are two functions. • Mount the contents of the specified sector range on the disk to the area starting from the specified address. The format is: -l [address [drive sector sector] · Load the specified file, its format is: -l [address] This command is loaded in the CS: 5ch formatted the file specified by the file control block. If an address is not specified, it is loaded into the storage area starting with CS: 0100. 10) Write command W (Write), there are two functions. · Write the data to the specified sector of the disk. Its format is: -w address drive sector sector, write data into the specified file. The format is: -w [address] This command writes the data in the specified storage area in the file specified by the file control block at the CS: 5CH. If the address is not specified, the data starts from CS: 0100. The number of bytes to be written should be placed in BX and CX first. 11) Exit the debug command Q (quit), which is: -q it exits Debug and returns DOS. This command does not have a storage function, if the save disk should be used first. Question: The beginner asked a low-level issue, after executing Debug-a, if there is a line of input errors, how to change this line?

Answer: Add to enter: D: / PWIN95 / Desktop> Debug-a2129: 0100Movax, 20029: 0103MovBx, 20029: 0106Movcx, 2002129: 0106Movcx, 2002129: 0109 At this time, find MOVBX, 200 sentence errors, should be MOVBX, 20, can be knocked back The car returns "-" status, then input: -a1032129: 0103Movbx, 20 If there is more or less, you do not have to re-enter, you can use the m command to move the program to remove or add program space.

转载请注明原文地址:https://www.9cbs.com/read-79283.html

New Post(0)