Home
6800/6801/6303/6811 DEBUGGER USER`S MANUAL 5th Printing
Contents
1. Copyright C 1977 1982 1988 11 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL ZERO FILL AND SEARCH WITH MASK The fill commmand is used to fill memary with a ane two or three byte value from a mask This is effectively a zero command when the mask is zero The search command is used to search memory for a ore two ar three byte value using the mask COMMAND OPERATION nM Set Mask h Show Mask nS Set Search Target 5 Show Search Target n mS Search lsing Mask Between n and m Yi MZ Zero Copy Mask to Memory Between n and m n m Checksum memory The nM command is used to define a mask far the search and zero fill commands The mask may be one two or three bytes long with one bits specifying the bit positions to ignore mask out while searching The mask is defaulted to a single byte zero upon IDE startup The M command is used to show the last value defined as the mask as a one two or three byte value The nS command is used to define a search target to be used with the search command The search target may be one two or three bytes long specifying the exact sequence of bits ta search for Selected bit positions of the search target may be overriden by ane bits in the mask The 5 command is used ta show the last value defined as the search target as a one two or three byte value The n mS command is used ta search memory between n and m inclusive for the occurance of the search target The
2. Note that the iteration count is not decremented if the conditional routine returns false condition An unconditional breakpoint hit happens when the breakpoint is encountered rn times where rn is the iteration count for that breakpoint initially set to one at breakpoint setting Nate that the iteration count is always decremented because the conditional Subroutine used by IDB always returns true condition Wher a breakpoint hits the next instruction ta execute is the one at the breakpoint address the instruction at the breakpoint has not yet been executed Entering the G command on the console after hitting an unconditional breakpoint will result in an immediate breakpoint hit without having executed any instructions because the P register still points ta the breakpoint location and breakpoints are re installed when realtime execution is requested and exhausted breakpoints have their iteration counts reset ta one The only way to continue from a breakpoint is to use the single step N X nX or mu or the proceed P or nP commands Since the proceed commands and unexhausted breakpoints iteration count non zero single step until the P register is outside the region of the BKPT it is safe to breakpoint on the beginning of any legal instruction the single stenper refuses to execute an illegal instruction provided that some other instruction does not branch into the region occupied by the BKPT instruction Copyright C 1
3. USE RUBOUT TO GET RID OF VALUE urd Comm asou m soon AND 1227 2205 gH 22 18 17 0 f 07 CR en Slane ansan 20050 ame ak sae A 01 B FE C C X 3031 S 4073 39 2120 27 2 3003 FF 0 FF0039 Copyright C 1977 1388 1988 9 Software Duvmamins Tem IDB INTERPRETIVE DEBUGGER USER S MANUAL SETTING REGISTERS The following commands are used ta change the contents of a specific register by name COMMAND OPERATION nA Set A Register ta r nB Set B Register ta n n e Set C Register ta n nsD Set D Register ta n rig X Set X Register to n n Y Set Y Register to 11 n 5 Set 5 Register ta n n B Set P Register to n The nsf nsE n C commands set registers A B C respectively to the rightmost byte of n The n X nsS njP P 3D 3Y commands set registers X 5 P D Y respectively to the rightmost two bytes of n the D register consists of A and B treated as a 16 bit value the Y register is present only on the 6811 If a one byte value is given a leading zero byte is assumed When the stack pointer is set IDE assumes that the value given minus 6 minus 8 for the 6811 points to a interrupt context block i e n 7 1 n 9 1 for 6811 points ta a condition code byte The contents of this context block are used as the values of the registers Wher IDE starts up it invents a seven nine far 6811 byte stack for the user s context block
4. If you don t do this and an old breakpoint is encountered that IDE doesn t remember IDE initializes his breakpoint table upon startup a breakpoint display will occur One carmot proceed go or single step past the forgotten breakpoint Copyright C 1977 13982 1988 26 Software Dymamics Ine IDE INTERPRETIVE DEBUGGER USERS MANUAL If the user types an escape Character an the console device and IDB encounters any breakpoint IDB will return to command input mode and give a register dump The user may immediately continue by using P commands Alsa note that breakpoints change the characteristics of realtime execution That is each instruction that the single stepper must execute as a result of encountering a breakpoint consumes about three milliseconds For example a breakpoint installed on the sequence LDAA 2 or gt LDAA 2 CLRB LDAB 3 may have to single step through two instructions about 6 milliseconds because a breakpoint JSR covers a portion of the second instruction The rG command sets the P register in the context block ta n then does a G command If the significance af n is one a leading zero byte is assumed l The P command is used to continue realtime execution from a breakpoint Instructions are single stepped until the P register is out of the range occupied by the breakpoint JSR instructior then execution continues in realtime execution as if a G command was used Note that the 5 command could no
5. Period meaning the address af the last opened memory location whether it is open now or not This is referred to as the open location marker asterisk meaning the value that would be displayed as the P register contents on a register dump location of next instruction to execute pound sigr meaning the number af instructions single stepped since last s command c single quote followed by any character meaning the ASCII value of the character cl A is equivalent to typing in 41 hex likewise b hex 62 SIGNIFICANCE Numbers entered into IDE have significance size in bytes based on the number of digits keyed in This significance is used by commands which store into memory or de hex arithmetic 1 ar 2 digits gives 1 byte significarce 3 ar 4 digits gives 2 byte significance 5 ar 6 digits gives 3 byte significance Special values have 2 bytes af significance c has 1 byte af significance Copyright D 1977 1982 1988 E Software Dynamics Ine IDB INTERPRETIVE DEBUGGER USER S MANUAL IDE COMMANDS IDE commands fall into the following categories Set The Display Mode Examine and Modify Memary Hex Arithmetic Set Register Zera Fill and Search With Mask Compute a Relative Displacement Dump Memary Switch the DumpSearch Output Charmel Load Memory Purich Memory Breakpoints Execute and Single Step Copyright 0 1977 1982 1988 3 Software Dymamics Inc IDE INTERPR
6. Since the 5 register at the time while inside the conditional following subroutine would do the COMPARING X TO n 7 IS EQUIVALEN I WANT Z ON IF NOT EGUAL SO 1 MUST INVERT THE 2 BIT BEFORE I RETURN TO IDE Z IS SET ON IF NOT 3280 7 4 OFF IF the conditional subroutine is using IDB 5 stack which is not infinitely deep running with interrupts disabled don t push toc far Also IDE is so please don t turn them on So SET BREAK AT LOCATION 120 CAN T BREAK HERE TOO CLOSE TO SHOW BREAKPOINTS SET BREAK AT 4852 SHOW BREAKPOINTS TEST FOR 5 3280 BREAKPOINT ALREADY HERE DELETE BREAKPOINT 120 SHOW BREAKPOINTS SET CONDITIONAL BREAKPOINT AT 120 KILL ALL BREAKPOINTS SHOW BREAKPOINTS NONE LEFT Software Dynamics Trim LA 1388 2 IDE INTERPRETIVE DEBUGGER USER S MANUAL EXECUTION COMMANDS The execution commands are used far single stepping instructons realtime execution preceeding from breakpoints and setting the iteration counter for breakpoints COMMAND OPERATION G Start Realtime Execution GO nG Set P Register and GO p Continue Realtime Execution From Breakpoint Proceed np Proceed From Breakpoint and Set Iteration Counter A Single Step One Instruction rX Single Step Multiple Instructions Until Address ru Single Step Until Condition Occurs N Single step past current instruction Value representing number of instructions stepped 5 Zeros number af single stepped in
7. VALUES ENTERED INTO THE DEBUGGER a w s s nu a au w w oo Tis SIGNIFI IGANDE s V k ie kb d ode aaa Be ew 5 I DR COMMANDS J o s s s Li a a a L s e s a n s SETTING THE DISPLAY MODE a u e u on we ee EXAMINE AND MODIFY COMMANDS s a w a w w w n u w un D th GI HEX ARITHMETIC 2 v s s s n n n n a n B B U n lt SETTING REGISTERS s s n w n n wou w w 10 ZERO FILL AND SEARCH WITH MASK Vv wa u v a 12 COMPUTE RELATIVE DISPLACEMENT COMMAND WAS DUMP MEMORY COMMAND u w u wou v n w nu w 18 SWITCHING THE DUMP SEARCH OUTPUT CHANNEL 18 LOAD COMMAND s a ao ooa a nn n n nn non n a a oo 19 PUNCH COMMAND a u v u n u n w w w un ww n B BREAKPOINT COMMANDS w u w w ou wou w nu n wa non BL EXECUTION COMMANDS eo eee eee ena 86 NON MASKABLE INTERRUPT s soa w w ou n ou n u ou n 3 THE I O INTERFACE TABLE oo eee Me i 3 RAM BASED IDB FOR SDOS 2 u so n u n n on non 36 COMMAND SUMMARY s os a a a a w w u a u a w w w a n 3 Copyright C 1977 1982 1988 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL INTRODUCTION IDB is a small memory stand alcne debugger for 6844 6841 6343 or 6811 microprocessor systems It is ideal for debugging assembly language programs IDB acts as a very sophisticated replacement to the MIKBUG ROM available with mast 6820 devel
8. not be obvious since the breakpoints are invisible to the user they can t be seer in the user s code while IDE is in the command input mode The EKPT instructions are not planted in the user code until realtime execution is requested see 6 commands so that if a breakpoint were set at location 122 by entering IZQ examination of location 144 will still show the original user code rather than IDE 5 BKAT instruction Copyright D 1977 1982 1988 zl Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USERS MANUAL When the user s program is executing and it encounters a BKPT the conditional subroutine is invoked and the iteration count for that breakpoint is decremented by one if the subroutine returns true If the counter goes to zero then the breakpoint is hit all BKPTs are removed the original user code is restored and a register dump is displayed on the consele device IDB then enters command input mode Otherwise the breakpoint was not hit the single stepper will simulate instructions until the P register is outside the region that the BKPT instruction occupies in case it is a JSR then realtime execution continues without any notification to the user that a BHPT was encountered and not hit A conditional breakpoint hit happens when the conditicnal routine for that breakpoint signals condition true for n times where is the iteration count far that breakpoint initially set to one at breakpoint setting
9. open location marker is Bumped by two and the next two bytes are displayed If the current mode is 0 then the open location marker is bumped by the length of the instruction 1 if the instruction is illegal and the next instruction is displayed LF is only valid when a location is oper The ut LF gt command is used to deposit from one ta three bytes The open location marker is bumped by the significance of n regardless of display mode and the contents of the new location are displayed in the current mode n LF is only valid when a location is apen The up arrow command is used to decrement the open location marker by one and display the contents of the new location in the current mode is only valid when a location is open The n command is used to deposit from one ta three bytes The open location marker is decremented by one regardless of display made and the contents of the new location are displayed in the current mode is only valid when a location is aperi Copyright D 1977 1982 1988 5 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USERS MANUAL The CR carriage return command is used to close the currently open location The open location marker is not advanced CR gt is a no op when a location is not oper The n CR command is used to deposit from one ta three bytes into the apen location The open location marker is not advanced and the location is closed n CR gt is only valid w
10. ta print out the current value using the appropriate significance Note that all arithmetic negate add and subtract only operates an one or two byte operands and if a three byte cperand is given the leftmost byte is ignored and the significarce becomes two rather than three Also significance is maintained in all arithmetic operations For instance adding one byte ta one byte yields an answer of one byte whether or mot a carry out occurred Adding two bytes to one byte will give two bytes of Significance The significance of the result will always by one ar two bytes When in doubt as ta the significance of a result use the print value operator A result of an arithmetic operation is treated as though the programmer had typed in that Value itself and may be followed by commands requiring values Copyright C 1977 1982 1988 8 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER 5 MANUAL Examples 1 FF NEGATE 1 BYTE VALUE QQi FFFF NEGATE 2 BYTE VALUE 276 FF 1 BYTE DIFFERENCE QAZZS G FFFF BYTE DIFFERENCE 6 205 40001 114043 6 FFFF 3 BYTES BECAME 2 3F 6A 0C3 1 BYTE SUM FE 1 00 RE 1 0100 2 25 PRINT 5 PRINT FF FEQQQQ FF 20002 PRINT en FEQUAg i 0001 ANSWER IS 2 BYTES ONLY 1 2 3 4 2 03 94 C FE CRY LOOK AT LOCATION AZ _ 00A0_ CRY PRINT ADDRESS OF LAST OPENED LOCATION IGNORE VALUE SPACE AND GO TO NEW LINE CR I ZDAS 37 SER EXAMINE LOCATION 5 7 A 1 40 Z 9A RUBOUT
11. to Punch Device Set Unconditional Breakpoint on Location l Set Conditional Breakpoint c on Location 1 Show Breakpoints Remove Breakpoint From Location 1 Kill All Breakpoints Start Realtime Execution 60 Set P Register and GO Start Realtime Execution from Breakpoint Proceed Proceed from Breakpoint and Set Iteration Counter Single Step One Instruction Single Step Multiple Instructions Until Address Single Step Until Condition Occurs Single step until Next instruction Reset and display single step count Compute Relative Displacement Value Equal to Last Location Examined Value of P Counter Displayed in Register Dump Value of number of single stepped instructions Next Previous Instruction and Last Opened Location Software Dynamics Inc
12. using a value specified by the INITZ routine If this value is not appropriate it is a good idea to assign via n 5 a convenient stack before doing any debugging Copyright C 1977 1982 1988 i Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER 5 MANUAL m x a 3 o 0 v SET THE A REGISTER TO 01 B SET THE B REGISTER TO FE C SET THE C REGISTER TO C SHOW REGISTERS A 01 B FE C C X 3031 S 4073 7E3068 0105 l SET THE A REGISTER TO 34 iB SET THE B REGISTER TO 56 SHOW REGISTERS 3005 A 34 B 56 C C X 3031 S 4073 7E3068 0105 01 ix SET X TO 0001 SHOW REGISTERS 3005 A 34 B 56 C C0 X 0001 S 4073 7E3068 Q105 01 234 X SET X TO 1234 SHOW REGISTERS 3005 A 34 B 56 C C0 X 1234 S 4073 7E3268 Q1Q5 l EP SET P REGISTER TO QUFE irr n 22 LOOK AT LOCATION FE SHOW REGISTERS 0502 A 34 B 56 C C X 1234 S 4073 200 AAFE 24 FEZ 20 2245 CR MAKE IT AN INSTRUCTION 2 SHOW REGISTERS 00FE A 34 B 56 C C X 1234 5 4073 2245 GAFE 22 1X CHANGE DISPLAY MODE P 00FE A 34 B 56 C C X 1234 5 4073 2245 BZFE 2245 CHANGE DISPLAY MODE P FE A 34 B 56 C CH X 1234 5 4073 2245 FE Caution setting the stack pointer 5 register causes the remaining registers to take on arbitrary new values according ta their positions in the context block pointed to by the new value af the S register FE S SET THE STACK POINTER TO FE 5 SHOW REGISTERS 0022 A F4 B 45 C CQ X 789F S 00FE 07 DOFE
13. 433 TO F061 Q2255 SF 84 Qu 0a AA 22 39 34 31 31 nasa 011 200 SA 3A Ze 142 1EF DUMP FROM 100 TO 1FF INCLUSIVE 2122 20 l 21212 ig ii ae 03 24 05 46 07 08 49 BA B AC D BE F tz uiza 24 21 2 3 4 13 14 15 16 17 18 19 IA iB 10 1D 1E iF ooooonooooo 2 23 24 25 26 27 28 29 28 2B cC 2D SE HEAR 212 30 31 3E 33 34 35 36 37 38 39 SA 3E SC SD SE SF 4123456789 0120 42 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E BABCDEFGHIJKLMN 2152 7 50 51 52 53 54 55 56 57 59 59 SA SB SC SD SE SF 0150 64 Gi Ge 63 64 65 66 67 68 69 GA 6B EC 6D GE EF abedefghijyklimn 21707 70 71 72 73 74 73 76 77 78 79 7A 7B 7C 7D 7E 7F parstuvwxyzil 2192 a4 81 82 83 84 85 86 87 88 89 BA BB BC BD BE BF ooooononanoo 2192 7 32 91 JE 93 34 93 96 97 38 99 9A SB SC SD SE GF GiAZ AZ Al A AS A4 AS AG A7 AB AD AA AB AC AD AE AF HEAR 21130 BA Bi Be BS B4 BS BE B7 Ba 59 BA BE BC BD BE BF 123456789 3 0100 Ca Ci Ce C3 C4 CS CE C7 C8 C3 CA CE CE CD CE CF SABCDEFGHI JKLMN aipa D Di DE DS D4 DS DE D7 DA D3 DA DE DC DD DE DF POGRSTUVWXYZINI BEA Ed El Ef Es E4 ES EG E7 EB E9 EA ERB EC ED EE EF abcdefghijklmn WiF F Fi FE FS F4 FS Fe F7 F8 F9 FA FB FC FD FE FF pgrstuvwxyzt13 y The address on the left side of the page is the address of the first byte printed Addresses increase by one for each byte displayed from left to right so that the address of the 5F
14. 6804 6841 6343 6811 DEBUGGER USER S MANUAL sth Printing COPYRIGHT C 1977 1982 1988 SOFTWARE DYNAMICS INC NOTICE This manual describes IDE Version 1 2 Software Dynamics has carefully checked the information given in this manual and it is believed to be entirely reliable However no responsibility is assumed for inaccuracies Software Dynamics reserves the right to change the specifications without notice HEHEHE AA NA HHH AA AAA AAA AAA AAA AA AAA SI A SI ASN ASIII AI AIA SAAS A IIIA ANI AAI AAACN SD software is sold on a single copy per computer basis and is covered by U S copyright laws Unless a written exception is obtained from SD the software must be used only on the single computer whose unique SD assigned serial number matches that for which the software was purchased Copies for any purpose other than archival storage or use on other than the assigned serial numbered CPU are strictly prohibited USE OF THIS MANUAL OR THE SOFTWARE IT DESCRIBES CONSTITUTES AGREEMENT BY THE USER TO THESE TERMS KE Kaka A HX HE HX HE HE HE HHH AA AAA AAA AA AA HEH HEHEHE IER EES EEE EEE EEE IEEE EEE SESE SSIES SENSIS SIRI IH IDB INTERPRETIVE DEBUGGER USER S MANUAL TABLE OF CONTENTS NT RODUCT I ON a 2 s su a s a s a s a s a e a s a 2 1 OPERATION s s s a a a a a a a a La a s a a 2 Ld 8 s 1 COMMAND FORMAT Li a s a a a a a a a a s a s s u
15. 977 1982 1988 22 Saftware Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL Example BRA Li L BER L3 Li LDAA 3 Breaking an LA is hazardous during realtime execution if the BRA Li is executed and IDE is using JSR for BKPT instructions The reason for this is that the breakpoint JSR is planted at L and it will take up the first byte of Li so that during realtime execution Li does not contain a LDAA 5 u instruction This will not be a problem during single stepping because the BKPT instructions are not planted Example ESR XYZ Breakpointing the BSR is fatal when the RTS in subroutine XYZ is executed because the third byte af a breakpoint JSR covers the first byte of the instruction following the BSR When the called subroutine returns the instruction will most likely be invalid and at the very least will cause unpredictable results For this reason IDE will not let you set a breakpoint on a BSR or a JSR indexed If you wish a breakpoint there anyway change the opcode to a NOP set the breakpoint and change the opcode back This will not be a problem during single stepping because the BKPT instructions are not planted The set breakpoint command l is used ta set an unconditional breakpoint on a particular location with an iteration count of one No more than four breakpoints conditional or unconditional may be set at a time The set conditional breakpoint command 1 2 is used ta set a con
16. ANGE TO 3H MODE SEE VALUE IN HEX CLOSE THE LOCATION 46 LEX OPEN THE LAST LOCATION EXAMINE NEXT 2102 BD 30 BD7E00 BD7E S LF CHANGE TO 30 MODE SEE VALUE AS INSTRUCTION CHANGE VALUE AND EXAMINE NEXT 0105 39 21 DEPOSIT AND EXAMINE PREVIOUS D104 205 STILL IN 30 MODE 05 IS ILLEGAL OP CODE EXAMINE PREVIOUS 2123 7E0501 CONTENTS OF 123 LOOKS LIKE JMP INSTRUCTION EXAMINE PREVIOUS 0102 BD7E S X BD7E CRY CHANGE TO X MODE CLOSE THIS LOCATION ene bad ILE DEE DEPOSIT TEXT DATA 209 992A 200 4142 A A LE seep 201 B LEY C LEY 203 D LE 204 D LE 205 A LEY 206 D LEY 207 E SLE 208 F LF 209 99 CR z SHOW REGISTERS P 3005 A 01 B FE C C0 X 3031 3 4073 7E3068 0105 l 0 SWITCH TO OPCODE DISPLAY 7E3608 39 CR FIX INSTRUCTION AT P COUNTER 3 P 3005 A 01 B FE C CH X 3031 954273 39 3025 39 Copyright C 1977 1982 1988 7 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL HEX ARITHMETIC Hex arithmetic is used to evaluate expressions COMMAND DPERATION yi Find Negative of n n m Find Difference rim Find Sur n Print Value The n command is used to take the two s complement of a one ar two byte value The n m command yields the two s complement difference The rem command yields the two s complement sum The n command is used
17. Copyright C 1977 1982 1988 29 Software Dynamics Ine IDB INTERPRETIVE DEBUGGER USERS MANUAL Examples this is worth examining carefully 190 P G SET P COUNTER TO 10 AND GO 1006 SET P COUNTER TO 10 AND GO ia 1046 SET BREAKPOINT AND GO GIVING IMMEDIATE BREAKPOINT P 2140 A 4E B 4C C 53 X 524E 9591 73 7E0132 Biaa TE p SINGLE STEP LOCATION 142 AND START REALTIME EXECUTION 190 1006 D GQiZa A 4E B 4C C 53 X 524E S 9F73 7E0132 01070 TE 1 0021 SET ITERATION COUNTER TO 256 AND DO P COMMAND SET P COUNTER TO LOC 104 AND SINGLE STEP 132 A 00 15 02 C C4 X 4000 S 00FD 952225 212 TE 2135 A 00 B 00 C C0 X 0000 S 04032 2003 2104 7 7E A 00 B 00 C CO 450002 S 0032 BEFF 2102 7E Q13C A FF B 00 C C4 X 0000 S 0032 06 0102 7E P 13D A FF B 00 C FF X 0002 S 0032 8601 A100 7E P D13F 501 B 00 C F1 X 0000 S 0032 16 G1QQ 7E IS gt lt gt lt gt lt gt lt gt lt J gt lt jin U H S ea GJ D 3P SET P COUNTER TO 104 AND STEP 37 TIMES X P 118 A D B D C DB X 0148 S 002E 33 DOAD 3F P Dip SET P COUNTER TO 100 AND STEP UNTIL ADDRESS 915 2X 054915 A 00 B FF C FQ X 03D S 0032 3E aaay SF Copyright C 1977 1982 1988 34 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL 102 7E D 7E030B 4 INSERT INCA 121 22 99 INSERT INX B ZCQAAS LE INSERT INC 5 2105 737600 2415 INSERT BRA 100 2105 7 76007E 100
18. Dump file name LPT Ta send a MIKBUG punch file ta a file the user must type n mp and give a filename in response to the request for a dump file Punch Dump filename MYEILE EIXED CR Successive punches will go to the same file until a 8 2P command is used Warning Don t use a dump command before a 8 QP is issued after a sequence of punches as the dump and punch files are the same Note IDE uses the highest available channel number for its file operations this may conflict with the program being debugged Copyright C 1977 1982 19388 37 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL COMMAND SUMMARY sA sH 3X 30 1 LF m LF YO CR Yi CR H text n l Copyright D 1977 1982 1988 38 Set Display Mode to ASCII Hex Index Onpcade Open Location 1 and Display in Current Mode Display Next Deposit and Display Display Previous Deposit and Display Close This Location Deposit and Close Location Deposit Text Into Memory Open Location 1 Display Registers Find Negative af n Find Sum Difference Print Value Set 8 bit register register ton Set 16 bit register to m Set P Register ta n Set 5 Register ta n Set Mask Show Mask Set Search Target Show Search Target Search Using Mask Between n and m Zero Copy Mask to Memory Between n and m Compute checksum over range and display Dump Memory to Dump Device Switch Dump Search Output Channel Load From Load Device Punch
19. ETIVE DEBUGGER USER S MANUAL SETTING THE DISPLAY MODE The display mode Commands affect the way the register display and memory examine commands display the currently open location COMMAND OPERATION 3A Set Display Mode ta ASCII 3H Set Display Mode to Single Byte Hex 3X Set Display Mode to Double Byte Hex 30 Set Display Mode ta Instruction The A display mode allows values ta be displayed as ASCII characters If a character is non printable hex Z iF 7F 9F FF then the byte is displayed in 5H mode The 3H display mode allows values to be displayed as single byte hex quantities This display made is default upon IDE startup The 3X display mode allows values to be displayed as double byte hex quantities The 30 display mode allows values to be displayed as instructions If an illegal instruction begins in the location being examined then a gt followed by a single byte value is displayed Otherwise the instruction display format depends on whether the symbolic disassembly option has been enabled SYMBOLIC DISASSEMBLY Instructions are displayed in a format consistent with the SD assembler Addresses immediate values and offsets are shown as hexadecimal constants of the appropriate significance NO SYMBOLIC DISASSEMBLY If a single byte instruction begins in the location being examined then a single hex byte is displayed If a double byte instruction begins in the lecation being examined then two hex bytes are disp
20. FFS FIND ALL JSR S TO 3FXX 2010 BD3FSA FOUND IT HERE E0FE BD3F92 FOUND IT HERE 452122 50013 60 ACR 4000 522227 INSTALL IMP 100 INSTRUCTIONS BETWEEN 4400 amp 5220 30 2000 7E0100 LF LOOK AT WHAT WE DID 4003 7EQIDA CR AFFF 7EB1FF NOTE THAT LOC 5001 WAS UNTOUCHED Copyright D 1977 1982 1988 14 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER 5 MANUAL COMPUTE RELATIVE DISPLACEMENT COMMAND This command is used to compute the relative displacement byte of relative branch type instructions COMMAND OPERATION riR Compute Relative Displacement This command is used to find the difference in addresses as a one byte value between i and If the address given m is outside the range of a relative branch type machine instruction an error will occur The way this conmand is used is to open a location where a relative displacement byte is to be deposited and specify the target address m followed by R Examples 422 2021 H 20 LE WE HAVE A BRA 123 101 21 IGSR Aa3 CR TELL IDE TO MAKE A BRA 103 DISPLAY THE DISPLACEMENT THEN DEPOSIT IT 3 7 20 30 7 222 NOW GO CHECK ENTIRE INSTRUCTION t 1 203 2R TELL 1DB TO MAKE A BRA HE SAID THAT S TOO FAR 2743 901082 TELL IDB TO MAKE A BRA 90 1 228E NOW CHECK ENTIRE INSTRUCTION Copyright C 1977 1982 1988 15 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL DUMP MEMORY COMMAND This c
21. L Set Unconditional Breakpoint an Address 1 lyt Set Conditional Breakpoint pe Show Breakpoints IN Remove Breakpoint from Address i K Kill All Breakpoints An IDB breakpoint instruction BKPT may be either a SWI instruction or a three byte extended JSR instruction depending or configuration Associated with each BKET is an iteration counter and a conditional subroutine The BKET instruction is nlanted at the breakpoint location during realtime execution to regain control when encountered The conditional subroutine is used ta return true or false depending upon some arbitrary user specified conditions The iteration count is used ta count down the true responses from a conditional subroutine until the counter becomes zeroa at which time the breakpoint is considered ta be hit There are two types af breakpoints conditional and unconditional Conditional breakpoints are associated with a user defined conditional subroutine Unconditional breakpoints are really conditional breakpoints that are associated with an IDE defired conditional subroutine that always returns true IDB uses the BKPT instruction at each breakpoint to regain control after encountering a breakpoint during realtime execution Since JSR BKPT takes three bytes ro JSR styple breakpoint may be set within two bytes of another breakpoint IDB won t allow itd Note that setting breakpoints in ROM doesn t work as they cannot be stored at execution time This may
22. R OF INSTRUCTIONS STEPPED Copyright D 1977 1982 1988 31 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL NON MASKABLE INTERRUPTS IDE traps mon maskable interrupts gives a register dump and goes into command input made This is normally used to stop an undebugged pragram that is not hitting any breakpoints Using the non maskable interrupt entry point will cause IDE to remove any BMPT instructions and restore the user s code The P register will point ta the next instruction to execute p commands are not valid but X N and G Commands are See the section on the IZO interface table ta see how ta re direct in effect override the non maskable entry point jump A NMI can be used to stop a dump or a search display but this will destroy the user program s context block see command THE I O INTERFACE TABLE This table contains jumps to the IDB entry point and nan maskable interrupt entry point and jumps to the entry points of all the I O routines The 1 0 is charmel oriernted that is IDE does all control 1 0 an one channel loading on a second punching am a third and dumping on a fourth By plugging in jumps to new 1 0 routines IDB can be customized ta perform in virtually any environment All routines must return with interrupts disabled If interrupts are enabled switching to a stack with space for the interrupts is required and the stack must be restored when the return is made All registers except t
23. R lt CR gt SQQa 733220 9605 LE INSTALL CONDITIONAL BREAKPOINT ROUTINE 5002 2053 A103 LE gt FROM PREVIOUS EXAMPLE 5004 0A 33 CR 67315 1223P 238 X Sf 772 2 8 2 P 4100 A 00 B 6E C CD X 0000 S 6F73 4A gaas 200 HER 2 P 2102 A 00 B GE C CD X 000 S 6F73 4A BAAS 20 X P Q1Q1 A FF B 6E C C9 X 0000 S 6F73 08 22 X P l 2 A FF B 6E C C9 S 6F73 700005 0005 X P 0105 A FF B 6E C Ci S 6F73 20F9 0005 i 102 CR X P 2100 A FF B 6E C Ci X 0001 S 6F73 4A 05 21 X P 0101 A FE B 6E C C9 X 0001 S 6F73 08 2225 l X P 0102 A FE B 6E C C9 X 0002 S 6F73 7C0205 2005 l X P 0105 A FE B 6E C C1 X 0002 S 6F73 20F9 0D005 02 X P 0100 A FE B 6E C Ci X 0002 S 6F73 4A 2005 22 p P 2120 A FD B 6E C Ci X 0003 S 67F3 4A 2225 23 3p P 2120 A FA B 6E C Ci X 0006 S 67F3 4A 2225 26 1201 190 5000 G P 2102 A 80 B 6E C CB X 0280 5 67F3 4A a205 an 5000 9605 LE INSTALL CONDITIONAL BREAKPOINT S G2 Bige LE TO TEST FOR 5 HEX E 5004 39 ER 5 80 sH 80 Saaau SINGLE STEP UNTIL 5 HEX E 2105 A F2 B 21 C C X 010E S 6F73 2239 ADQS BE ig EDZEDGAL CR ENTER A SUBROUTINE CALL 200 402935 CR SUBROUTINE IS INCA DEX RTS ida P GET SET TO SINGLE STEP THRU SUBROUTINE 0047 RESET STEPPED INSTRUCTION COUNT N SINGLE STEP PAST SUBROUTINE P 0103 A F3 B 21 C CA X 010D S 6F73 01 ABDB5 QE 2004 SHOW NUMBE
24. ading or an illegal character is encountered in a load record the first address of the block being loaded is printed out followed by indicating the error The load may be interrupted by typing an escape character an the consale device at any time The address of the block beirg loaded will be printed out showing how far the load had progressed before being interrupted and then IDB will return to the command input mode See the section on 1 0 entry points to find out how to change the load device Examples 3L 17E3 SUCCESSFUL LOAD LAST BYTE WENT INTO 17E3 aL 21B CHECKSUM ERROR ON BLOCK 10 gh 1202 ESCAPE WAS TYPED AFTER THE LOAD BEGAN IDE SAYS THAT HE WAS ON BLOCK 1200 WHEN INTERRUPTED Copyright C 1977 1982 1988 19 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL PUNCH COMMAND This command is used to dump punch a term inherited from paper tape days memory out in to the punch device The standard abject file format produced is MIKEUG but certain implementaticns af IDB may produce SDOS object records or the punch command may not be present at all COMMAND OPERATION 1 np Punch object recards to Punch Device The area punched is specified by the addresses 1 ard n Punching begins at l and continues until address n is reached inclusive Beware of specifying a second parameter address that is smaller than the first parameter address am awful lat of memory will be punched See the section o
25. akpoint hit while stepping see below ari extra carriage return will be printed out before the register dump The purpose of this is to attract the user s attention to an unusual condition by a conspicuous change in the display format The single stepper steps through an instruction first and then checks to see if the next instruction has a breakpoint If it does and the breakpoint is conditional the conditional subreutine is called to see if the condition is true If the condition is true or it s unconditional and the iteration count goes to zera a carriage return is printed out before the register dump to call the user s attention to the fact that a breakpoint hit Any proceed command may be used if desired after a breakpoint is hit even though the user was single stepping Note that while single stepping the breakponts are not physically Planted in the code but they are still checked This is nice if the program lives in ROM IDB remembers the last breakpoint encountered even while single stepping As long as the breakpointer see P commands for explanation remains valid P commands are valid Let s say that an unconditional breakpoint was installed at 1088 and a conditional breakpoint was installed at 185 If we single step through 120 the breakpointer remembers that 100 was the last breakpoint hit so that if P commands are used they can set the iteration count for this breakpoint Let s step once P register shows 1 2 P
26. byte is 15F The characters to the right are in one to one correspondence from left ta right with the displayed hex bytes and are the ASCII equivalerts of the bytes dumped Control characters and 7F FF are printed as a period The parity bit is ignored Copyright DC 1977 1982 1988 17 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL SWITCHING THE DUMP SEARCH CHANNEL COMMAND OPERATION nT Switch Dump Search Output Charnel The nT command is used ta switch the dump search output between the console and the dump channel If m is zero then the console is selected for dump search output If n is non zero then the dump channel is selected for dump search output Console output is defaulted upon IDE startup Examples T SET DUMP SEARCH OUTPUT TO CONSOLE T SET DUMP SEARCH OUTPUT TO DUMP Copyright C 1977 1982 1988 18 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL LOAD COMMAND This command is used to load programs in MIKBUG format from the load device Certain implmentations af IDE can lead SDOS load records instead of MIKBUG and other implmentations may not have a load command at all COMMAND OPERATION sL Load abject records from Load Device A successful load will print the address of the last byte loaded This can be heloful in situations where you don t know how big a program is or if you do you have an extra verification that all is ok If a checksum error occurs while lo
27. commands would be valid at this point Step again P register shows 145 the conditional subroutine was already called it returns a false condition no hit on this ane the breakpointer is invalidated P commands would be invalid at this point because it is unclear to IDE and us whether the iteration count for 144 or 145 should be set So the moral is P commands are nat valid after stepping through conditional breakpoints that don t hit Copyright C 1977 1982 1988 28 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USERS MANUAL The nX command is used ta single step n times if the significance af n is one note that 2221 has a significance of two Entering AX execute zero instructions does the obvious so don t waste your time with this one Single stepping quits when IDE has executed instructions or has encountered a breakpoint that hits If n has a significance of two single stepping quits when the P register is equal ta nora breakpoint hits Only one register dump is given far each nX command entered Typing an escape character oan the console device will stop the single stepper give a register dump and return to IDB command input mode An interesting way to say execute forever is ta enter yyyyX where yyyy is some address that the program will never execute The nX conmand is a very powerful tool for debugging and it s easier to use than setting breakpoints The ri command is used to single step until s
28. ditional breakpoint on a particular location with an iteration count of ane 1 specifies the break address and c specifies the address af the conditional breakpoint subroutine The conditioral subroutine must be coded using 6820 machine instructions When a conditional break is encountered during realtime execution IDB will JSR to the user defined conditional subroutine At this point a context block exists on the user s stack representing the state of the user s registers at the time the break location was encountered IDE will pass to the subroutine a pointer to the context block in the X register exactiy as the 5 register would point if seven bytes were pushed an the user s stack 4 Copyright D 1977 1382 1988 Software Dynamics Ine ro bJ IDB INTERPRETIVE DEBUGGER USERS MANUAL Example If X points to n then the registers are found in the following locations when the conditional breakpoint subroutine is entered no TRASH X mirc ma A 1 n 4 X HIGH mtS X LOW n 6 P HIGH n 7 1 PLOW The user s S register at the time of the break is equal ta X 7 The above diagram is different in the obvious way for a 6811 The conditional subroutine may test for any condition or combination of conditions including keeping its own iteration count and signal to IDB the truth of the condition by returning the Z bit on in the condition code byte if condition is true and Z bit off fa
29. hen a location is oper The ls command is used to open location l No display occurs The text command is used to enter ASCII text strings into memory The opening character signifies the start af this data entry mode but does not actually deposit any data The ASCII code for each character keystroke following the leading is deposited into memory and the open location is advanced by 1 Data entry is terminated by the second which does not cause any further data to be deposited IDE then automatically displays the contents of the new value af the open location as though LF had been typed The Command is used to display the registers the next instruction in 10 mode and the last opened location in the current display mode This display is referred to as a register dump elsewhere in this manual In a register dump the contents af the registers follow the letter naming that register the next instruction follows the means value of PC and the contents of the last open location are shown as nnmn dddd Not shown in this manual but displayed on the 6811 version is a place for the Y register in each register dump Copyright C 1977 1982 1988 6 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL Examples 10 45 CR OPEN LOCATION 1 AND DEPOSIT 45 THE LOCATION IS CLOSED af 45 A E LEX EXAMINE LOCATION 140 CHANGE TO A MODE SEE VALUE IN ASCII EXAMINE NEXT 0121 F H 46 CRY CH
30. hose specified can be trashed All entry point jumps are relative ta the first address af IDB which is usually on a 4K boundary Let s say that n represents the first address af IDB then we have the following descriptions Sacred space n 2 through n 4 don t touch This is the program runaway entry point DEBUG n 5 contains a jump to the first instruction of IDE The restart vector should be aimed here Sacred space don t touch DEBNMI n 8 contains a jump ta the moan maskable entry ooint If the norn maskable vector is aimed at this point them IDB will handle the interrupt If this is the case then this location can be plugged with another jump to override this if desired If the non maskable vector is aimed somewhere else and it is desired that IDB handle the interrupt then someone must Jump ta this entry point Sometimes it is convenient ta build a context black in software and transfer control ta this point If this is the case interrupts must be disabled before transferring ta DEENMI Copyright C 1977 1982 1988 CJ Software Dynamics Ine IDB INTERPRETIVE DEBUGGER USER S MANUAL DEBRESET n B contains a jump to an IDB internal RESET routine This is used by power up reset code ta make sure that the debugger has been initialized i e is ready to take an NMI or a runaway without transferring control ta the debugger If control is not passed to DEBUG at power up this subroutine nu
31. iage return and IDE remains in the command input mode If there is a command error the opened location is closed In the examples included in this manual underlined characters are keyed irr by the operator Comments ta the right do nat appear as output of the debugger all other printed data is typical debugger output Many of the examples use previous examples to set ug a known situation All IDE commands and hexadecimal numbers can be entered in either upper or lower case in this manual only uppercase commands are shown and a small letter immediately ta the left af a command represents a numeric value entered by the operator immediately before the command keystroke Copyright C 1977 1982 1988 1 l Software Dynamics Ina IDB INTERPRETIVE DEBUGGER USER S MANUAL COMMAND FORMAT All commmands ta IDE fit one af the following forms C No Parameter nE Single Parameter nC Single Parameter ni mC Double Parameter sC NO Parameter where n is a value hex number up to six digits depending upon the command ar simple hex arithmetic expression and m is hex number CR is a carriage return LF is a line feed and C is a command character letter punctuation mark CR ar LF 5 is a semicolon and is a comma VALUES ENTERED INTO THE DEBUGGER IDB accepts several formats far numbers Hex numbers a string of hex letters or digits R BCS 22 BDSFAS Single characters representing special values
32. layed If a triple byte instruction begins in the lecation being examined then three hex bytes are displayed Display modes are not affected by single stepping or user program execution They may only be changed by explicitly typing in a new display mode command If a display mode command is entered while a location is still open the value in that location will automatically be displayed in the new mode Copyright C 1977 1982 1988 4 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL EXAMINE AND MODIFY COMMANDS The examine and modify commards are used to display and ar change memory locations and registers COMMAND OPERATION 17 Open Location 1 and Display in Current Mode LF Display Next m LF Deposit and Display Next Display Previous n Deposit and Display Previous CR Close This Locaticn n CR Deposit and Close Location li Open Location 1 text Deposit ASCII Text String Display Registers Current Instruction and Last Opened Location The 1 command is used to open location 1 and display its contents in the current mode Opening a location means to make it available for examination and or modification The LF line feed command is used to advance the open location marker and display the contents of the new location in the current mode If the current mode is 3H or 3A the open location marker is bumped by one and the next byte is displayed If the current mode is 3X the
33. mask is used while searching ta specify bits in the search target and the memory to ignore The mask must be the same length as the search target The search command will print out the address and cantents af that address far each match found Note that m n i search attempts are made regardless af search target length If the search target and the mask are three bytes long then three bytes are printed out for each match IDB will compare against loc n nti n 2 for a match then nti nerd through loc m mti and m2 If the search target and the mask are two bytes long then two bytes are printed out for each match IDB will compare against loc nm nti for a match then n l n 2 through loc m m t If the search target and the mask are one byte lang then one byte is printed out for each match IDE will compare against loc Copyright C 1977 1982 1988 12 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL n for a match then n l through loc m Note that a match may occur if a search target begins within the limits inclusive even though the remaining bytes may cross the limit The output of the search command is normally directed ta the console device The output can be switched to the dump charmel by using the T command The search command may be interrupted at any time by typing an escape character on the console device The rymzZ command fill is used ta copy the mask to memory between n and m i
34. n 1 0 entry points ta find out how to change the punch device Punching may be interrupted at any time by typing an escape character on the console device This causes the punching to stop and IDE returns to the command input mode Note that an end record S9 in MIKBUG format is not punched This allows the punching to the same file af different and not necessarily Contiguous areas of memory When all punching is complete the end record can be punched by entering the command ap Examples 129 2240P PUNCH OUT 1 THRU 2 SEMA SEEEP FOLLOWED BY THRU 3FFF p END FILE ON PUNCH h S Copyright D 1977 1982 1988 Software Dynamics Ine IDB INTERPRETIVE DEBUGGER USER S MANUAL BREAKPOINT COMMANDS Breakpoints are used ta stop a program at a certain place so that the state af the machine can be examined The programmer places breakpoints in his program where he would like to be able to interrogate the machine registers and whatever else may be interesting then he tells IDE to run his program see G commands When the program hits a breakpoint control is passed ta IDE which does a register dump The programmer can then examine or change memory place new breakpoints start his program again or continue execution from where it left off The breakpoint commands are used ta set up ta four realtime conditional or unconditional breakpoints showing breakpoints and deleting breakpoints COMMAND OPERATION
35. nclusive If the mask is one byte lang then the mask is copied m nti times into locations m mti mt2 Tiel n If the mask is two or three bytes then the mask is copied INT men 1 2 ar INT m nri1 3 times respectively into memory with any leftover bytes being filled with leading mask bytes For example if the mask is three bytes and 122 10727 is entered an the console device then the mask is copied to locations 122 through 10 and 103 through 1853 and locations 126 and 107 get the left most two bytes of the mask The zero fill command never modifies a location past the address given as the second parameter The n m command is used to compute a simple checksum over the address range n thru m inclusive The value af the checksum is printed This is used mostly for fast determination af whether a portion af RAM has changed or mat Copyright C 1977 1982 1988 13 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL Examples an SET MASK TO ZERO ONE BYTE M SHOW MASK 100 1FFZ FILL 102 THRU 1FF WITH ZEROES FEM SET MASK TO FF 1 BYTE 100 1FFZ FILL 104 THRU 1FF WITH FF ED3F3ES SET SEARCH TARGET TO BDSF92 3 BYTES 022422 SET MASK TO 3 BYTES IGNORE NO BITS 2200 32225 FIND SEARCH TARGET BETWEEN 2000 amp 3002 INCLUSIVE EGFE BD3F92 FOUND IT HERE 219A BD3F92 FOUND IT HERE 3000 BDSF92 FOUND IT HERE S BD3F92 SHOW SEARCH TARGET AGQZFEM SET MASK TO IGNORE LAST BYTE OF SEARCH 2000 20
36. nstruction ta use for a breakpoint Changing the first byte to SWI causes IDB to store only a SWI otherwise it stores 3 byte JSR for breakpoints Normally contains JSR BREBHPOINTENTRY BREAKPOINTENTRY nt 49 is the entry point inte IDE where a breakpoint must go after pushing a context block on the stack and advancing the PC past the breakpoint instruction If BREAKPOINTINST contains a SWI the SWI vector must be configured to eventually transfer control to this location PRESINGLESTED n 4C contains a jump to code to enable the user space and then da an RTI which sets the registers to the values of the user program This is used by the single stepper Just before it executes a user program instruction sa that the stepped instruction sees user ROM RAM where IDB is located rather than IDB Normally contains RTI SWI SWI POSTSINGLESTEP n 4F contains the address FDB of the re entry point into IDB after executing a single instruction The registers will be saved by IDB POSTSINGLESTEPDONE contains the entry point for re entry into IDB after single stepping A context block storing the machine state after the stepped instruction must be pushed anto the stack before transferring control to this point Used only if IDB is bank switched Copyright D 1977 i982 i988 33 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL RAM based IDB for SDOS A version af IDE that is loadable under single
37. ome condition is true The value n is treated as the address of a conditional breakpoint test subroutine The single stepper is invoked repeatedly and after each invocation the conditional test subroutine is called assuming a breakpoint has not been encountered or escape has nat been hit by the programmer If the conditional test says false single stepping continues otherwise IDB stops single stepping and does a register dump This command is particularly useful when trying to find out who is storing into a memory location one sets up a conditional routine that checks to see if the desired location has changed and turns IDB loose with the U command It will stop after the instruction that changed the memory location Single stepping will stop if IDB encounters an illegal instruction IDB will stop immediately and do a register dump The N command is used to single step until the PC is equal to the address of the current instruction plus its length This is used to quickly single step through a subroutine called by a BSR or J The single stepper increments a counter every time it is called The value af this counter can be used as a value by using a symbol as an argument it can be displayed by entering as a command The counter is zeroed and displayed by entering a s command This is primarily useful when attempting to build very tight real time code and an accurate instruction count for some process is needed
38. ommand is used to display large areas of memory in hex and ASCII an the dump device COMMAND OPERATION 1 n Dump Memory to Dump Device The area dumped is specified by l and l is used as an address n may be a byte count significance of one or an address significance of two If a byte count is used as the second parameter dumping begins at l and continues for n bytes If an address is used as the second parameter dumping begins at 1 and continues until address m is reached inclusive Beware af specifying a second parameter address that is smaller thar the first parameter address an awful lat af memory will be dumped The output of the dump is normally directed ta the console device The output can be switched to the dump channel by using the T command The dump device may be a console printer or a disk file depending upon the configuration See the section on 1 0 entry points to find out how to change the dump device The dump may be interrupted at any time by typing an escape character an the console device This causes the dump to stop and IDB to return to the command input mode After dump is complete location l is opened for changes or re display in a different display mode Copyright 0 1977 1982 1988 16 Software Dynamics Inc IDE INTERPRETIVE DEBUGGER USER S MANUAL Examples 30 127 DUMP 16 BYTES ZASZ WA 7D CD 9D 84 SF 84 OA OA 20 BB 24 39 34 31 31 Manu unn 901 261 DUMP FROM ADDRESS 4
39. opment systems MIKBUG is a registered trademark af Motorola Inc and any reference herein is ta their registered trademark IDE allows the programmer to load and dump programs in MIKBUG format to display large blocks of memory to examine memory locations in several display formats ta modify memary locations to single step programs ta set breakpoints and execute a program and to search or fill memory for with a particular value This manual describes IDB Version 1 2 OPERATION IDB is usually burned into a set of ROMs and resides permanently in the development system However it can also be kept on external media and loaded when a debug session is about to begin this scheme is not as safe since the debugger might pet clabbered IDE comes configured to communicate to the user through a serial port usually an ACIA or 6551 This port is called the console device Normally the port is cornected to a teletype or CRT device The console device can be changed by modifying a jump table The programmer interacts with IDB via commands piven at the keyboard IDB gives ro prompt if na display action is occurring IDB is in command input mode The programmer enters commands and if the command is valid IDB executes the command and then returns ta command input mode IDB checks the input character by character If an entry is syntactically or semantically incorrect it is diagnosed immediately by a print out of 2 followed by a carr
40. r false The conditional subroutine returns to IDE by executing a RTS instruction If the user wishes to set a conditional breakpoint at location 1202 to break when register A is equal to the contents of location 5 he might decide ta install the conditional subroutine at location 3044 so he enters 120 5220 an the console device The conditional subroutine code could lock like the following 32020 3603 LDAA a GET LOCATION S S L Al S CMPA 3 X COMPARE TO REG A IN CONTEXT BLOCK 5224 33 RTS Z BIT SET ON IF EQUAL OFF IF NOT EQUAL The user then installs this code at location 500 before running his program Copyright C 1977 1982 1988 24 Software Dynamics Inc Copyright C IDE INTERPRETIVE DEBUGGER USER S MANUAL Let s say the user wishes to condition true equal to 3280 hex constant of the breakpoint is egual to X 7 installing the return subroutire trick 5222 8C3273 CPX SaaS 27 TRA 004 5844 EORA 3006 26 TAP 007 39 RTS Note that Examples CO anseo seseo amen samo Cama AUGE CRED COND comme anven 0 1921 sec 100 6100 4852 1 12 1977 1982 build a conditicnal subroutine to if the S register stack pointer was not
41. routine responsible for closing the punch file whatever is appropriate CREATD nt 29 contains a jump to the 1 0 routine responsible for creating an output file for the dump channel WRITED r 20 contains a jump to the 1 0 routine responsible for outoutting a character to the dump file from register A CLOSED contains a jump to the 1 0 routine responsible far closing the dump file whatever is appropriate Copyright D 1977 1362 1988 33 Software Dynamics Irc IDB INTERPRETIVE DEBUGGER USER S MANUAL ESCAPE n 32 contains a jump to the 1 0 routine responsible for checking far the occurrence of an escape character an the control device Does immediate return with Z bit set if yes reset if TiO Does vot echo the character If you are replacing MIKEUG then this feature wort work so place a LDAA 1 RTS here INITZ n 35 contains a jump to the 1 0 routine responsible far all initialization functions such as resetting ACIA s or whatever is appropriate for your configuration INITZ is called anly once for each transfer ta DEBUG eritry point Note that DEBRESET also calls INITZ On exit from INITZ the X register must contain the default user program Stack pointer the INITZ routine can set up the context block so the registers contain default values IDB uses this value once at the DEBUG ertry time as though an n 3 was typed in as the first command Some systems set up ar initial stack pointer in
42. st be called by the reset logic GETC contains a jump to the 1 0 routine responsible for reading a character into register A from the control device normally a terminal All input routines must ignore nulls and strip the parity bit off the resulting character ECHO n 11 contains a jump to the 1 0 routine responsible for outputting a character from register A ta the control device use a RTS here far MIKBUG or any half duplex device This routine is used for echoing input characters obviously PUTC n 14 contains a jump to the 1 0 routine responsible for outputting a character from register A to the control device OPENL n 17 contains a jump to the 1 0 routine responsible for opening the load file send XON for some devices or whatever is required READL n 18 contains a jump to the 1 0 routine responsible for reading a character from the load file into register A CLOSEL n 1D contains a jump to the 1 0 routine responsible for closing the load file send XOFF for some devices or whatever is required CREATP n 280 contains a jump to the 1 0 routine responsible for creating an output file for the punch channel In an operating system environment this may mean ta open a file which is reserved for punching or whatever is appropriate WRITER n 23 contains a jump to the 1 0 routine responsible for outputting a character to the punch file from register A CLOSER n 26 contains a jump to the 1 0
43. structions The G command is used to start realtime execution from the current context black the context block consists of all the registers displayed by the command All of the registers are loaded up including 5 register and control is transferred to the user progranm Instruction execution begins with the instruction pointed to by the P register and execution continues in real time If a breakpoint JSR is encountered IDB will regain control and do ore of two things 1 If the breakpoint is conditional then IDB calls the user defined conditional subroutine for this breakpoint If a true condition is returned then the iteration counter for this breakpoint is decremented by one 2 If the breakpoint is unconditional then the iteration counter for this breakpoint is decremented by one Now IDE will give a register dump and enter command mode if the iteration counter for this breakpoint is zero Otherwise it will carefully single step instructions until the P register is outside the area occupied by the breakpoint JSR instruction then continue realtime execution If no breakpoint is hit then well I hope your program is debugged see non maskable interrupt If the program runs away and restart of IDB is necessary and breakpoints were already Planted when the prablem occurred then the locations with breakpoints will have to be manually repaired that is the original user code at those locations must be restored by hand
44. such a way that typing G immediately after starting up IDB causes a transfer ta a disk boctstrap program The first 7 9 for 6811 bytes of the 128 bytes of RAM scratch storage allocated to IDE are set aside to be used as this default stack INTDS nt 38 contains a jump subroutine which disables all interrupts For most 6822 systems these three bytes can be set to NOP SEI RTS INTRTI n 3B contains a jump ta a routine that conditionally enables interrupts and then does an RTI The I bit in the condition code register an top of the stack I A means enable does an RTI Most 6840 systems can simply place an RTI here FETCHBYTE m 3E contains a jump to a routine that fetches a byte ta the A register from the location specified by the contents of the X register and advances the X register by ore This is used to allow IDB to access a user ROM that normally lives where IDB is in the address space Normally this contains the code LDAA X INX RTS STOREBYTE nt 42 contains a jump to a routine that stores the content of the A register in the location specified by the X register and advances the X register by one This is used to allow IDB to store into RAM that normally occupies the space used by IDE during debugging Normally contains the code STAA XNINXNRTS Copyright D 1977 1982 1988 34 Software Dynamics Ine IDB INTERPRETIVE DEBUGGER USER S MANUAL BREAKPOINTINST nt 46 contains the i
45. t be used in place of a P command immediately after a breakpoint was hit Entering a G command at this point would cause another immediate breakpoint The nP command sets the iteration counter for the last breakpoint hit and then does a P command Which breakpoint was hit is remembered by an IDE variable called the breakpointer The P commands will rot proceed if the breakpointer is invalid Here are some sossible conditions that can invalidate the breakpointer 1 Restart IDB 2 Encounter a conditicmal breakpoint whose conditional subroutine returns condition false 3 Killing all breakpoints 4 Deleting the breakpoint that was last hit A way to set the iteration counter far a breakpoint is ta set the breakpoint go ta the location giving an immediate breakpoint then set the P register as desired then use the nP command Also a conditional subroutine could have its own iteration count Copyright C 1377 1982 1388 27 Software Dynamics Irc IDE INTERPRETIVE DEBUGGER USER S MANUAL The X command is used to single step one instruction at a time A register dump on the same command line occurs followed by a carriage return after single stepping each instruction The Single stepper refuses to step past an illegal instruction or an old and forgotten breakpoint this is an unusual circumstance because IDB only forgets breakpoints when the user restarts him see the 0 command If an unusual condition exists including bre
46. user SDOS 1 1 is available It operates identically to standard IDB with the exception of the commands listed below Fundamentally IDE for 52095 uses SDOS system calls so that IDB can access any user files Thus it is possible ta load a file make patches and save the final result To invoke IDB from 5205 type IDB IDB will respond IDB Vi 2 At this time IDB will semi permarently allocate about 4K bytes at the top of the user space for its own use This space will not be available for use by programs being debugged The top of user space pointer FC FD will be adjusted appropriately If G is typed immediately after loading IDB will exit back ta the command interpreter but is still available for debugging via a D and the SDOS command DEBUG To load a file for debugging type ib In response to the load file request the name of the file to be loaded is entered and terminated by a return key An example Responding with an empty line causes IDE tn release its block af allocated space and to exit back to SDOS IDB is then nat available via D or DEBUG To send a memory dump to a file enter 11 The user must supply a file name in response to IDB s request for a dump file name The user will have to supply a filename for each dump requested Copyright C 1977 1982 1388 36 Software Dynamics Inc IDB INTERPRETIVE DEBUGGER USER S MANUAL Examples moun Punch
Download Pdf Manuals
Related Search
Related Contents
Behringer CE500A User's Manual GA-VD001 USB Video Adapter Dossier de presse - onsexprime.fr - La campagne qui parle LG W1942S Cislin - Track Optoma EP776 data projector Directed Electronics 732T Automobile Alarm User Manual Thule Fit Kit Copyright © All rights reserved.
Failed to retrieve file