3ADDRESSAPPENDASMBASEBIT BOOLEAN BRKREG5BYTECAUSECHARCICLEAREOLCLEAREOSjCNTL_C CONTROL_CABORTCOMMENTSCOMMENTCONSTRUCTSCONTROLBLOCKSCOUNTCPU CURHOME#CURXc$CURY%DCI}'DEBUG_TYPE(DEFINE,DIRr/ DIRECTORYr/DO1DOS_ESCAPE4DYNASCOPE8EDIT:ERROR>EVALe?EXITAEXPRESSIONAEXPRAGOEHALTOHELPPIFVTHENVELSEVENDIFVINCLUDE=XINT\ZINVOCATION*[CRT*[CFG*[BAUD*[CHANNEL*[MACRO*[SUBMIT*[CONTROLS*[ VSTBUFFER*[ISTEPcKEYS[eLABELhLINEiLISTkNOLISTkLITERALLYvmLOADoLPATH$rLSTEPIuMAPwMENUzzMODULE*}MSPACE~MTYPE!NAMESCOPEsOPERATOR+PAGING5PAGE5PARTITIONaPOSTSRCPRESRCPRINT\TRACE\PROCɗRETURNɗPSEUDO_VARCPSEUDO_VARIABLECFUNCTIONCPUTRBANKREFERENCEsQUALIFYs QUALIFICATIONsREGS^FLAGS^SFR^ REGISTERS^REMOVEREPEATxRESETSAVE{SETHSHOWSRCSSOURCESTRINGoSTRLENoCONCAToSUBSTRoSTRoINSTRoNUMTOSTRoSTRTONUMoSYMBOLICSYNCSTARTTEMPCHECKTRCREGVARIABLEVARVERIFYVERSIONhWAITWORDWRITEFORMATThe ADDRESS command displays or changes memory as 16-bit unsigned values. The syntax is ADDRESS [] [ = [,...] ] ::= | [] ADDRESS interprets the contents of memory as 16-bit unsigned values. The optional parameter specifies data to be written to the indicated location. If no data is specified, memory is read, evaluated and displayed as address values. The APPEND command saves definitions of debug objects in an existing file. A new file is created if the file does not exist. The syntax is APPEND ::= DEBUG /* All debug objects */ | [,...] /* Groups of debug objects */ | [,...] /* Specific debug objects */ The following example appends the BReaK REGisters break1 and break2 to the file MY.MAC: hlt> APPEND :F1:MY.MAC BREAK1,BREAK2 The PUT command can be used to save debug object definitions to a new file. The INCLUDE command retrieves previously saved debug object definitions. SThe ASM command disassembles and displays memory as assembler mnemonics, and interactively assembles 8051 mnemonics into target memory. The syntax is ASM
[] [ = [ '' [,...] ] ] ::= TO
| LENGTH The interpretation of ASM
TO
is assembly/disassembly of all instructions contained within the two addresses inclusively. ASM
LENGTH results in the assembly/disassembly of instructions beginning at
. When assembling 8051 instructions into memory, the specified instructions will be repeated as often as necessary in order to fill the specified memory partition. It is also possible to assemble 8051 instructions into memory using the assembler line mode. To activate line mode, enter a carriage return following the '='. Line mode will assemble one per line (without apostrophes) into memory at the displayed address. To terminate line mode, enter a carriage return on a blank line. The BASE pseudo-variable enables you to change and inspect the current default numeric base. The base may be set to binary, decimal, or hexadecimal. The syntax is BASE [ = ] ::= 2 | 10 | 16 | BINARY | DECIMAL | HEX While it is valid to use any expression to set the BASE variable, it is best to use a constant with an explicit suffix to avoid possible confusion of values. sThe BIT command displays or changes memory as bit values. The syntax is BIT [ = [,...] ] ::= | [] BIT interprets the contents of memory as bit values. The optional parameter specifies data to be written to the indicated location. Only the LSB of non-bit data is written to locations in bit memory. If no data is specified, memory is read, evaluated and displayed as bit values. Note that no is needed to access a partition in bit memory. Valid bit addresses are between 0 and 0FFH. The BOOLEAN command displays or changes memory as Boolean TRUE or FALSE values. The syntax is BOOLEAN [] [ = [,...] ] ::= | [] BOOLEAN interprets the contents of memory as Boolean values. The optional parameter specifies the data to be stored. If the LSB of the data is 0, a FALSE results; if the LSB is 1, a TRUE results. If no data is specified, memory is read, evaluated, and displayed as Boolean. The BReaK REGister is a debug object which contains break specifications. The syntax to define a BRKREG is DEFINE BRKREG = [DO] [END] ::= [,...] [ CALL ] ::= [OUTSIDE] [PAGE] The syntax to display a currently defined BRKREG is BRKREG BRKREGs are used to define execution addresses for break purposes. BRKREGs are used as part of the GO command in combination with the USING option. The CALL option executes the debug PROCedure when a condition in is met. The PROC must return a value of TRUE (emulation will not resume) or FALSE (emulation will automatically resume). The BYTE command displays or changes memory as 8-bit unsigned values. The syntax is BYTE [] [ = [,...] ] ::= | [] BYTE interprets the contents of memory as 8-bit unsigned values. The optional parameter specifies data to be written to the indicated location. If no data is specified, memory is read, evaluated, and displayed as 8-bit unsigned values. The CAUSE command displays a break message which describes where and why the most recent break in emulation occurred. The syntax is CAUSE There are four possible causes for an emulation break and these are displayed as follows: Probe stopped at
because of internal break /* Normal break */ Probe stopped at
because of external break /* Multi-ICE */ Probe stopped at
because of user halt /* HALT command */ Probe stopped at
because of unknown cause /* Probe error */ CAUSE is useful for determining why emulation stopped whenever the normal break message is suppressed, i.e. an emulation break occurred while executing a debug PROCedure. The CHAR command displays or changes memory as 8-bit ASCII characters. The syntax is CHAR [] [ = [,...] ] ::= | [] CHAR interprets the contents of memory as 8-bit ASCII characters. The optional parameter specifies data to be written to the indicated location. If no data is specified, memory is read, evaluated, and displayed as 8-bit ASCII characters. The CI (console input) function enables the user to enter a character from the console. It reads one character, with no line editing, and returns that character without echoing it to the terminal. Note that CI does not return until a character is entered from the console. The CLEAREOL command clears the screen from the console cursor position to the end of the line after the command is entered. The CLEAREOS command clears the screen from the console cursor position to the end of the screen after the command is entered. CNTL-C will abort the current command. If the probe is emulating, then a HALT command must be used to stop program execution. A CNTL-C will not abort a RESET command. On DOS systems, CNTL-BREAK is recommended instead of CNTL-C. Comments can be included anywhere in command lines. A comment is any string of text beginning with /* and ending with */. Comments can continue on consecutive lines without the continuation character '&' and without ending and restarting the comment. The following control constructs exist in the debugger: DO - END REPEAT - END[REPEAT] COUNT - END[COUNT] IF - THEN - ELSE - END[IF] For more information on these, see their corresponding HELP sections. A COUNT command defines a block of commands to be executed repeatedly subject to an arbitrary number of exit conditions and limited by an iteration count. These exit conditions can be defined with two commands: WHILE and UNTIL. Execution continues as long as a WHILE condition is satisfied, until an UNTIL condition is satisfied, or until iterations have been completed. The general syntax is as follows: hlt>COUNT [] hlt>ENDCOUNT where can be a or group of s, WHILE , or UNTIL . COUNT commands may be nested arbitrarily deep, depending on available memory. Note that END is a synonym for ENDCOUNT. 6The CPU command displays or changes the current processor type being emulated. The syntax is CPU [ = ] ::= H51 /* HMOS 8051 family */ | H52 /* HMOS 8052 family */ | C51 /* CMOS 8051 family */ | C51FA /* CMOS 80C51FA */ | C51FB /* CMOS 80C51FB */ Changing the processor type with the CPU command affects five principal processor characteristics: - Internal RAM size - Internal ROM size - Idle and power down mode enable (CMOS only) - Special Function Register access - Current map When CPU is changed, the current map is reset to the default map for the selected processor. If CPU is specified without a the current processor type is displayed. lThe CURHOME command moves the console cursor to the upper left-hand corner of the display screen. The CURX command controls the column positioning of the console cursor. The syntax is CURX [ = ] The optional parameter, , specifies the column to which the console cursor should be moved. The first column of the screen is 0; the last column is 79. If no optional parameter is specified, the current column position of the cursor is displayed. The CURY command controls the row positioning of the console cursor. The syntax is CURY [ = ] The optional parameter, , specifies the row of the screen to which the cursor should be moved. The first row of the screen is 0; the last row is 23. If no optional parameter is specified, the current row position of the cursor is displayed. >The DCI (direct console input) function enables the user to enter a character from the console. It reads one character, with no line editing, and returns that character without echoing it to the terminal. Note that, unlike CI, DCI returns a zero if a character is not available from the console. Debug objects are user-defined debug types which reside in host memory and can be used wherever a value of the debug object type is valid. Possible debug types are: ADDRESS /* 16-bit unsigned integer */ BIT /* 1-bit Boolean value */ BOOLEAN /* 8-bit Boolean value */ BYTE /* 8-bit unsigned integer */ CHAR /* 8-bit ASCII value */ WORD /* 16-bit unsigned integer */ BRKREG /* Break specification */ LITERALLY /* Text string */ PROC /* Debug procedure */ TRCREG /* Trace specification */ Debug object definitions are created with the DEFINE command, deleted with the REMOVE command, and changed with the EDIT command. Debug object definitions can be saved to a disk file with the PUT and APPEND commands and retrieved during another debug session using the INCLUDE command. The DEFINE command is used to create debug objects. The syntax is DEFINE [ = ] If no is given, the object will be initialized to NULL (zero for numbers, blank for strings). BRKREGs, TRCREGs, LITERALLYs, and PROCs require an . Debug objects reside in host memory and can be used wherever a value of the debug object type is valid. Debug object definitions can be deleted with the REMOVE command and changed with the EDIT command. Debug object definitions can be saved to a disk file with the PUT and APPEND commands and retrieved during another debug session using the INCLUDE command. HThe DIR command displays a directory of debug objects or program objects, optionally restricting type and scope. The syntax is DIR [] ::= [ : ] [ | | LINE ] | DEBUG [ | ] | PUBLICS [ | ] | MODULE | SYMBOLS ::= PROCEDURE | LABEL If is not specified, then the current program module is used. If is not specified, then objects of all types are listed. The DO - END block is a means of treating a group of commands as a single command. The syntax is hlt>DO [] hlt>END where can be a or group of s. Debug objects defined in a block (with the exception of BRKREGs, TRCREGs, PROCs, and LITERALLYs) are local to that block unless defined with the GLOBAL option, and have precedence over any previously defined objects of the same name. DO commands may be nested arbitrarily deep, depending on available memory. Note that each DO must be matched with an END for it to be considered a complete command. The debugger will continue prompting until the compound command is complete. ' The DOS shell escape feature allows DOS commands to be executed from ICE-5100. The shell escape will not execute successfully if there is not enough system memory available when invoked. Use of the DOS shell escape when another program is resident in memory may corrupt the resident ICE-5100 software. The shell escape may be executed from the main command level or in a nested construct. Output from the DOS command will not be sent to a list file. Examples of a regular DOS escape and an extended DOS escape are shown below for an ICE-5100/252: hlt> !dir a: Volume in drive A is AEDIT Directory of A:\ AEDIT EXE 62720 4-15-85 10:32a AEDIT MAC 1158 12-08-86 11:43a 2 File(s) 296960 bytes free hlt> ! Type "EXIT" to return to ICE-5100/252 The IBM Personal Computer DOS Version 3.10 (C)Copyright International Business Machines Corp 1981, 1985 (C)Copyright Microsoft Corp 1981, 1985 C:\ICE5100> EXIT hlt> 9The DYNASCOPE pseudo-variable displays or sets the current operation of NAMESCOPE. The syntax is DYNASCOPE [ = ] where is evaluated as a Boolean value. If is not specified, the current DYNASCOPE value is displayed as TRUE or FALSE. When DYNASCOPE is set to TRUE, NAMESCOPE is dynamic and changes whenever the current execution point is updated, i.e. HALT, ISTEP, or LSTEP commands. If DYNASCOPE is FALSE, NAMESCOPE is static and only changes when explicitly modified. The initial DYNASCOPE value is FALSE.  ICE-5100 contains a full screen editor which can be used to edit debug objects, files, the trace buffer, or the last executed GO command. The editor is invoked using the EDIT command along with the desired option. The editor can also be invoked using a single keystroke depending on the value of the AH code in the ICEnnn.CRT file. When the CRT file specifies the default key definition mode (AH=;), invoke the editor with the current command using the key. When the CRT file specifies the DOS-style key definition mode (AH=PCDOS), invoke the editor using the function key. See the Debug Editor User's Guide for details on using the internal editor. hlt> EDIT FILE my.file hlt> EDIT TRACE NEWEST 10 hlt> GO FROM 3040H TIL 3060 FULLBUF Cross-Reference: INVOCATION KEYS PRINT GO ERROR is a Boolean pseudo-variable that determines whether the error file is searched for the error message on error conditions. The error file is searched if ERROR is TRUE. The initial state is TRUE. aThe EVAL command calculates and displays the result of an expression. The syntax is EVAL ; evaluate expression in three bases and ASCII EVAL LINE ; evaluate expression as line # + offset EVAL PROCEDURE ; evaluate expression as procedure EVAL SYMBOL ; evaluate expression as program symbol + offset For the basic EVAL form, unsigned values display in all three bases and a string of hex bytes. The form EVAL SYMBOL will evaluate the expression as a symbol + offset in all four memory spaces: IDATA, RDATA, XDATA, and CODE. .The EXIT command terminates a debug session. An expression is one or more numbers, functions, variables, or pseudo- variables. When the expression contains more than one operand, the operands are separated by operators. Evaluating the expression applies the operators to the operands until a single result is obtained. [unary-op] operand [binary-op [unary-op]operand] [...] Where: unary-op - (unary operator) acts on a single operand. operand - can be a constant, a variable, a pseudo-variable, a function, or a sub-expression. Some operands are user-defined; others are system-defined. binary-op - (binary operator) acts on two operands. The result is a single operand. As referenced in the menus, may also refer to string or Boolean expressions. For additional information on expressions see the HELP entry for OPERATOR, PROC, PSEUDO_VAR, and VARIABLE. The GO command begins emulation and controls break and trace functions. The syntax is GO [] [] [] [ TRACE [] ] ::= FROM
::= ARM [
] ::= FOREVER | TIL | USING ::= BRKREG | ::= [,...] ::= [,...] ::= [FROM
] [TIL
] | | ::= [OUTSIDE] [PAGE] For full syntax, consult the respective debug register section. Entering a GO command without any parameters will cause GO to use the last non- trivial GO command of the current debug session. For example: hlt>GO TIL :PLM_MODULE #10 emu> Probe stopped at 445EH (:PLM_MODULE#10) because of internal break hlt>GO The second GO will also try to go until :PLM_MODULE #10. To override this, follow the new GO with a . The qualifies breaks to be enabled only upon execution of the specified ARM
. An remains in effect for subsequent GO commands unless another is specified or until ARM is specified in an without an
which enables all breakpoints. Use of OUTSIDE within a will cause all addresses other than those in to be recognized (a logical NOT function). PAGE specifies that is in terms of pages rather than addresses. A page is a range of addresses which is exactly 256 bytes in length and begins on a 256-byte even boundary. Valid PAGE addresses are 0 to 0FFH. The TRACE option specifies which execution addresses will be collected in the trace buffer. If the optional TRACE portion is not present, then trace data is always collected. If the is used with a FROM
and/or a TIL
, trace is enabled at the FROM
and/or disabled at the TIL
. Note that this differs from using with a which collects addresses only within the specified . A remains active for successive GO commands unless a new is specified, or until TRACE is specified without a which specifies the collection of all addresses (trace always). The HALT command halts emulation. The syntax is HALT HALT only has an effect during emulation and does not disturb existing breakpoints or tracepoints. Use the GO command to resume emulation.  The HELP command provides on-line assistance to the user. Information is available for selected commands, debug topics and errors. A list of topics is displayed by typing HELP. Alternatively, the function key also provides on-line help in the form of a pop-up, interactive help screen. Once pop-up help has been activated with the key, select a topic using the cursor keys and/or by typing the first letter of a topic. When the cursor is over the desired topic, use the key to display information on the topic. Return to the main pop-up menu with the key, or exit pop-up help with the key. Striking the key in the middle of a command automatically causes pop-up help to display information for that command. Help for error messages is also available. Typing HELP followed by an error number will display the corresponding error message. If an error message is followed by an asterisk enclosed in brackets ([*]), then extended information is available and can be displayed by typing HELP Ennn where nnn is the error number. HELP E without an error number displays extended information, if available, for the most recent error. hlt> help e41 #41 Workspace exceeded. [*] Out of workspace. Delete any unnecessary debug objects (e.g.; PROCs, LITERALLYs). This could also arise from deeply recursive PROCs. Cross-Reference: ERROR \The IF command allows for conditional execution of commands. The syntax is IF THEN [] [ ELSE [] ] ENDIF where is a or group of . The IF command can be nested arbitrarily deep, depending on available memory. Note that END is a synonym for ENDIF. The INCLUDE command specifies an alternate source for command input (other than the console). Commands are taken from the specified file until the end of file, at which point input continues from the previous source. The INCLUDE command can be nested arbitrarily deep, depending on available memory. The syntax is INCLUDE [NOLIST] If the NOLIST option is used, the commands in the INCLUDE file will not be echoed to the console. INCLUDE commands must be the last command on a command line. The INT command displays any interrupts which were in progress or pending when emulation halted. The syntax is INT A RESET CHIP command resets the bondout and clears any pending interrupts. kThe following are controls which can be specified as invocation line options or placed in a configuration file (".CFG"): Control Specifier Abbreviation -------------------------------------------- CRT ( ) CR NOCRT NOCR CFG ( ) NOCFG MACRO ( ) MR NOMACRO NOMR NOSUBMIT NOSM SUBMIT SM BAUD ( ) CHANNEL ( ) CH VSTBUFFER ( ) VSTB HELP ( ) ERROR ( ) P252 ( ) In the cases where a pathname can be included, that file must exist. When no invocation options are present, the following files are searched for on the invocation device and used by default: ICE252.CRT - crt definition file ICE252.CFG - configuration file ICE252.MAC - macro file ICE252.252 - 252 probe ICE252.OVH - help message file ICE252.OVE - error message file The VSTB option enables the user to define the size of the in-memory buffer for the Virtual Symbol Table (in the range of 5 to 61 kilobytes). The SUBMIT control instructs the debugger to use standard line editing, and to disallow use of the internal editor. All of the invocation options can be placed in a configuration file on the same device as the executable 8086 file (".86" or ".EXE" extension). This file must have the same name as the executable file but with the extension ".CFG" and will automatically be used during invocation. In addition, any file containing invocation options may be specified as the configuration file with the CFG option. If the configuration file is present and options are also given in the invocation line, the invocation line will override the configuration file in cases of conflicting options. Options not explicitly mentioned in the invocation line will be taken from the configuration file. Use the NOCFG option to invoke without using the options contained in a ".CFG" file. ISTEP causes a specified number of user program machine instructions to be executed. The syntax is ISTEP [ ] [ FROM
] The optional
specifies the starting execution address.
defaults to the current execution address ($). The optional specifies the number of instructions to be executed, and defaults to 1. is an unsigned value with a maximum value of 255t. XThere are several keys which have special functions. Among them are arrows Left/right arrow keys move the screen cursor one character to the left/right. Up/down arrow keys move the user through the history buffer of entered commands. CNTL-A Delete line to the right of, and including, the cursor. CNTL-C Cancel current command or interrupt program execution. CNTL-E Re-execute the last command. CNTL-F Delete character at the cursor. CNTL-V Toggles syntax menu on and off. CNTL-X Delete line left of the cursor. CNTL-Z Delete line. ESCape Enter the editor. Home Moves the cursor to the left/right end of line after pressing left/right arrow key. rubout Delete character left of the cursor. TAB Displays additional menu choices when they are available. 7A label reference in the user-program is made by using the label name. For example, label LOOP in procedure PARSE of module PLM_MAIN would be referenced as follows: :plm_main.parse.loop (fully qualified) loop (partially qualified) The value of a label is its address. A line number (or statement) reference is made by prefixing a pound-sign (#) to the line number. For example, statement 17 in module MAIN would be referenced as follows: :MAIN#17 (fully qualified) #17 (partially qualified) The following examples are invalid line references: # 17 (invalid because of space) :MAIN17 (missing '#' character) The value of a line number is its address. The LIST command copies all debugger console output (including prompts, input line echos, responses and error messages) to the specified file. The NOLIST command closes the list file. Changing the current list file also closes the old file. The syntax is LIST NOLIST If the character "?" is specified instead of a , the name of the current list file is displayed. If a list file does not exist, a message is printed. KThe LITERALLY is a debug object which abbreviates keywords or debug commands. The syntax to define a LITERALLY is DEFINE LITERALLY = The syntax to display a currently defined LITERALLY is LITERALLY For example, the following LITERALLY definition would allow BX to be substituted for BYTE XDATA whenever external data memory is accessed: hlt> DEFINE LITERALLY BX = 'BYTE XDATA' When using LITERALLYs, note that their defined value is only expanded on the screen when the pseudo-variable MENU is set to TRUE (default). _The LOAD command copies a program from a file into mapped program memory. The syntax is LOAD [ NOCODE | NOLINES | NOSYMBOLS | APPEND ] must be an absolute 8051-OMF or ASCII hexadecimal object file. The NOCODE, NOLINES, and NOSYMBOLS prevent loading of code, line debug information, or symbol debug information, respectively. The APPEND option adds the symbol information of the current load to that of the previous load. If is a hex object file, then any symbolic information in the file will be ignored and the LOAD options have no effect. # The LPATH command specifies a directory which contains list files corresponding to object modules currently loaded by ICE-5100. Setting LPATH enables the display of source code information from list files which reside outside of the current directory. Setting LPATH is sufficient to enable source code display if all list files reside in the LPATH directory and all list file name prefixes match the loaded object module names. If either of these two conditions are not satisfied, then the SET command must be used to establish a path to the list file for the corresponding object module. The initial value of LPATH is the current directory. hlt> LPATH = C:\ICE5100\LST Cross-Reference: SET SOURCE LSTEP causes a specified number of user program high-level statements to be executed. The syntax is LSTEP [ ] [ FROM
] The optional
specifies the starting execution address.
defaults to the current execution address ($). The optional specifies the number of high-level statements to be executed, and defaults to 1. is an unsigned integer with a maximum value of 65535t. ^The MAP command enables program memory (CODE space) to be mapped in 4KB blocks to user or ice memory. The syntax is MAP [ [] ] ::= USER | ICE The optional specifies the following: USER - Memory is mapped to user memory. ICE - Memory is mapped to ice memory in the probe. The optional must begin and end on a 4KB memory boundary or the partition will be enlarged to meet these conditions and issue a warning. When a is specified without a , then all program memory is mapped to . If MAP is issued with no parameters, the current map state is displayed. Note that if the EA/ pin is not asserted and an attempt is made to map internal ROM memory to USER, that memory will be mapped to ICE instead. The MENU command enables or disables the syntax menu display at the bottom of the screen. The syntax is MENU = where is evaluated as a Boolean value. When MENU is TRUE the menu displays all valid tokens that can be entered at the current cursor position. After a token followed by a space is entered, the menu is updated to show valid tokens at the new position. When the tokens do not all fit on the menu line, the TAB key can be used to scroll through the entire menu. LITERALLY definitions are expanded on the command line when the MENU is enabled. The MENU can also be turned on and off at any time by toggling CNTL-V. A module reference in the user-program is made by prefixing a colon (:) to the module name. For example, the module MAIN would be referenced as follows: :main The value of a module is its address. The prefix is used to specify a particular memory space whenever memory is accessed. The available s are IDATA - Internal Data Memory space. RDATA - Special Function Register Memory space. XDATA - External Data Memory space. CODE - Program Memory space. The following is an example of usage while displaying memory: BYTE CODE 0100H LENGTH 10H The example will display 16 bytes of program memory. In commands where is optional, IDATA is the default . Note that an is not needed when accessing symbolic registers, program variables, or objects with the BIT. In the case of program variables, specifying an prefix will override the defined memory space for that variable. PMemory TYPEs are the basic program types used in commands and displays to define the organization or use of data items. The available s are ADDRESS BIT BOOLEAN BYTE CHAR WORD Consult the individual HELP item on each for specific definitions and use. The NAMESCOPE pseudo-variable displays or sets the current position in the user program for symbolic reference resolution. The syntax is NAMESCOPE [ = ] where is evaluated as an address to specify a NAMESCOPE in the user program. If is not specified, the current NAMESCOPE value is displayed. NAMESCOPE is automatically set to the beginning address of the main program module when a LOAD command is executed (unless the NOCODE or NOSYMBOLS option is specified). If the pseudo-variable DYNASCOPE is TRUE, NAMESCOPE is set to the current execution point when an emulation break, ISTEP, LSTEP, or HALT occur. Partially referenced program variables will be recognized only when NAMESCOPE is at a location within the module or at the starting address of a procedure containing the referenced variables. NAMESCOPE allows you to reference program symbols without always having to precede the symbol name with the enclosing module and procedure names. Note that due to a lack of debug information in PL/M-51 programs, NAMESCOPE is fully effective only at the module level, i.e. setting NAMESCOPE to a location within a procedure is equivalent to setting NAMESCOPE to the module enclosing the procedure. However, if NAMESCOPE is set to the starting address of a procedure, then the NAMESCOPE window will include variables defined within the procedure. See HELP REFERENCE. The debugger's expression operators (in order of increasing precedence) are the following: OR, XOR - logical OR, exclusive OR AND - logical AND NOT - logical NOT ==, <, >, <=, >=, <> - standard Boolean operators +, - - addition, subtraction MOD, *, / - modulo, multiplication, division unary +, unary - - identity, negation (..), . - grouping, address operator * The Page function controls the display of text on the system console. Any one of several characters may be entered while text is being displayed to alter the output characteristics: F FAST New data is written to the screen continuously. P PAGE Writes one screen full, then pauses waiting for any character to continue output. (P is the default mode). L LINE Displays a single line to the screen. Another L must be entered for each subsequent line. Q QUIT Stops display of text to the screen. When the DCI command is used the PAGING pseudovariable should be set to false to prevent the Page function from using the input character for itself. Cross-Reference: DCI OA partition is a range of addresses used in various commands to select a portion of memory. The syntax is ::=
|
TO
|
LENGTH use is described in the HELP items for the commands in which they are valid. P The POSTSRC pseudo-variable specifies how many lines of source code information after a breakpoint are displayed with the break message when the SOURCE pseudo-variable is TRUE. POSTSRC contains a word value and is initially set to 1. Cross-Reference: LPATH PRESRC SET SOURCE SYMBOLIC V The PRESRC pseudo-variable specifies how many lines of source code information prior to a breakpoint are displayed with the break message when the SOURCE pseudo-variable is TRUE. PRESRC contains a word value and is initially set to 1. Cross-Reference: LPATH POSTSRC SET SOURCE SYMBOLIC kThe PRINT command displays trace information collected during emulation. The syntax is PRINT [ ] [ ] ::= CLIPS | NOCLIPS ::= CLEAR | ALL | (OLDEST | NEWEST) [] | (NEXT | LAST) [] | After emulation halts the trace buffer contains a maximum of 254 trace frames. Each trace frame is displayed with a frame number, execution address, instruction opcode, and instruction disassembly. The trace frames are numbered beginning with frame 0 as the oldest trace frame and ending with the newest trace frame (maximum frame 0FD). The option enables or disables display of external trace clips data. Specifying CLIPS enables trace clips display for all subsequent PRINT commands until a PRINT with NOCLIPS is specified. The initial default is NOCLIPS. The options function as follows: CLEAR - Clears the trace buffer of any existing frames. ALL - Displays all of the trace frames currently in the buffer. OLDEST - Displays frames starting with the oldest frame. NEWEST - Displays frames ending with the newest frame. NEXT - Displays frames from the last frame displayed. LAST - Displays frames ending with the last frame displayed. - Displays the specified frame numbers. If an is not specified, a value of one is assumed. When PRINT is specified without a , a PRINT NEXT is performed. xThe debug PROCedure is a debug object which contains debug commands. The syntax to define a PROC is DEFINE PROC = DO END The syntax to display a currently defined PROC is PROC where is any debug command or group of commands. PROCs can be used anywhere a command may appear. PROCs can have parameters which are referenced in the PROC body by %n (n = 0,1,..,99). A PROC can also return a value by using the RETURN command, and therefore may be used in expressions: hlt>DEFINE PROC sum = DO .hlt>RETURN (%0 + %1) .hlt>END hlt>WRITE 'The sum of 4 and 6 = ', sum(4,6) The sum of 4 and 6 = 10 Note, however, that the expression on a RETURN command is optional. If left off, the PROC will return a null value, possibly causing a type conversion error if a return value is expected. cPseudo-variables are predefined debug objects which control various aspects of host or probe operation. The available pseudo-variables are: $ BASE CURX CURY DYNASCOPE ERROR NAMESCOPE POSTSRC PRESRC SOURCE SYMBOLIC SYNCSTART TEMPCHECK VERIFY In addition, pseudo-variables for processor registers and flags are available. For a listing of these see the following: HELP REGS Most of the above pseudo-variables are described in their own HELP sections and in the accompanying user's guide. The PUT command saves definitions of debug objects in a new file. If the file already exists, a prompt will be displayed with the option to overwrite the existing file or abort the command. The syntax is PUT ::= DEBUG /* All debug objects */ | [,...] /* Groups of debug objects */ | [,...] /* Specific debug objects */ The following example saves all currently defined debug PROCedures in the file MY.MAC: hlt> PUT :F1:MY.MAC PROC The APPEND command can be used to append debug object definitions to an existing file. The INCLUDE command retrieves previously saved debug object definitions. The RBANK command is used to display or modify the Register Bank Select (flags RS0 and RS1 in the Program Status Work). The syntax for the command is: RBANK [ = expression] where expression can be a valid number, or a numeric expression that yields a valid number between 0 and 3T to change the contents of the Register Bank Select. The RBANK command without an expression displays the contents of the Register Bank Select. Expression is a new value for Register Bank Select. An MCS-51 family microcontroller contains four banks of eight general purpose registers. RBANK selects one of these as the currently active bank. Cross-Reference: Pseudo-variable REGS R0-R7 Program references have two forms of qualification: partial and full. A fully qualified reference indicates the entire nesting of the object by preceding the symbol reference by the name of the enclosing module and any enclosing procedures, each separated by a dot (.). This form of reference is always valid, and should be used when referring to something outside of the current NAMESCOPE. A partially qualified reference is a fully qualified reference with some or all of the leading module and procedure qualification omitted; the missing qualification will be determined from the current NAMESCOPE. For example, a fully qualified reference to the label LOOP located inside procedure PARSE within the module PLM_MAIN would be as follows: :plm_main.parse.loop (fully qualified) By setting NAMESCOPE to :PLM_MAIN.PARSE, a partially qualified reference to the label LOOP can be made as follows: loop (partially qualified) ! The REGS command displays a subset of register names and their current values. Registers and flags may be displayed and altered using the following pseudo-variable names: General Purpose Registers --------------- R0 R1 R2 R3 R4 R5 R6 R7 --------------- Special Function Registers --------------------------------------------------------------------- ACC B CCAP0H CCAP1H CCAP2H CCAP3H CCAP4H CCAP0L CCAP1L CCAP2L CCAP3L CCAP4L CCAPM0 CCAPM1 CCAPM2 CCAPM3 CCAPM4 CCON CH CL CMOD DPH DPL IE IP P0 P1 P2 P3 PCON PSW RCAP2H RCAP2L SADDR SADEN SBUF SCON SP T2CON TCON TH0 TH1 TH2 TL0 TL1 TL2 TMOD --------------------------------------------------------------------- The following Special Function Registers contain flags which can be displayed and altered using the following pseudo-variable names: Register Flags (MSB - LSB) ------------------------------------------------------------ CCON | CF CR ** CCF4 CCF3 CCF2 CCF1 CCF0 IE | EA EC ET2 ES ET1 EX1 ET0 EX0 IP | ** PPC PT2 PS PT1 PX1 PT0 PX0 P1 | CEX4 CEX3 CEX2 CEX1 CEX0 ECI T2EX T2 P3 | RD WR T1 T0 INT1 INT0 TXD RXD PSW | CY AC F0 RS1 RS0 OV ** P SCON | SM0 SM1 SM2 REN TB8 RB8 TI RI TCON | TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 T2CON | TF2 EXF2 RCLK TCLK EXEN2 TR2 CT2 CPRL2 ------------------------------------------------------------ The RS0 and RS1 flags, and 16-bit registers can be displayed and altered using the following pseudo-variable names: RBANK (register bank select - flags RS0 and RS1) TM0 (Timer 0 - registers TH0 and TL0) TM1 (Timer 1 - registers TH1 and TL1) TM2 (Timer 2 - registers TH2 and TL2) DPTR (Data Pointer - registers DPH and DPL) To display or modify an individual register or flag the syntax is [ = ] Certain registers are bit addressable and can be accessed as follows: . [ = ] where has a value between 0 and 7. The address of a special function register or flag can be referenced by using the dot (.) operator with the syntax described above (e.g., .ACC returns the address of the accumulator).  The REMOVE command deletes the specified debug objects. When the DEBUG option is specified, all debug objects are removed from the debug environment. When the SYMBOLS option is specified, all user program symbols are removed. When the or option is specified, all definitions of debug objects of the respective type are removed. Use of the option removes the debug object of that name. The MODSET option removes module list file SETings. The following example removes all BReaK REGisters and the TRaCe REGister TRACE1: hlt> REMOVE BRKREG,TRACE1 Note: Removing break and trace register definitions does not affect the break and trace hardware in the probe. wThe REPEAT command defines a block of commands to be executed repeatedly, subject to an arbitrary number of exit conditions. These exit conditions can be defined with two commands: WHILE and UNTIL. Execution continues as long as a WHILE condition is satisfied or until an UNTIL condition is satisfied. The general syntax is REPEAT [] ENDREPEAT where can be a or group of s, WHILE , or UNTIL . REPEAT commands may be nested arbitrarily deep, depending on available memory. Note that END is a synonym for ENDREPEAT. RESET reinitializes all or specified system functions. The syntax is RESET ::= CHIP | ICE [ CHANNEL ( ) ] [ BAUD ( ) ] Only the specified function is reset: CHIP - Resets the emulation processor. On-chip data memory is not affected. ICE - Reloads the probe software, resets the emulation processor, and initializes the probe. The memory map is reset to its previous state and SYNCSTART is set to FALSE. CHANNEL - Specifies the host serial channel connected to the probe. Only channels 1 and 2 are valid. The initial value is 1. BAUD - Specifies the serial communications baud rate. Valid baud rates are 300, 1200, 9600, or 19200. The initial value is 19200 on a Series III or Series IV, and 9600 on an IBM PC XT or PC AT. The SAVE command saves program memory into an 8051 OMF file. The syntax is SAVE The indicates the name of the file which will be written with the specified of program memory. If the file already exists, a prompt will be displayed with the option to overwrite the existing file or abort the command. An object file which has been saved can be loaded into program memory with the LOAD command.  The SET command sets a path to a list file corresponding to a module currently loaded by ICE-5100. SET enables source code display when the list file for an object module resides outside of the LPATH directory or when the list file name prefix differs from the module name. If SET is not used, ICE-5100 automatically creates an entry when a list file is first located during source code display. If ICE-5100 is unable to locate a list file, a warning is displayed during the first two attempts to display source code. Source code display will then be inhibited for that particular module until the SET command is used to define a path to the list file. The current list of modules which have been SET can be displayed with the DIR MODSET command. The SET list is cleared with a LOAD or REMOVE MODSET command. hlt> SET :MAIN TO D:\LIST.DIR\MAIN.LST Cross-Reference: APPEND DIR LPATH PUT REMOVE SOURCE / The SHOWSRC command displays source code information from a list file corresponding to a given address or range of addresses. An error occurs if source code information cannot be found within a list file for one of the specified addresses. hlt> SHOWSRC :demo.display_count LENGTH 5 => 5 1 display_count: PROCEDURE (cnt); 6 2 DECLARE cnt BYTE; 7 2 ioport1 = cnt; 8 2 CALL TIME(500); 9 2 END display_count; Cross-Reference: LPATH SET  The SOURCE pseudo-variable enables or disables the display of source code information from list files. When SOURCE is set to TRUE, source code information is displayed with ASM, GO, and PRINT commands. Source code information can also be displayed with the SHOWSRC command. If the source code list files do not reside in the current directory, then LPATH must be set to the correct directory. If the list filename prefix for a loaded object module differs from the module name, then the SET command must be used to set a path to the proper list file. The initial value of SOURCE is FALSE. Cross-Reference: LPATH PRESRC POSTSRC SET SHOWSRC SYMBOLIC 1A character string constant is any sequence of characters enclosed in single quotes or any expression, e.g. 'This is a string example'. A string can contain up to 254 characters, and can contain both printable and non-printable characters, (the latter are displayed as question-marks). Adjacent strings are implicitly concatenated. Debug string variables are of type CHAR. There are six string functions: STRLEN(s) returns the number of characters in string s. CONCAT(s1,...,sn) concatenates strings s1 through sn, in that order. SUBSTR(s,p,l) returns the substring within string s starting at position p, and having length l. INSTR(s1,s2,[n]) searches for s2 within s1 and returns the position of the beginning location of the matched string. 0 is returned if not found, if s2 length is > s1, or if s1 is null. Optional n defines where to begin the search in s1. NUMTOSTR() converts into its ASCII representation. The current BASE is used unless a suffix is added to . STRTONUM() converts , a string variable, into a numeric variable. Cross-Reference: Expression 'The SYMBOLIC pseudo-variable specifies whether program symbols are displayed during instruction disassembly and trace display operations. The syntax is SYMBOLIC [ = ] where is evaluated as a Boolean value. If is not specified, the current SYMBOLIC value is displayed as TRUE or FALSE. The initial SYMBOLIC value is TRUE. For programs which contain a large amount of symbolic information, ASM (disassembly) and PRINT commands will perform considerably faster with SYMBOLIC set to FALSE. QThe SYNCSTART pseudo-variable controls multi-ice emulation. The syntax is SYNCSTART [ = ] The is evaluated as a Boolean value. If is not present, the status of SYNCSTART is displayed as TRUE or FALSE. When SYNCSTART is TRUE, synchronization for emulation start/break via the GID standard is enabled. The TEMPCHECK pseudo-variable controls probe temperature checking. The syntax is TEMPCHECK [ = ] The is evaluated as a Boolean value. If is not present, the status of TEMPCHECK is displayed as TRUE or FALSE. When TEMPCHECK is TRUE, the probe temperature is polled at regular intervals and once at the beginning of each new command line. If the ambient room temperature exceeds approximately 113 degrees Fahrenheit a warning message is displayed following each new command. Setting TEMPCHECK to FALSE disables temperature checking and, therefore, prevents display of the warning message. The initial default value of TEMPCHECK is TRUE. The TRaCe REGister is a debug object which contains trace specifications. The syntax to define a TRCREG is DEFINE TRCREG = [DO] [END] ::= [OUTSIDE] [PAGE] | [ FROM
] [ TIL
] The syntax to display a currently defined TRCREG is TRCREG TRCREGs are used to define execution addresses for trace purposes. TRCREGs are used as part of the GO command in combination with the TRACE option.  ICE-5100 allows referencing and modification of variables within the user program and pseudovariables. A variable reference is made by using the variable's fully or partially qualified name. Program variables may be modified using the assignment operator. The value of a variable is its current value in the program, and is displayed according to its type. For example, INTEGERs are prefixed with a sign and CHARs are printed as unquoted strings. To reference the address of a variable, use the dot (.) operator. References to a procedure are the same as references to a program variable. The value of a procedure is its address. ICE-5100 pseudovariables are referenced by name. hlt> :main_display.rotate.temp = 6 hlt> :main_display.rotate.temp 06 hlt> .:main_display.rotate 20E2H hlt> PAGING = FALSE hlt> PAGING FALSE hlt> Cross-Reference: Qualify Modify Pseudo_var Lines Labels The VERIFY command specifies whether written values to memory are verified during halt mode. The syntax is VERIFY [ = ] where is evaluated as a Boolean value. If is not specified, the current VERIFY value is displayed as TRUE or FALSE. The initial VERIFY value is TRUE. The speed of operations which perform memory writes will be fastest when VERIFY is FALSE. BVersion displays the host and probe software version numbers. .The WAIT command suspends command processing until the probe exits emulation. The syntax is WAIT This feature can be used within PROCs or block commands to delay execution of an instruction following a GO command until after emulation halts. In the following example, the WAIT command prevents the REGS command from executing (and causing an error) until the probe has stopped emulating: hlt> REPEAT .hlt> GO TIL 100H .hlt> WAIT /* Wait until emulation break before accessing probe */ .hlt> REGS .hlt> END The WORD command displays or changes memory as 16-bit unsigned values. The syntax is WORD [] [ = [,...] ] ::= | [] WORD interprets the contents of memory as 16-bit unsigned values. The optional parameter specifies data to be written to the indicated location. If no data is specified, memory is read, evaluated, and displayed as 16-bit unsigned values. The WRITE command enables the user to send formatted information to the console. The syntax is WRITE [SCREEN (x,y)] [USING ()] [] The SCREEN option moves the console cursor to the specified coordinate location on the display screen. The (x,y) values specify screen coordinates where x represents the column number and y the row number. Following the WRITE command, the cursor is returned to its previous postion. The USING option consists of a which is a string constant, string variable, or string function, and an which is a list of expressions or data variables, separated by commas. If the USING option is not included, each item in the is printed in free-format, with one space between each non-string item. The USING option enables display to be controlled via the , which must be a list of format items, separated by commas. There is a one-to-one correspondence between the format items in and the items in . Valid format items are n Decimal number specifying width of the field (0 causes output to be left justified using minimum field width). nC Move output buffer pointer to column n (first column is 1). nX Skip n spaces in output buffer. H Set WRITE display format to hex. T Set WRITE display format to decimal. Y Set WRITE display format to binary. "..." A double-quoted string, to be inserted in the output buffer. . Terminates format string (optional). > Terminates format string, with no following the WRITE. & Same as '>' but does not flush output buffer following the WRITE. For example: WRITE p0,p1 displays the registers P0 and P1 in the current default base on a single line with a single space in between each value. The following WRITE command displays the registers in hexadecimal with a string prefix and separated by five spaces: WRITE USING ('"Port 0=",H,0,5X,"Port 1=",H,0,.') p0,p1 Note that when a field width and a display base is specified for an item, the base specifier must precede the field width in .