home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-27 | 179.3 KB | 5,514 lines |
- @@MENU
-
- USER INTERFACE
-
- This is a simulator version of NOHAU CORPORATION's EMUL51-PC
- in-circuit emulator for the entire 8051 family of microcontrollers
- For more information:
-
- Phone U.S. (408) 866 1820
- FAX U.S. (408) 378 7869
-
-
- There are probably as many ideas of how a user interface
- should work as there are users. We have tried to combine a fast
- command language for the frequent user with a menudriven, context
- sensitive help, interface for the beginner and infrequent user.
- The idea is that by using the menus you will automatically learn
- the commands.
-
- This is intended to be a shortform overview of how to move about
- the screen using both menus and commands. For a more detailed
- hands on session please refer to the tutorial section in the
- manual.
-
- 1. The Menu line.
-
- The top line on the screen shows the 11 major command groups.
- You can use the right and left arrow keys or the mouse to move
- between the 11 groups. At the bottom of the screen you will
- always see a help line explaining each item in more detail. By
- pressing RETURN or clicking the mouse a "pulldown" menu with
- detailed command choices will be seen.
-
- 2. Pull Down Menus.
-
- The first item will be highlighted. You can now use the up and
- down arrows or the mouse to choose command. Also here the bottom
- line will explain each command in detail. If you use the right or
- left arrow key or the mouse you will move to the top item on the
- next menu. To "escape" up to the menuline from a pull down
- menu use the ESC key. To go to the command line, type ESC while at
- the menu line.
-
- 3. Help window.
-
- If you press function key 1 (F1) at any time the help window will
- open and a detailed description of the current item will appear.
- You can then use the arrow keys and PgUp and PgDn keys when you
- study the help text. ESC closes the help window.
-
- 4. Executing a command from the menu.
-
- If you press RETURN or click the mouse at the command
- you want to perform, the corresponding command will appear at the
- bottom of the screen. You will now also see an additional
- "syntax" help line telling you what possible parameters you now
- must enter. This extra help line may be turned on and off by
- pressing the F9 function key.
-
- 5. Moving back to the menu from the command line.
-
- If you want to move back from the command line to the menu line
- press the ESC key. You can also type MENU at the command line to get
- to the menu line. A third way is to simply use the mouse to point
- at the desired group and click it to pull down the desired menu.
-
- 6. Editing command lines.
-
- You can use the LEFT ARROW and RIGHT ARROW keys to insert or over-
- type the text already on the command line. You can toggle between
- INSERT Mode (underscore cursor) and OVERTYPE Mode (block cursor)
- using the "Ins" key.
- See F7 below for more information.
-
- 7. Function keys.
-
- The function key specification will appear at the
- bottom of the screen when you are in command mode. You can
- activate them by pressing the desired function key or point at
- the desired function at the bottom of the screen with the mouse
- and click it. They have the following functions:
-
- F1 Help Puts the HELP window with appropriate help text up on
- the screen. Especially useful when you are in the
- pull down menus although the "function key line" at
- the bottom of the screen is not visible at that
- point.
-
- F2 CpyChr Copy characters one by one from the previous
- | commandline.
- |
- F2 SrcAsm When the CODE window is open F2 is used to toggle
- between Assembly Mode and Source Mode.
-
- F3 CpyCmd Copy Command. Copy the previous command line.
-
- F4 AdjWin Adjust Windows. Move current window and/or change
- size. (See help line on bottom line).
-
- F5 NxtWin Change current window. Window border will indicate
- | current window.
- |
- F5 Speed? When the CODE Window is open F5 is used to toggle
- between the full speed GO mode and GO SLOW mode which
- is a single step mode (See the GS command). GO mode
- will execute the instruction where the breakpoint is
- set, while GO SLOW will stop at the breakpoint.
-
- F6 WOnOff Window On / Off. Remove window and show full screen.
- Toggles On and Off. (See help window at WIN on the
- top menu line).
-
- F7 PrvCmd Previous Command. Allows you to go back and look at
- the most current 20 commands. You may edit and reuse
- any command. These 20 commands are stored in a
- circular buffer so by pressing F8 (NxtCmd) when you
- are at the current command will give you the oldest
- command. When you edit a line you may toggle the
- cursor between INSERT Mode (underscore cursor) and
- OVERTYPE Mode (block cursor). Use the "Ins" key to
- toggle.
-
- F8 NxtCmd Next command. Step forward in the command buffer.
- (See description of F7 also).
-
- F9 HlpOnf Help On / Off. Switch syntax help at second last line
- | On or Off.
- |
- F9 GoCurs When the Code Window is open, F9 sets a breakpoint
- at the cursor location in the Code Window and executes
- a GO command.
-
- F10 Repeat Repeat last command. Works like F3 but includes at
- RETURN to complete the command.
-
-
- - shortcuts for toggling some windows:
- CTRL-R register window (Not REGISTER WINDOW on top of screen)
- CTRL-W watch window
- CTRL-A code window
- CTRL-D data windows
-
- @@HDW
- HARDWARE OVERVIEW.
-
- The basic hardware consists of the emulator board, mounted in
- one of the PC's slots. The pod board is the small board that
- replaces the microcomputer chip on the target system. The ribbon
- cable connects these two boards. The optional trace board
- contains a piece of ribbon cable to connect the trace board to
- the emulator board. All three boards have jumpers to configure
- them for different functions. (See manual).
-
- The pod board has an LED which is on when EMUL51-PC is in
- emulation mode. Pushbutton switch S1 can be used to reset the
- microprocessor. The target systems reset can be disconnected by
- removing jumper JB1. (Useful if your target has a watchdog,
- controlled under software, which resets the chip if the software
- is not running).
-
- Additional 40 pin sockets may be added to the socket pins on
- the solder side of the board. This may have to be done if
- components on the target system are too high. There are also different
- adapters available. Please refer to a current pricelist.
-
- @@SIMUL
-
- SIMUL51-PC. Software simulator for the 8051.
-
-
- Overview.
-
- The SIMUL51-PC has been derived from the EMUL51-PC's software.
- The EMUL51-PC is an in-circuit emulator, so its software
- communicates with the emulator's hardware. In the simulator
- version the hardware has been replaced with software that
- simulates the 8051. All hardware features like ports, timers,
- interrupts etc. are also simulated. External hardware is
- simulated through a scheme using the EVENT command combined with
- macros as described below.
-
- SIMUL51-PC consists of the following three major components:
-
- 1. User interface (Same as EMUL51-PC).
- 2. Simulator engine (Instruction and SFR simulator).
- 3. External environment simulator. EVENT - MACRO and SERIAL
- CHANNEL simulation.
-
-
- Invocation.
-
- SIMUL51 is normally started with two parameters which specify how
- much CODE memory and XDATA memory the program needs to allocate.
- The -m parameter specifies amount of CODE memory expressed in
- number of Kilobytes. The -x parameter specifies amount of XDATA
- memory expressed in number of Kilobytes.
-
- Examples:
-
- SIMUL51 -m10 -x5 ;10K CODE and 5K XDATA
- SIMUL51 -m64 -x64 ;64K CODE and 64K XDATA
- SIMUL51 -m1 ;1K CODE and no XDATA
- SIMUL51 ;32K CODE (default) and no XDATA (default)
-
- Don't allocate more memory than you need! It will "eat up" memory
- that could be used for symbol tables and other things. The HEAP
- command can be used to allocate more memory in EMS or EXT memory
- or on DISK. (See the HEAP command for details.) For your
- convenience six batch files for starting the SIMUL51-PC have been
- included:
-
- ss.bat ;SIMUL51 -m4 -x4 4K CODE 4K XDATA
- ms.bat ;SIMUL51 -m32 -x32 32K CODE 32K XDATA
- ls.bat ;SIMUL51 -m64 -x64 64K CODE 64K XDATA
- sso.bat ;SIMUL51O -m4 -x4 4K CODE 4K XDATA
- mso.bat ;SIMUL51O -m32 -x32 32K CODE 32K XDATA
- lso.bat ;SIMUL51O -m64 -x64 64K CODE 64K XDATA
-
- SIMUL51O is an "overlay version" of SIMUL51. The benefit of
- SIMUL51O over SIMUL51 is that it uses 90K less of your DOS
- memory. The disadvantage is that it might be somewhat slower.
-
- User Interface.
-
- Please refer to chapters 1, 3, and 6 in this manual.
-
- Simulator Engine.
-
- The simulator performs a number of tasks:
-
- - It allocates memory to simulate the different memory areas in
- the 8051.
-
- - It simulates 8051 instructions. The speed at which this is
- done is about 650 times slower than executing code at 12
- MHz if you run the simulator on a '286 20MHz computer.
-
- - It simulates the 8051 hardware like SFR's and interrupts.
-
- - The trace is simulated only as straight tracing.
- Features like triggering and filtering which are available in
- the emulator are not implemented in the simulator.
-
-
- External environment simulator (EVENT - MACRO).
-
- An EVENT is a READ or WRITE to any memory location in the 8051.
- When a READ or WRITE occurs as specified with the EVENT command,
- a break occurs or a macro is executed. (See MACROS 1-15)
-
- A macro is basically one or a number of commands executed from
- a preprogrammed macro rather than from the command line.
- When the macro is executed the program continues to execute,
- after the macro has completed.
- For more details on macros see MACROS page 1-15.
- We will start with examples to clarify how the EVENT - MACRO
- concept is used.
-
- For a formal description of the EVENT command and the MACDELAY
- command, please type EVE or MACD at the command line and press F1.
-
- Examples:
-
- EVE * 10C PC ;breaks when the program attemps to execute
- an instruction a address 10C.
-
- EVENT W 34 db ;breaks when the program writes to internal
- data memory 34 hex
- EVENT R 80 rb ;breaks when the program reads address 80.
- (P0)
- EVENT W 1289 XB 12 ;breaks when the value 12 hex is written to
- address 1289
-
- EVENT W 1289 XB 12 56 ;breaks when a value within the range 12
- to 56 hex inclusive, is written to
- address 1289 hex
-
-
- EVENT W 45 DB :MAC ;executes macro :MAC when the program
- writes to data address 45 hex, then the
- program continues.
-
- EVENT R 1234 TO 1256 XB 30 40 :FEED ;executes macro :FEED when a
- value between 30 and 40 hex
- inclusive is written to an
- address between 1234 and
- 1256 hex inclusive
-
- It is important to note that macros must be defined before they
- are used in an EVENT.
-
-
- Examples of how a macro can work with two EVENTs:
-
- DEF :MAC
- RBI .P3+2 = RBI .P1+5
- EM
-
- Together with the following macros this example forces bit 2 of
- Port 3 (P3) to follow bit 5 of Port 1 (P1).
-
- EVENT W .P1 RBY :MAC
- EVENT W .P1+5 RBI :MAC
-
- To summarize: When an instruction writes to P1, whether byte or
- bit, P3.2 will be made to follow P1.5.
-
- You may want to implement a delay from when the EVENT
- is detected until the macro is executed. This can be done with
- the MACDELAY command. If you want to delay changing P3.2 for
- 50ms from when P1.5 was written to, you would define a new macro
- which uses the MACDELAY command:
-
- DEF :MACD
- MACDELAY 50 MSEC :MAC
- EM
-
- If you change :MAC in the EVENTs above to MACD, 50ms delay will be
- added before :MAC is executed. Observe that it is 50ms counted in
- cycles where it is assumed that 12MHz is used.
-
- For a formal description of the EVENT command please type EVE at
- the command line and then F1.
-
- External environment simulator (SERIAL CHANNEL)
-
- Simulating the serial channel of the 8051 presents a challenge
- both for us and for you. For us to make it as easy for you as
- possible, and for you to set it up so that it resembles the real
- world.
-
- For a formal description of the SER command please type SER at
- the command line and then F1.
-
- @@SHELL
- SHELL command
-
- abbreviation: SH
-
- format:
- SHELL [/d] [DOS command]
-
- SHELL
- Swaps out the emulator program to EMS or disk and loads a new DOS shell.
- Almost the entire memory will be available to run the new shell.
- The path to the shell must be defined by the environment variable COMSPEC.
- Typically you may put something like
-
- SET COMSPEC=C:\DOS\COMMAND.COM
-
- in your AUTOEXEC.BAT file.
-
- EMS has priority, but disk can be forced as swapping media with the
- optional switch /D. Note that EMS is by an order of magnitude faster!
-
- A full DOS command line can be given and executed with automatic return
- to the emulator. If the DOS command is left out, the SHELL will prompt you
- for a DOS command. The command "EXIT" brings you back to the emulator.
-
-
- Examples:
-
- SHELL ; Swaps the emulator to EMS, if available,
- otherwise to disk. Then it puts you in
- command under the DOS command processor.
- Terminate and return to the emulator with
- the command: EXIT
-
- SHELL /D edit myfile.c ; Swaps the emulator to disk (leaves the EMS
- available for the editor), then lets you
- edit the specified file. When you exit
- from 'edit', you will come directly back
- to the emulator.
-
-
-
- @@SLD
- The Code Window. Source Level Debugging.
-
- The EMUL51-PC lets you open a "Code Window" with the command
- CW which toggles the CODE Window On and Off.
- (You can also use CTRL+A to toggle the CODE window on / off.
- The commands ENA CODE and DIS CODE can also be used to open / close
- the Code Window).
-
- format:
- CW
-
- When the Code window is open two modes of display are available.
- By default "assembly mode" is enabled. In this mode the disassembler
- is used generate the text in the Code window.
-
- The second mode is the "source mode".
- This mode depends on a combination of the contents of the
- symbol table and the corresponding source files or list files.
-
- The function key F2 is used to toggle between these two modes.
- Here follows detailed descriptions of how the two modes are used:
-
- 1. Assembly mode.
-
- Disassembly is started at the Program Counter (PC). The next
- instruction to be executed is high-lighted. The cursor is on the
- command line. The user interface works as usual, so you may enter
- any command or use ESC to go up to the menu line. The contents of
- the code window will follow the program counter (PC) when you use
- the STEP commands and the GO commands. By pressing the ARROW UP key
- you can move into the CODE WINDOW. The four leftmost positions in
- the CODE WINDOW will then be high-lighted. By pressing F9 a
- breakpoint will be placed at the cursor position and a GO will
- be generated. By using PgUp and PgDn you can move the contents
- of the CODE WINDOW to new addresses. You may also use the mouse to
- do PgUp, PgDn. Just point to the arrows in the corners of the
- code window and click the left mouse button. The "down arrows" will
- scroll the CODE WINDOW one line. If you point in the border between the
- arrows the window will scroll one page. Above the middle of the border
- it will scroll up and below the middle it will scroll down. If you use
- the disassembly command (D, DASM) you can change the contents to start
- at any address. (D 500 would disassemble code from 500H and put it in
- the CODE WINDOW). After STEP or GO the registers will not automatically
- be displayed as they are when the CODE WINDOW is not turned on.
- But you can use CTRL+R to toggle on a window overlaying the STACK WINDOW
- to see the most common registers. The REGISTER WINDOW on
- top of the screen is of course updated as usual between each command.
- You can redefine some items there to correspond to registers of
- interest. The Assembly mode is really "mixed" mode as it will display
- source lines intermixed with assembly if they are available. (See
- description of Source mode below). For each disassembled line a check
- is made if there is an active breakpoint from the BRx registers. If
- that is the case a "comment" is displayed to the right of the
- mnemonic preceded by a ";". Also a comment is generated for all JMP
- instructions; either ";jump" or ";no jump" to indicate if the jump
- will be taken or not.
-
-
- Source mode.
-
- Source mode is usable when you are working with Archimedes/IAR
- C-Compiler, Keil/Franklin C-Compiler, Intermetrics/Whitesmiths
- C-Compiler, BSO/Tasking C-Compiler, Intel's PL/M-51 compiler or
- when the "OBJ" file contains LINE numbers and is supported by
- EMUL51-PC.
-
- Each time the disassembler finds a code symbol (from the symbol
- table) it examines the symbol and if the first character is a '#'
- it assumes that it is a line number. It also notes the module name.
- It will then look for a file with the same name as the module name
- and with extension ".C" or ".LST", depending on the "SO" command.
- (by default ".C" is assumed). If it is found it will locate
- the current line number and display that line. In Assembly Mode
- or for that matter any time the disassembler is used, only "code
- generating" source lines will be displayed. In Source Mode, however,
- "non code generating" source lines will automatically be inserted.
- If you should put a breakpoint (as described in Assembly Mode "ARROW
- UP") on a "non code generating" line, the breakpoint will
- automatically be generated on the first assembly line in the next
- "code generating" source line.
-
- On top of the CODE WINDOW the name of the module currently displayed,
- is shown.
-
- You can only switch to Source Mode when a source line is visible in the
- Code window. Therefore if you try to switch to Source Mode
- when no source line is visible in the Code Window you will stay in
- Assembly Mode. To get to a point where a source line is visible any
- of the following methodes can be used:
-
- 1. Use PgDn, PgUp or ARROW DOWN until a source line shows up.
-
- 2. If you want to show a certain module, first use the DOMAIN (DOM)
- command to specify the module (DOM ..<module name>). Then use the
- Disassembler command (D .#line number in specified module).
-
- 3. If you want to "single step" on line numbers use the L command,
- which automatically sets breakpoints on all line numbers, then
- executes the code until it hits the first instruction
- generated by a source line.
-
- The GS (Go Slow) command is very useful both in Assembly mode and in
- source mode. The Code window will be automatically updated as program
- is executed, giving you a very good picture of what is happening
- assembly instruction by assembly instruction or high level statement
- by high level statement. The "-" key will decrease the speed of the
- execution and the "+" key increases speed.
-
- The "Highlighted bar", HB, in the CODE window.
-
- In assembly mode the HB always shows the next instruction to be
- executed. This is in principal also the case in source mode.
- The problem here is when the sourceline corresponds to only one
- assembly line. As explained earlier the L command causes breaks
- at the first instruction in each sourceline. The EMUL51-PC always
- executes the instruction at the breakpoint before breaking. So if
- there was only one instruction, the next instruction would be the
- first instruction of the next sourceline. The HB will be at the
- sourceline closest to the next assembly instruction. Therefore in
- cases where the sourceline corresponds to only one assembly
- instruction the HB will show one sourceline ahead of the "current
- line" (which was actually already executed). In most C-Compilers
- this problem can be solved by using a compiler switch which always
- generates an extra NOP at every sourceline. In PL/M-51 this is
- not possible so in this case working in mixed mode may be the
- best solution.
-
- The AV (Auto Variable) command lets you view C stack variables when you
- are inside the function where the variable is "alive".
-
- The EMUL51-PC supports different C-Compilers in different ways,
- depending on what information is supplied by the compiler in the
- "OBJ" file. NOHAU is continuously updating the software to take
- advantage of the compiler manufacturer's debug information. This is
- the latest update:
-
- "C-variable support" available for:
- Archimedes: C-Compiler 3.0 and later. Linker 4.0 and later.
- Franklin: C-Compiler 2.12 and later. Linker 2.4 and later.
- Whitesmiths: C-Compiler 3.32 mod 0 and later.
- BSO: C-Compiler 1.1A and later. Assembler 3.0B and later.
- Linker 5.0A and later.
-
- Examples of how correct object files are generated for EMUL51-PC
- to support C-variables.
- ---------------------------------------------------------------------
- FRANKLIN / KEIL:
-
- Example 1:
-
- Used INSIDE the file:
-
- #pragma code symbols debug objectextend
-
- Example 2:
-
- Used in batch file:
-
- Assembler: a51 sample1.a51 debug xref oe
- C-Compiler: c51 sample1.c debug xref oe
- Linker: l51 sample1.obj to sample
-
- ---------------------------------------------------------------------
- IAR / ARCHIMEDES:
-
- For compilation, switches are as usual but either -r0 or -r1 should
- be added. -r1 provides an extra NOP for each C-line. This is
- useful for the EMUL51-PC's handling of breaking on the first
- instruction of the C-line, as the instruction on which the
- breakpoint is put will also be executed. If you use -r1, be sure
- to change it to -r0 before burning PROM otherwise the code would be
- unneccesarily big!
-
- For linking, switches are also as usual but the -F(format) switch
- is changed to -r.
- ---------------------------------------------------------------------
- INTERMETRICS / WHITESMITHS:
-
- Example:
- 'C' c -v -dprom -dxdebug -dlistcs -o sample sample.c
- 'Asm' c -v -dprom -dxdebug -dlistcs -o sample sample.s
-
- When you are ready to program you PROM remove the -dxdebug switch
- so that your code with not be unneccesarily big!
- ---------------------------------------------------------------------
- BSO / TASKING:
-
- Compiler:
- cc51 -Ml -s -g sample.c
- Assembler:
- asm51 sample.src
- Linker:
- link51 \lib\cstart.obj,sample.obj,lib\c51l.lib to sample.abs
- Formatter:
- oct_ieee sample.abs sample.out
-
- When you are ready to program you PROM remove the -g switch
- so that your code with not be unneccesarily big! Also you can use
- a different formatting program to produce a straight HEX file.
- ---------------------------------------------------------------------
-
- All models are supported. A WATCH WINDOW can be activated to
- display up to four C variables. It overlays the REGISTER WINDOW.
- (See below for detailed description how it works).
-
- There are no restrictions on how local variables should be
- declared. There is also a way to display and set both local
- and global variables. This is done with the "?" command.
- Structures, arrays, arrays of structures and members of
- structures can be shown. Here follows some examples to
- illustrate what can be done:
-
- Syntax: ?[*..]name[,[#][x | s | d]] [=value]
-
- with the details explained as follows:
-
- - no <space> between the '?' and the variable name!
- - pointers can be preceeded by an appropriate number of
- indirections ('*'). Only last component of the 'name'
- need be a pointer.
- - 'name' is a simple C-expression for a variable with the
- following features:
- - nesting of pointers, arrays and structures.
- - a single element in an array to be given
- by a decimal number in brackets.
- - no parenthesis permitted.
- - the default format can be changed by a trailing:
- ,# a repeat counter
- ,x hex format
- ,#x combination of above
- ,s string format
- ,d decimal format
-
- otherwise 'floats' are printed as 'floats',
- 'ints' as decimal 'ints', etc.
-
- - new values can be assigned to simple variables
- (using the same format for input and output).
-
- Example:
-
- C-declarations:
-
- struct { int number; char name[8]; } list[3] = {
- 1, "ADAM",
- 4, "DAVID",
- 15, "ROBERT" };
-
- struct tag {
- struct tag *next;
- char symbol[20];
- } head,*p=head;
-
- int i = 0x1000;
- int tbl[6] = { 10,11,12,13,14,15 };
- int *ptbl = tbl;
- int *pptbl = ptbl;
-
-
- Command Output
-
- ?i 4096
- ?i,x 0x1000
- ?tbl[4] 14
- ?*ptbl 10
- ?*ptbl,3 10,11,12
- ?**pptbl 10
- ?ptbl D:ADDR:
- where 'D' is memory type
- and 'ADDR' is hex-value of pointer
-
- ?list {{1,"ADAM",4},{"DAVID"},{15,"ROBERT"}}
- ?list[2].name "ROBERT"
- ?list[0].name[3] 'M'
- ?head.next->symbol "nextsymb"
- ?p->next->symbol "nextsymb"
- ?*p {X:1234,"headsymbol"}
-
-
- Only simple items can be assigned to new values,
- but it works in complex expressions.
-
- e.g. ?list[3].name[2] = 'A'
- ( or = 0x41 )
-
- sets a single character in the string 'name[]'
- which is a member of a struct. 'list' is an
- array of structs.
-
- Note. The input format is always the same as
- the output format, but can always be overridden
- by '0x' for input of HEX code.
-
- int *tbl;
-
- ?*tbl = 100
-
- but ?*tbl,4 = 1024
- *tbl: {100,2,3,4}
- assignment ignored
-
- prints 4 elements and ignores the
- assignment since only single simple
- item can be assigned.
-
-
- If a symbol is multiply defined, the local variable is taken
- before a global variable.
-
- When the watch window is enabled (visible) you may define new
- watchpoints by typing 'w[x]' before the expression described above.
- The Watch window is enabled with ENA WAT or Ctrl+W.
-
- Syntax: w[z]?[*..]name[,[#][x|s]] [=value]
-
- where [z] is an optional number to specify in which location
- in the Watch window the variable is to appear. If the [z] is
- omitted the current contents in the Watch window will scroll up.
-
- Definition of locations:
-
- 1.
- 2.
- 3.
- 4.
-
-
- Example: w2?tbl
-
-
- Displaying stack variables using the AV command.
-
- AV can be used with or without parameters. Without parameters all stack-
- variables will be displayed. With the variable name only the desired
- variable will be displayed.
-
- By default AV displays values in hex bytes. You may, however, instruct
- AV to display values in any format by adding the first character in the
- type in which you want the value to be displayed, except that "s" means
- "string". (See the AV paragraph)
-
- Examples:
-
- AV i i ;display variable i as an integer.
- AV i c ;display variable i as a character.
- AV sune f ;display variable sune as a float.
- AV ;display all stackvariables.
-
-
-
-
-
- @@TRACE
- The Trace. How it works.
-
- The optional trace board provides the possibility of recording what
- the microprocessor is doing. However, if everything is recorded
- you may end up with some useless information. Therefore the Trace
- facility of EMUL51-PC provides a number of means by which the
- trace can be set up to record only the information you want. The
- following describes how the trace is programmed and how the collected
- information can be displayed and optionally saved to a file.
-
- The Trace Setup screen (TS):
-
- The TS screen in entered either from the "Trace" item at the top
- menu or from the command line with the TS command. The following
- description refers to the TS screen (see figure below)
-
- TRACE ALL TRIG NOTRIG ITRACE ALL TC= 2048 LC= 0 TBR= OFF
- ─────────────────────────────────────────────────────────────────────────────
- ACTIVE? ADDRESS DATA P1 P3
- QRA0 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA1 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA2 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA3 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA4 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA5 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA6 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA7 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA8 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRA9 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
-
- QRB0 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB1 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB2 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB3 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB4 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB5 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB6 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB7 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB8 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- QRB9 = no XXXX XXXX XXXX XXXXY XXXX XXXX XXXX XXXXY XXXX XXXXY XXXX XXXXY
- 'space bar': toggle, Arrow: next field, Esc: Exit from this screen.
-
-
- There are six programmable fields on top of the screen. These fields
- control how the A (QRA0-9) and B (QRB0-9) conditions will be used when
- the trace is collecting data during emulation. The TRACE field controls
- the filtering mechanism. By default ALL frames are collected. By pressing
- the space bar the following options will appear:
-
- A collect frame only when an A-condition is true
- B collect frame only when a B-condition is true
- A & B collect frame only when both A and B are true
-
- What is a "true" condition?
-
- Each machine cycle of the 8051's execution will present different
- address, data and port information. We call the information from one
- such cycle a "frame". One frame consists of 16 bits address, 8 bits data,
- 8 bits miscellaneous signals, 8 bits from P1 and 8 bits from P3. A total
- of 48 bits. For each machine cycle executed by the 8051, the trace board
- compares the 48 bits with the preprogrammed A and B-conditions. Actually
- each condition consists of four separate fields, ADDRESS, DATA, P1 and P3,
- and compares are made for each field separately. The result of the compare
- for each field is vertically OR'ed (QRA0 - QRA9). The result for each
- field is then AND'ed with the other fields (ADDRESS * DATA * P1 * P3).
- This is done independently for both the A and B-conditions. Each "FIELD"
- compare has to match exactly with the current data from the active
- machine cycle to be true. x'es denote "don't care" and the corresponding
- signal can then be either "0" or "1". The "Y" denotes binary. Values
- written into the fields without the ending Y are assumed to be hex.
-
- Now back to the top line of the TS screen which controls what to do with
- the result of every machine cycle compare. As described above the TRACE
- field controls the filter mechanism, whether or not to save the collected
- frame. The next field is the TRIG field. By default the trigger is off,
- NOTRIG. Pressing the space bar brings up more choices:
-
- A trigger on a true A-condition
- B trigger on a true B-condition
- A THEN B first find a true A-condition, then trigger on the next
- true B-condition.
- A LOOP trigger when LOOP number of true A-conditions have been
- found.
- A LOOP THEN B first find LOOP number of true A-conditions, then
- trigger on the next true B-condition.
-
-
- The ITRACE field is similar to the TRACE field. It controls a different
- filter function. By default ALL frames are saved. By pressing the
- space bar two more options will appear:
-
- MAIN trace frames from the main program only.
- INT trace frames from interrupts only.
-
- The TC (Trigger Counter) field holds the number of frames to be
- collected after a trigger is detected before tracing stops. By
- default this number is 2048 (4K trace board) or 8196 (16K trace
- board). This means that you will use half the trace buffer for
- pre-trigger frames and half the buffer for post-trigger frames.
- Programming a small number into TC would give you more pre-trigger
- information while a larger number would give more post-trigger
- information.
-
- The LC (Loop Counter) field is used to program the number of loops
- to be used by the trigger options (A LOOP and A LOOP THEN B).
-
- The TBR (Trace BReakpoint) field is used to connect the trace
- trigger with the breakpoint logic. By default it is OFF. By pressing
- the space bar it toggles between ON and OFF.
-
- The trace will automatically start when emulation begins.
- When emulation is on, you may view the results of a trace, set up
- new trace conditions, break the trace, and restart it again. When
- emulation ends the trace will automatically stop.
-
- Instead of the normal prompt (*) the trace status is shown
- at the bottom of the screen. When a key is pressed trace status
- disappears and you may now enter a trace command. The trace
- status will reappear as soon as the command is executed.
- If the ESC key is pressed during trace status, emulation breaks
- unconditionally.
-
- Trace Display Commands:
-
- There are two commands that may be used only in emulation
- mode. They are:
-
- TE, Trace End. Ends a trace "manually".
- TB, Trace Begin. Starts a new trace. Can be used only if the trace
- was stopped either by a trigger or by the manual
- TE command. Works only when the emulator is
- running.
-
- The collected trace data can be viewed only after the trace has been
- halted, either by a trigger or by the TE command. After the emulation
- is halted it can of course also be viewed, as the trace is automatically
- halted when emulation is stopped.
-
- The following commands are used to display the trace:
-
- TD, [start] ;displays trace result in disassembled form.
- TDF, [start] ;displays trace in frame form.
- TDL <start> <TO | LEN> <STOP> [-filename]. ;List without pause
- disassembled form
- optional to disk.
- TDFL <start> <TO | LEN> <STOP> [-filename] ;As TDL. In frame
- form.
- TDP [start] ;As TD but displays with Port info and ext. address
- TDS [start] ;"Slow trace". From file opened with OST and closed
- with CST.
-
- If [start] is left out, a default number of frames are displayed.
- (Not to exceed one screen). PgUp can then be used to display more
- information.
-
- Observe that if you use the filter (TRACE field) you must be careful
- when you use the TD, TDL, and TDP display commands. This is because the
- disassembler is used on the information in the trace buffer. Therefore
- if frames are missing from instructions the disassembly may be misleading.
- If for instance you program the filter so that only one address is
- collected (over and over) and use the TD command to display the result,
- *** PROCESSING INTERRUPT *** will be shown. This is because the address
- following the F frame (First byte of an instruction) is the same as
- the F frame. This normally indicates an interrupt. This would happen
- if the address you traced was in fact an F frame. Otherwise the TD may
- not show anything. In other words TDF and TDFL should be used here!
-
- For the exact format of each command refer to the detailed
- description of each command.
-
- The trace memory is 48 bit wide and 4K deep (16K deep if
- you have that option). One frame (48 bit) consists of the
- following:
-
- - 16 bits address
-
- - 8 bit miscellaneous (VF, (Valid Fetch), WR (WRite to external
- memory), RD (ReaD from external memory), SY1, SY0, INT2, INT1,
- INT0, (The last three bits indicates interrupt level)
- - 8 bit data
-
- - 8 bit from P1
- - 6 bit from P3
- - 2 extra bits. Marked E0 and E1 on the pod.
-
- If P1 and / or P3 do not need to be traced, remove the
- jumpers on the pod. That means that 18 of the trace inputs can be
- used to trace external signals. They are easily connected with
- the optional EZ-hook wires.
-
- The lower 8 bits of the address are sampled on the trailing
- edge of ALE. The higher 8 bits of the address and P3 are sampled
- on the leading edge of PSEN, READ or WRITE. P1, data and the 8
- miscellaneous signals are sampled on the trailing edge of PSEN,
- READ or WRITE.
-
- The display of frame data is organized in the following way:
-
- Leftmost column: Frame number
-
- Second column: F = Valid fetch frame
- R = External memory read frame
- W = external memory write frame
- - = none of the above
-
- Third column: Address in hex.
-
- Fourth column: Data in hex
-
- Fifth column: Interrupt level. 0 is main program.
-
- Sixth column: Port 1 / Port 3
-
- Seventh column: SY1, SY0, E1, E0
-
- Eighth column: Machine cycle count (see below for detailed
- explanation)
-
- The Machine cycle count can be regarded as a "time stamp".
- If a 12MHz clock or crystal is used, "machine cycles" are
- equivalent to microseconds. If the filter function is used,
- the "count" is only accurate on a relative basis within a
- block of trace frames with contiguous addresses. In other
- words: the counter does not recognize "gaps" in the trace
- caused by "filtering out" frames.
-
-
-
- @@BREAK
- Breakpoints. How they work.
-
- Emulation is started with the GO command. The ending of
- emulation can occur in a number of ways.
-
- 1. Press the ESC key. This will immediately stop emulation and
- allow access to the monitor.
-
- 2. A previously set up breakpoint is encountered. A breakpoint
- can only be set up to break on addresses. It can break on three
- kinds of addresses: Opcode address, Read external memory address,
- and Write external memory address. Breakpoints are programmed in
- the BRx registers where x is 0 - 9. (See BR for details). The BRM
- register holds the address type(s) that the breakpoints work on.
- (See BRM for details.) Breakpoints are activated either in the
- GR (Go Register) register, by setting the GR or inside the GO
- command. (See GR and GO).
-
- 3. An external signal SY0. It works in a number of combinations
- with breakpoints, set up in GR. SY0 can be programmed active high
- or active low. This is set up in the SY0A register. (See SY0A).
-
- 4. A trace condition. With the TBR register you can use the trace
- conditions to activate a breakpoint. This means that you can use
- any combination of the 48 bits wide trace frame to trigger a
- breakpoint. (See TBR). Observe that all 48 bits are used. If for
- instance you want to trigger on an address you will probably want
- to set VF (Valid Fetch, indicating first frame of an instruction)
- to a "1". Because the trace is delayed a couple of PSEN cycles,
- the actual break will occur one instruction after where the trace
- condition was set. This means that the PC (program counter) will
- show two instructions after the trace condition that caused the
- break.
-
- 5. If you happen to write a 0 to RD (P3.7) or WR (P3.6) a break
- point is forced. An error line "BREAK OCCURRED BECAUSE RD OR WR
- IS LOW" is displayed as the first line after the break occurred.
-
- 6. The L command sets up breakpoints on all LINE numbers
- defined in the symbol table. The code is then executed until any
- of the breakpoints is encountered. Previously activated
- breakpoints in the Breakpoint RAM are erased before this command
- is executed. Used in PL/M-51 and C-51.
-
- 7. The BB command sets up breakpoints on all locations where a
- specified bit address is written to. Use the GB command to execute.
-
- 8. The BYB command does the same where a specified byte address
- is written to. Use the GB command to execute.
-
- 9. The IB command lets you specify a pattern of three bytes
- where a breakpoint will be programmed. The first byte should be
- the hex number for an instruction OP-code while the second and
- third can be either numbers or X (don't care). Use the GB command
- to execute.
-
- 10.The BIC command will set up breakpoints on all instructions
- which may possibly alter the contents of a specified address to a
- specified value or range of values. The breakpoints set up with
- BIC should be used in conjunction with the GI command which will
- use the breaks to check if the specified condition is reached. If
- not the program will resume. Each break will steal approximately
- 200 microseconds from the program before it returns. If the
- condition was reached a regular breakpoint will be taken.
-
- 11.The BB, BYB, IB, and BIC commands may be used to implement
- many "overlayed" breakpoint patterns in the breakpoint RAM. The
- breakpoint RAM is always cleared before a GO or an L command is
- executed. It can also be cleared with the CLB command.
-
- 12.The SEB, ABR and GB commands are used to to trap the cause of
- a program that "jumps out of bounds". See the ABR paragraph).
-
- Observe that the instruction where the breakpoint is set will
- also be executed before the break occurs. This means that the PC
- will show the next instruction to be executed. (Except TBR.
- See 4. above).
-
- note on TIMERS:
- If the timers are active when a break occurs they will keep
- counting for a couple of cycles before they are stopped by the
- emulator software. When emulation is then started again the
- timers will be turned back on by the emulator software a couple
- of cycles before the actual emulation begins. The following table
- shows how many cycles are lost:
-
- |T0, T1| T2 |
- ---------------------|------|------|-------
- EMULATION TO MONITOR:| 8 | 15 |
- MONITOR TO EMULATION:| 6 | 15 |
- ---------------------|------|------|-------
- If this is a problem you will have to manually adjust the timers
- with these numbers. A macro could be used to do this.
-
-
-
-
- @@MACRO
- MACROS. HOW THEY ARE USED.
-
- Macros are used to automate the emulation commands. A macro
- consists of a number of commands. Instead of being input from the
- keyboard they are read from the macro block. Macros can be saved
- on a file and later read back into the emulator. They are
- extremely useful when you need to repeat the same sequence of
- commands over and over again.
-
- Another way to repeat and store command sequences is to write them
- in a regular ASCII file and then use the INCLUDE (INC) command to
- execute them. This is also normally faster than macros. (See the INC
- command for details).
-
- To define a macro you use the DEFINE command. See the DEF
- paragraph for details. If you create more complex macros it is best
- to use an editor to create a regular ASCII file with the macro
- definition. If you use the SYSTEM command this can be done without
- leaving the emulator. When you have edited your macro setup you can
- load it into the emulator with the INC command.
-
- Example: (This could be the contents of a file, except the "*" and ".*")
-
- *DEF :R This defines a macro called R
- .*RESET CHIP First command in the macro
- .*GO FROM .START TO .STOP
- .*TD -100
- .*EM Ends macro
- *
-
- To run the macro you simply enter:
-
- *:R
-
- The macro can be made more flexible by using parameters. You may
- use up to 10 different parameters in each macro. The parameters
- are entered into the macros using the % character followed by a
- number from 0 to 9.
-
- Example:
-
- *DEF :FLEX
- .*XBYTE %0 = %1
- .*GO FROM %2 T %3
- .*XBY %4 L 10
- .*EM
- *
-
- As we used 5 parameters in the macro (%0 - %4) we must supply the
- macro with these 5 parameters when we execute the macro. The
- parameters must be separated by commas:
-
- *:FLEX 1000,23,.START,.STOP,2000
-
- So in this case %0 corresponds to 1000, %1 corresponds to 23, and
- so on. Each parameter can be used any number of times inside the
- macro. The parameters may appear in any order inside the macro.
-
- If you use %np in a macro it will be replaced with a number indicating
- the number of parameters (np) that were fed to the macro.
-
- Instead of creating the macros with the DEFINE command in the emulator
- you can use your editor to edit the "DEFINE block" in a regular ASCII
- file. It can then be loaded into the emulator with the INCLUDE command.
- Especially if you create more complex macros this is the prefered
- methode since it it easy to correct if it should not work immediately.
- Even if you do create the macro directly in the emulator with the
- DEF command you can save it to a file with the PUT command. Then you
- can edit it, (using the SYSTEM command to invoke the editor without
- leaving the emulator), maybe use the REMOVE command to remove the old
- macro and then INCLUDE the edited macro.
-
- Example:
-
- * DEF :M ;defining a macro in the emulator
- .* LOA TEST.A03
- .* RES CHI
- .* GO FOREVER
- .* EM ;end macro
- * PUT A:START.MAC :M ;save macro to a file
- * SYS WS A:START.MAC ;edit macro
-
- (editing the macro using WORDSTAR).
-
- * REM :M ;remove old macro
- * INC A:START.MAC ;load the new edited macro
-
- Comments in a macro are allowed. Any line that starts with /* is
- treated as a comment and the command interpreter ignores it.
-
- Example:
-
- /* This is a comment line.
- DBYTE 56 = 45
- G F 0 T 1234
- /* Another comment
-
-
- The WRITE command is often used in a macro to have text mixed with
- numbers printed to the screen. It is possible to format the
- printing of the numbers to the screen:
- We use the same conventions as are used in the "C" language, but the
- "%" sign has been replaced with the "~" sign (tilde).
-
- The format string is placed after the number to be formatted.
-
- Examples:
-
- WRI 'This is an integer: ', XBY 1000,~d
- WRI 'This is a 4-digit hex number with leading zeros: ',DB 26,~04X
- (See the WRI command).
-
-
- To list macros use the DIR command. See the DIR paragraph.
-
- To save a macro use the PUT command. See the PUT paragraph.
-
- To load a macro use the INC command. See the INC paragraph.
-
- To enable or disable macro expansion please refer to the ENA and
- DIS paragraphs.
-
- Macros can be programmed to form their own small programs using
- IF, ORIF, THEN, ELSE structures, or REPEAT, WHILE, UNTIL, or
- COUNT, WHILE, UNTIL. See the IF, REP, and COU paragraphs for
- details.
-
- @@WIN
-
- HOW THE DATA WINDOWS ARE USED.
-
- The data windows are automatically updated between commands.
- This causes a short delay after each command. As the specified
- memory locations are all read, read (RD) signals will go out
- to the target system if the external data is mapped to the target
- system (which it is by default). If this causes a problem please
- disable the window by using DIS XDATA.
-
- There are four data windows. The REGISTER WINDOW on the top have
- 18 locations that can be programmed by the user to reflect any
- memory location in any of the address spaces of the 8051. By
- default the 18 locations are set up to reflect the most common
- special function registers (RBYTE) of the 8032. For details on
- how to change each individual location, please refer to the SWR
- paragraph. Here is an example how to change location 5 to reflect
- address 1E85H in external memory. The symbol name that we have
- chosen is A_VALUE:
-
- SWR 5 XBYTE A_VALUE 1E85
-
- The DATA window reflects 24 contiguous memory locations in the
- internal data memory. The first location is 20H by default but
- can be set up to any position between 0 and E7H. For details
- please see the SWD paragraph. This example changes the first
- address to 60H:
-
- SWD 60
-
- The XDATA window reflects 24 contiguous memory locations in the
- internal data memory. The first location is 4000H by default but
- can be set up to any position between 0 and FFE7H. For details
- please see the SWX paragraph. This example changes the first
- external address to 0H:
-
- SWX 0
-
- Both the DATA and XDATA windows may be moved around on screen. You
- may also change size on them using the function keys on the bottom of
- the screen.
-
- The STACK window always reflects the stack. It shows max. nine
- positions of the stack starting with the byte to which the
- stack pointer is currently pointing. The contents of the stack is
- then shown in descending order.
-
- The static window is by default enabled. It can, however, be
- disabled using the DISABLE command or the F6 key. See the
- DIS paragraph for details.
-
- DIS WINDOW
-
- It may then be reenabled by using the ENABLE command or press
- F6 again. See the ENA paragraph for details.
-
- ENA WINDOW
-
- You can move the windows and expand them using the F4 and F5
- function keys.
-
- Inside the DATA or XDATA window you can use PgUp and PgDn to
- scroll information.
-
- It is also possible to save set ups to a file using the SAW
- command. See the SAW paragraph for details.
-
- SAW A_SETUP
-
- Set ups can the be loaded back using the LOW command. See the LOW
- paragraph for details.
-
- LOW A_SETUP
-
- By using many set up files you can switch the static window to
- reflect different parts of the memory. By using macros to do that
- you could switch windows using only three key strokes!
-
- @@BANK
-
- BANK SWITCHING. (SOFTWARE).
-
- Many users are breaking through the 64K code barrier for 8051 based
- chips. The problem for Nohau is that everybody uses different
- schemes to implement the bank switching hardware. Our solution
- for now will be to modify the emulator board to mimic individual
- targets' bank switching schemes.
-
- We have attempted to find a universal solution to the problem of
- connecting symbols and source level debugging to bank switching.
- It is probably not sufficient to cover all needs, so please
- contact us so that we can discuss your problems.
-
- The emulator must be started with the -m32 switch even though
- the emulator has 128K installed.
-
- If the emulator is used without bankswitching there will be 64K
- of overlaid memory. (CODE and XDATA). In this case the "bankswitch
- cables" should be left unconnected.
-
- Breakpoints involving bank can only be done using the trace.
- The TBR should be ON and bank programmed in E1, E0 which are
- located in the two most significant bits of P3 in all "external
- pods".
-
- The following commands can be used:
-
- BANKBYTE [address] [memtype]
-
- Where [address] is a dedicated address either in internal data
- memory, DB, or in external data memory, XB. The contents of
- this address must "shadow" current bank. In other words: the
- user's bank switching code must write to this address when
- bank switching is done.
-
- BANK [bank]
-
- Displays or sets current bank. Actually displays or sets the
- contents of BANKBYTE.
-
- BANKADDRESS [address1] TO [address2]
-
- Where [address1] TO [address2] is the "banked address area".
-
- This command MUST be issued BEFORE the user file is loaded.
- This is because the loader uses this information to "mark"
- the bank number.
-
- The default values are 8000 TO FFFF
-
- BANKSEGMENT [number] [segment name]
-
- Where [number] can be 1, 2 or 3. [segment name] is the segment
- name in the symbol table that your assembler or compiler must
- produce. At this point only Intel's OMF is supported. Many
- segments can be associated with one bank, but you must enter
- them one by one (see example below). All symbols in a bank
- should be covered by the correct number of segments present
- in that bank. Segment and bank boundaries should coincide.
-
- This command should be issued BEFORE the user file is loaded if
- you use the "segment method" to indicate bankswitch while loading
- symbols. (See below). This is because the loader uses this
- information to "mark" the bank number.
-
- Using any of the BANKBYTE, BANKADDRESS or BANKSEGMENT commands
- to assign new values will enable "bank handling" of symbols.
-
- There is no way to reset "bank handling", except to exit EMUL51
- and restart.
-
- All actual bankswitching, (meaning writing to the hardware) is performed
- either from the customers code or by commands in monitor mode. Normally
- a macro would be used to save typing. In some cases the loader can
- perform bankswitching "automatically". This will work through a special
- macro that the user must define - BANKSWITCH. See examples below.
-
- As mentioned above there are different ways to let the loader know which
- bank number should be assigned to which symbol. Any CODE symbol that has
- a value which is within the range specified by the BANKADDRESS command
- will be assigned the number in the byte defined by the BANKBYTE command.
- The segment information in the load file (using INTEL OMF format) will
- automatically switch the contents of "bankbyte" according to the
- information specified by the BANKSEGMENT command(s). If segments are
- not used, all CODE symbols in a file within the "bankaddress range"
- will get the same bank number, namely the number in "bankbyte".
-
- In other words, if you don't use the "segment" method you must change
- the bankbyte before and between loading files. Use BANK [bank number]
- to do this.
-
-
- Example 1: (using files without segments)
-
- BANKBYTE 38 DB ;internal data address 38 is used
- as "bankbyte"
- BANKADDRESS 0 TO FFFF ;all 64K is bankswitched!
- BANK 1 ;symbols in FILE1 belong to bank 1
- :SWITCH 1 ;invoke macro to switch hardware to bank 1
- LOAD FILE1 ;load FILE1
- BANK 2 ;symbols in FILE2 belong to bank 2
- :SWITCH 2 ;switch hardware to bank 2
- LOA FILE2 ;load FILE2
-
- Example 2: (using files with segment info)
-
- BANKBYTE E023 XB ;external data address E023 is used
- as "bankbyte"
- BANKADDRESS 8000 TO FFFF ;upper 32K bankswitched!
- BANKSEG 1 SEGMENT1 ;specify banks in different segments
- BANKSEG 1 SEGMENT2
- BANKSEG 1 SEGMENT3
- BANKSEG 1 SEGMENT4
- BANKSEG 2 SEGM1
- BANKSEG 2 SEGM2
- BANKSEG 2 SEGM3
- LOA BASEBANK.OBJ ;load. Should be addresses 0 to 7FFF
- :SWITCH 1 ;switch hardware to bank 1
- LOA BANK1.OBJ ;load bank 1. SEGMENT info should come
- before any banked symbols. Otherwise
- such symbols will be banked to whatever
- is in "bankbyte"
- :SWITCH 2
- LOA BANK2.OBJ
- :SWITCH 3
- LOA BANK3.OBJ
-
- Where :SWITCH is a macro that could be defined as follows:
-
- DEF :SWITCH
- RBY .P1 = %0 ;if P1 is used for bank switching
- DBY 32=%0 ;BANKBYTE set to internal address 32H
- EM
-
-
- The LOA
- :SWITCH
- above could be defined as a macro called LOAD for
- example. In that case loading the program would be very easy:
-
- :LOAD
-
- Here are more examples of how bank switching could be set up:
-
- BANKSEG 1 SEGMENT1 ;SEGMENT 1 is in bank 1. This also
- initiates bank switching.
- BANKSEG 1 SEG_SUB ;This segment is also in bank 1.
-
- BANKSEG 2 SEGMENT2 ;SEGMENT 2 is in bank 2.
-
- BANKADDRESS 8000 TO FFFF ;Specify between which addresses bank
- switching is done.
- BANKBYTE 32 DB ;Byte 32H in internal data memory must
- indicate current bank. User code or
- "switch macro" should change this byte
- to "shadow" current bank.
-
-
- As mentioned above bankswitching can be performed while the code is
- loaded. At present this works for INTEL OMF with SEGMENT INFORMATION
- as described above. It also works for IAR / Archimedes. When the
- loader detects that bankswitching needs to be done it checks to
- see if a user defined macro called BANKSWITCH is present. If so,
- it calls the macro with one parameter namely the bank number.
-
- Example of how a BANKSWITCH macro might look. We assume in this
- example that P1.0 is used for switching and that BANK 1 is
- switched in when P1.0 is 0 and that BANK 2 should be switched in
- when P1.0 is 1. (%0 in the example is used for the first parameter,
- in this case the bank number).
-
- DEF :BANKSWITCH
- IF %0 EQ 1
- RBI .P1+0=0
- ENDIF
- IF %0 EQ 2
- RBI .P1+0=1
- ENDIF
- EM
-
-
- Each user must create BANKSWITCH according to how bankswitching
- is implemented is his target system.
-
- __________________________________________________________________
- SCOPE [module]
-
- This command displays the scope of the code that was loaded for
- each module. If the code is in a bank as defined by BANKSEG
- it is indicated.
-
- Examples:
-
- SCOPE ;display code scope of all modules
- SCOPE CMD_INT ;display code scope of module CMD_INT
- ___________________________________________________________________
- SYM ? ? SEGMENT
-
- shows all segments loaded.
- ____________________________________________________________________
-
- TRACING DURING BANK SWITCHING.
-
- When bank switching is activated (by using the BANKSEG command)
- the trace will use E1 and E0 to trace active bank. E1 and E0 are
- available on the pod board as "wire wrap posts". When nothing is
- connected a "1" will be traced. The following combinations on
- E1 and E0 indicate current bank:
-
- E1 E0
- 0 0 bank 0
- 0 1 bank 1
- 1 0 bank 2
- 1 1 bank 3
-
- The result will be that the correct symbols will be shown
- according to the bank indicated by the values traced at E1 and E0.
-
-
- @@COM
- SHORTFORM LIST OF SOME COMMANDS.
- (Shortest form shown in upper case)
-
- AAsm, ABr DP LC REMove TD
- ACc DEFine LIst REPeat TD
- ADjust DIR LOad RESet TDF
- Asm DISable LOW R0 - R7 TDFL
- AV DOMain MACro SAVe TDL
- B DPTr :"macro" SAW, SEB TDP
- BB ENable MAPC SEconds TDS
- BIc Evaluate MAPX SLM TDFS
- BRx EXit NOsnow STAck TE
- BRM Fill OST Step TM0
- BRS GB P1 SN TM1
- BYB Go P3 SUffix TS
- CALC GI PByte SP TSGet
- CByte GR PC SWD TSPut
- CLb GS PPA SWR UNTil
- COUnt IB PUT SWX Ver
- CST IF RBit SY0a WAit
- CW INClude RBS SYMbols WHile
- Dasm INTerrupt RByte SYStem WRite
- DByte L Registers TB Xbyte
-
- LIST OF SOME AVAILABLE COMMANDS.
- (with short explanation)
-
- AAsm Enter Automatic Assembly mode.
- ABr Automatic Breakpoint Remove. "Out of bounds"
- checking of code memory. Use with SEB and GB.
- ACC Displays or sets accumulator.
- ADjust Adjust position and size of windows.
- Asm One line assembler command.
- AV Autovariables. View stack variables in C-51.
- B Displays or sets the B register. (See ACC
- paragraph).
- BB Set up Break on direct write to Bit address.
- BIC Set up Break on Internal Contents.
- BRx BReakpoint registers. x is 0 - 9.
- BRM BReakpoint Mode register. OP (opcode), RD
- (ReaD), WR (WRite) or any combination of
- them.
- BRS Breakpoint Register Slow. Used with GS
- command.
- BYb Set up Break on direct write on BYte address.
- CAlc Calculate checksum in code memory.
- CBYte Display or set contents of user code bytes.
- CLB CLear Breakpoint RAM
- COunt Begins block of commands to be executed
- a specified number of times.
- CSt Close Step Trace file. See OST command.
- CW Code Window. Toggle ON/OFF.
- Dasm Disassemble program memory.
- DBYte Display or set contents of internal data.
- Address 0 - 7FH. (See CBY paragraph).
- DP Disassemble from where PC points.
- DEfine Define macro or Define symbol.
- DIR Displays directory of macros.
- DIsable Disable Macro expansion or Disable symbols
- in Disassembly listings.
- DOmain Displays or sets default module name
- DPTr Displays or sets Data Pointer (DPTR).
- ENable Enable Macro expansion or Enable symbols
- in Disassembly listings.
- Evaluate Evaluate expression.
- EXit Terminates the EMUL51-PC and returns to DOS
- Fill Fills a specified memory area with a
- specified value.
- GB Go till Breakpoint. Use after BB, BYB, etc.
- Go Starts emulation.
- GI Go till Internal register contents match.
- GR Go Register. For break conditions.
- GS Go Slow. Automatic single stepping. Can
- break on internal memory contents.
- IB Set up Instruction Break.
- IF Begins a block of commands to be executed
- when the condition following IF is TRUE.
- INClude Reads a sequence of commands from the
- indicated drive and file.
- INTerrupt Displays interrupt status.
- L Line Step. Single step on PL/M-51 or C-51
- linenumbers.
- LC Display or set the Loop Counter. (Trace
- command. Also see TRA paragraph)
- LIst Outputs a copy of everything which is
- printed on the screen to a specified device
- or file.
- LOAd Loads user program and symbol table from
- indicated drive and file.
- LOW LOad Window file.
- MACro Displays the definitions of the indicated
- macros.
- : "MACRO NAME" Invokes a previously defined macro.
- MAPC Map code memory to emulator or target.
- MAPX Map external data memory to emulator or
- target.
- NOsnow Use if you get "snow" on the screen when
- using the static window
- OSt Open Step Trace file. Trace buffer from
- single steps.
- P1, P3 Display or set ports P1 or P3. (See ACC
- paragraph).
- PByte Display or set contents of external memory
- without read back check. See CBY paragraph.
- PC Displays or sets the Program Counter (PC)
- PPA Program Performance Analyzer.
- PUt Stores one or more macro definitions on
- indicated drive and file.
- RBIt Display or set bit memory.
- RBS Display or set the register bank select.
- RByte Display or set contents of special
- registers. (Internal addresses 80H - FFH).
- (See CBY paragraph).
- Registers Display internal registers.
- REMove Remove Macro or Remove Symbol.
- REPeat Begins a block of commands to be repeated.
- RESet Reset BRx, QRx, EM, or CHIP.
- R0 - R7 Display or set Rx of current register bank.
- x = 0 - 7.
- SAVe Copies user program and symbol table to
- specified drive and file.
- SAW SAve Window setups.
- SEB SEt Breakpoints. Sets all 64K bits in the break-
- point memory to 1's.
- SEConds Displays execution time counter. (Number of
- cycles since emulation started).
- SLM Set Line numbers MCC C-compiler.
- STAck Displays the contents of the stack and the
- stack pointer value.
- Step Executes one instruction, then breaks.
- (Single step).
- SN Step Next. Straight single step. Skips over
- subroutine calls, branches and interrupts.
- SUffix Displays or sets the default radix for
- numbers entered to the emulator.
- SP Display or Set Stackpointer. (See ACC).
- SWD Setup Window Data address.
- SWR Setup Window Registers.
- SWX Setup Window eXternal data address.
- SY0A SY0 input. Active high or active low.
- SYMbols Displays all user defined symbols and
- their values.
- SYStem Used to leave the emulator temporarily to
- execute a DOS command.
- TB Trace Begin. Works only during emulation.
- (See TRA paragraph).
- TBR Trace BReakpoint. This register can be set
- ON for using the trace trig to activate
- breakpoints, or OFF.
- TD Trace Display. Disassembled form.
- TDF Trace Display Frame. Display in frame form.
- TDFL Trace Display Frame. No pause. File output
- option.
- TDL Trace Display. Disassembled form. No pause.
- File output option.
- TDP Trace Display with Ports and external data
- addresses.
- TDS Trace Display Step. Displays trace from
- single steps in mnemonic form. Works only
- after OST command.
- TDFS Trace Display Frame Step. As TDS but in
- frame form.
- TE Trace End. Works only during emulation.
- (See TRA paragraph).
- TM0, TM1 Display or set Timer 0 or Timer 1. Word.
- (See DPT paragraph).
- TS Trace Setup. Static screen for trace setup.
- TSGet Load a trace set up from a file.
- TSPut Save a trace set up to a file.
- UNTIL See COUNT and REPEAT commands
- Ver Display software version number.
- WAit Waits for a key stroke.
- WHIle See COUNT and REPEAT commands
- WRIte Displays an evaluated expression or a
- string of characters on the screen.
- XByte Display or set contents of external memory
- with read back check. (See CBY paragraph).
-
-
- @@AASM
-
- AASM. Automatic in-line ASseMbler.
-
- abbreviation: AA
-
- format:
- AASM
-
- Description:
-
- AASM enters a mode where you can only input instructions or ORG. To quit
- this mode press ENTER at the prompt. (Works like the ASM command except
- that you don't have to enter ASM (or A) in front of each instruction.
- Also see the ASM command.
-
- Example:
-
- AASM
-
- @@ABR
-
- Automatic Breakpoint Remove.
-
- abbreviation: AB
-
- format:
- ABR <start address> TO <stop address>
-
- Description
-
- The ABR command is always used in conjunction with the SEB command
- (SEt Breakpoints) and the GB command (Go till Breakpoint). First the
- SEB command is issued to set the complete 64K bit breakpoint to all
- 1's. Using the GB command at this point would break immediately at the
- first instruction. The ABR command, however, should first be used to
- remove breakpoints from all opcode addresses which are within the legal
- program. Normally, legal code resides in a number of different blocks
- within the 64K address space of the 8051. Breakpoints must be removed
- from each of these blocks separately. The ABR will remove only the
- breakpoint of the first byte in each instruction. Second and third
- bytes will still have breakpoints. Data tables within the code must be
- taken into consideration. If you should include a data table within a
- block of legal instructions the ABR will treat the data table as if
- it were instructions which will then remove breakpoint from some bytes
- of the data table and then possibly on the wrong bytes of the rest of
- the block. (Because the breakpoint removing program will get out of
- sync). It is therefore extremely important that you remove breakpoint
- from all legal program blocks, but it is equally important that they
- are only removed from legal program blocks. Legal program blocks include
- the RESET vector at address 0 as well as any active interrupt vectors.
- The GB command should then be used. Now if code is executed outside
- of the legal blocks that you programmed, a breakpoint will occur. By
- looking back in the trace you should be able to figure out what caused
- it to happen. Without the trace option it may be more difficult to see
- exactly what actually happened. (Do NOT use the GO command, it will erase
- all breakpoint and put in new breakpoints according to the BR registers).
-
- Note: Breakpoints on code between FFFC and FFFF cannot be removed. You
- will get Error Message "STOP VALUE TOO BIG" if you try.
-
- Example:
-
- SEB ;set all breakpoints
- AB 0 TO 0 ;remove breakpoint on reset vector
- AB 13 TO 13 ;remove breakpoint on external int 1 vector
- AB 100 TO 45F ;remove breakpoints from legal program block
- 100H to 45FH
- AB 470 TO 1134 ;remove breakpoints from legal program block
- 470 to 1134. Maybe there was a data table
- between 460 and 470.
- RES CHI ;start from scratch (not neccesary)
- GB ; Go till Breakpoint.
-
-
-
- @@ADJ
-
- ADJUST. Adjust windows command.
-
- abbreviation: AD
-
- format:
- ADJUST
-
- Description
-
- The ADJUST command will make the ADJUST window appear on the screen. Here
- you can choose which window to adjust. You can also use the function keys
- F4, F5 to do the same thing.
-
- Example:
-
- AD
-
-
-
- @@ASM
- THE ONE LINE ASSEMBLER.
-
- abbreviation: A
-
- format:
-
- ASM [ORG address]
- [instruction]
-
- ASM will either display or set the EMUL51-PC's assembly
- pointer, or assemble one instruction into code memory at the
- assembly pointer location. It displays the updated assembly
- pointer after assembling any instruction.
-
- Addresses of JUMP and BRANCH instructions are written as absolute
- addresses. The one line assembler will automatically calculate
- the offset in the case of a relative jump.
-
- Bits are denoted using a "+" and not a "."
-
- Example: A JNB .P1+4,.LOOP
- A CLR .ACC+2
- A SETB .B+5
-
- ORG
-
- Sets the assembly pointer to the specified address.
-
-
- instruction
-
- Any valid instruction mnemonic except CALL and JMP, which are
- "generic instructions".
-
- Examples:
-
- A ;displays assembly pointer
-
- A ORG 200H ;sets assembly pointer to 200H
-
- A CJNE A,.DAT,.LOOP ;assembles instruction
-
- A JB .P1+5,1000 ;An offset to address 1000H will be
- calculated from the current position.
-
-
- @@ACC
-
- Display and Set Commands for special registers.
-
- Format:
- ACC [= <value>]
- B [= <value>]
- P1 [= <value>]
- P3 [= <value>]
- SP [= <value>]
-
- Examples:
-
- ACC ;Display contents in the Accumulator.
- ACC = 68 ;Set Acc to 68H.
- B ;Display contents in the B register.
- B = 54 ;Set the B register to 54H.
- SP :Display contents in the SP register.
- SP = 30 ;Set SP to 30H
- P1 = FA ;Set Port P1 to FAH.
- P3 = C0 :Set Port P3 to C0H. (Always keep P3.6 and P3.7
- high. Except POD-51).
-
-
- @@AV
-
- Autovariable command.
-
- format:
- AV [C stackvariable] [type (i, c, u, s, f, l)]
-
- For a detailed discussion of this command and Source Level debugging
- in general please refer to the SDL paragraph in this document. If
- you use this via the help window in the emulator this paragraph is
- found under the "Help" and "SourceDeb." items as "Source Level
- Debugging".
-
- @@BASE
-
- The BASE command
-
- format:
- BASE
- BASE [H,T]
-
-
- @@BB
- Break on write to Bit address
-
- format:
- BB <bit address>
-
- <bit address> is between 0 and FFH. This command will go through
- the entire code memory and look for the following instructions:
-
- CLR bit
- CPL bit
- JBC bit, rel
- MOV bit, C
- SETB bit
-
- When any of them is found a corresponding breakpoint is activated
- in the breakpoint RAM. Then when the GB command is used these
- breakpoints will break the program when a bit is written to the
- specified bit address. NOTE only DIRECT bit writes will work. You
- can combine with the BYB command. (See the BRK paragraph).
-
- Examples:
- BB 4 ;set up breakpoints on bit writes to bit
- address 4
- BB .EA ;set up breakpoints on bit writes to the
- EA bit address. (In the IE register).
-
-
- @@BIC
-
- BIC. Set Breakpoints on Internal Contents.
-
- abbreviation: BI
-
- format:
- BIC <address>, <low value>, <high value>, <low code address>,
- <high code address>, <type>
-
- <address> is the byte address of either an internal
- data byte (DBYTE) or a Special Function
- Register (SFR).
-
- <low value> is the lower limit of values on which to break.
-
- <high value> is the higher limit of values on which to break.
-
- <low code address> start address for "code scan".
-
- <high code address> stop address for "code scan".
-
- <type> must be DB (DBY, DBYT, DBYTE) or RB (RBY, RBYT,
- RBYTE)
-
-
- Description:
-
- BIC will scan the specified code area between <low code address> and
- <high code address> for all instructions, that if executed, can change
- the contents of the specified <address>. On all such instructions a
- breakpoint will be set at its corresponding code address. These
- breakpoints will be treated as regular breakpoints if you use the GB
- command to execute the code. In other words this would work as BB,
- BYB and IB. When using the GI command, however, the breakpoint
- will be taken, but if the contents of the address specified in BIC
- is not between (and including) <low value> and <high value>, the
- program execution will resume. This check takes approximately 580
- cycles which is equivalent to 580 us if a 12MHz crystal is used.
- For the "bondout PODs" (POD-C51B, POD-C552B, POD-C751, and POD-C517
- it takes about 1050 us). (See GI for more details).
-
- Before the command is executed the question "Do you want to clear
- previous breakpoints (Y/N): " is asked. Press Y (or y) if you want them
- to be erased. Any other keystroke will be interpreted as N (NO). The
- breakpoints we talk about here are "hardware RAM breakpoints" and does
- not affect the BRx registers which are used for GO.
-
- Different categories of instructions can change the contents of an internal
- address. When BIC is executed, messages will be written on the screen,
- telling which category is presently scanned for. The following messages can
- be seen:
-
- Scanning code (Direct byte). Takes time. Please wait...
- Scanning code (Direct bit). Takes time. Please wait...
- Scanning code (Indirect byte). Takes time. Please wait...
- Scanning code (Register). Takes time. Please wait...
- Scanning code (DPL, DPH). Takes time. Please wait...
- Scanning code (PUSH). Takes time. Please wait...
- Scanning code (CALL). Takes time. Please wait...
- Scanning code (B-REG). Takes time. Please wait...
-
- Direct byte: Direct write to a byte address, like MOV addr,A. See BYB
- for a listing of all "direct write byte" instructions.
-
- Direct bit: Direct write to a bit address, like CLR bit. See BB for a
- listing of all "direct write bit" instructions.
-
- Indirect byte: Only in the DBYTE area. Scanning occurs for the following
- instructions: (In the following the "at" sign is replaced
- with a "*" because the "at" can't be used in the help text.
- INC *R0; INC *R1; DEC *R0; DEC *R1; MOV *R0,#data;
- MOV *R1,#data; MOV *R0,data; MOV *R1,data; XCH A,*R0;
- XCH A,*R1; XCHD A,*R0; XCHD A,*R1; MOV *R0,A; MOV *R1;
-
- Register: Only in the DBYTE area on addresses under 20H. Scanning
- occurs for the following instructions:
- INC Rn; DEC Rn; MOV Rn,#data; MOV Rn,data; XCH A,Rn
- DJNZ Rn,addr; MOV Rn,A; where n is 0 - 7.
-
- DPH, DPL: Only in the RBYTE area. Direct byte writes already covered
- by "Direct byte" above. The following two instructions can
- however also influence DPH and DPL:
- MOV DPTR, #data; INC DPTR;
-
- PUSH, CALL: Only in the DBYTE area and for SP (81H) in the RBYTE area.
- Following instructions: PUSH data; any of the "CALL"
- instructions (ACALL, LCALL)
-
- B-REG: Only for the B-register (F0H) in the RBYTE area. Direct
- writes to B are covered by "Direct byte" above. The
- following two instructions can however also influence B:
- DIV AB; MUL AB;
-
-
- The following SFR:s are not fully covered:
-
- ACC (E0H)
- PSW (D0H)
-
- All timer registers (TH0, TL0, TH1, TL1, TH2, TL2)
-
- Port pins are covered but not Port latches. See Read-Modify-Write in 8051
- data books for details.
-
- All SFR:s where hardware directly changes bits. Like TCON, SCON and SBUF.
-
-
- note 1. If, when you use GI, a breakpoint is not reached and you use ESC to
- manually break, you will get WRITE TIMEOUT and READ TIMEOUT errors.
- This is because the code which is handling breakpoints is modified
- to check if the contents of the specified address is within range.
- If this occurs YOU MUST ISSUE THE COMMAND "* RES EMUL" which
- reloads the 8051 overlay code.
-
- note 2. When you look back in the trace buffer after a break has occured
- after using the GI command you will see the instruction:
-
- JBC .IE+7(EA),addr
-
- or
-
- if you use the TDF command a number of frames starting with the
- following data:
-
- 10 AF 01 00
-
- This is because the trace will always sample the first instruction
- in the breakpoint handling routine (which is JBC .EA, addr) before
- it turns off. This is normally taken care of in software so you will
- not see it. In this case we decided to let it show for a number of
- reasons: You get an indication where "check breaks" were taken. It
- is also difficult to remove part of the trace without inadvertently
- removing "valid" trace frames.
-
- For the "bondout pods" the above would be something like:
-
-
- POD-C51B, POD-C552B, POD-C652B:
-
- NOP 00, 00, F5, 9F in TDF
- MOV 9F,A
-
- POD-C517, POD-515:
-
- NOP 00, 00, F5, FF in TDF
- MOV FF,A
-
- POD-C751:
- NOP 00, 00, 10, DC, 01 in TDF
- JBC .TIRUN,01
-
-
-
- Examples:
-
- BIC 30 40 50 0 200 DB ;prepare breakpoints for all instructions
- between adress 0 and 200H which may
- change the content of adress 30H. Break when
- contents of 30H is between (and including) 40H
- and 50H.
-
- BIC .TJ F0 20 0 200 DB ;as previous example. ".TJ" must be previously
- defined via DEF or via symbol table.
- Range is now F0, F1...FF, 00, 01...20
-
- BIC .SP 23 23 0 200 RB ;Break when SP (stackpointer 81H) becomes 23H if
- between addresses 0 and 200H
-
-
-
- @@BR
-
- BREAKPOINT REGISTER commands
-
- format:
- BRx x is 0 to 9.
- BRx = address
- address1 TO address2
- address LENGTH number
- wild card expression
-
- Breakpoints are activated in the GR (Go Register), or directly
- within the GO command. Breakpoints can also be set up directly
- within the GO command. (See GR and GO).
-
- Examples:
-
- BR ;displays all 10 breakpoint registers.
-
- BR0 ;displays breakpoint register 0.
-
- BR9 ;displays breakpoint register 9.
-
- BR2 = 124A TO 125F ;sets breakpoint register 2 to addresses
- between 124AH and 125FH
-
- BR6 = 96E L 10 ;sets breakpoint register 6 to addresses
- starting at 96EH and 16 addresses ahead
- to 97EH.
-
- BR1 = XXX ;X means don't care. In this case all
- addresses with the first 4 bits = 0000.
-
- BR1 = XXXY ;Y denotes binary. In this case all
- addresses starting with 0000 0000 0000 0
-
- BR1 = 0101XXX010XXY ;Any combination is allowed.
-
-
- @@BRS
-
- BREAKPOINT REGISTERS FOR "SLOW" BREAKPOINTS.
-
- format:
- BRS
- BRSx x = 0 - 9
- BRSx = <partition> <type> [address]
-
- Displays or sets BRSx registers. These breakpoints are "software
- breakpoints" so they only work when you use the GS (Go Slow)
- command.
-
- <partition> is any range or wildcards, normally used only for
- addresses. Here they stand for "memory contents"
- unless <type> is ADDR.
-
- <type> specifies one of the following memory types or its
- abbreviations: CBYTE, DBYTE, PBYTE, RBYTE, XBYTE or
- ADDR.
-
- [address] A unique address for which the "content" should be
- tested for a match with <partition>. The address has
- no meaning when <type> is ADDR, in which case
- <partition> gives the address or range of addresses.
-
- Examples:
- BRS ;displays all BRS registers.
- BRS0 ;displays the BRS0 register.
- BRS1 = 10 TO 20 DB 30 ;sets BRS1 to break when the contents of
- internal databyte at address 30H becomes
- a value between 10H and 20H.
-
-
- @@BRM
-
- BREAKPOINT MODE REGISTER commands
-
- format:
- BRM
- BRM = [OP] [WR] [RD] (any combination)
-
-
- The breakpoint mode register triggers breakpoints on OP
- (opcode addresses), WR (external write addresses), RD (external
- read addresses) or any combination of these addresses.
-
- Examples:
-
- BRM ;displays current status of BRM
-
- BRM = RD ;breaks only on external read addresses
-
- BRM = WR ;breaks only on external write addresses
-
- BRM = OP ;breaks only on opcode addresses.
- (default).
-
- BRM = RD WR ;breaks on external read or write
- addresses
-
- BRM = OP RD WR ;breaks on opcode, external read, or
- external write.
-
-
- @@BUF
-
- BUFFERSIZE command
-
- abbreviation: BUF
-
- Displays the size of the trace buffer, the location of the first
- frame, and the location of the last frame. Display will not work
- when the trace is running.
-
- Example:
-
- BUF
- Stored frames: 9014
- First frame: -2045
- Last frame: -6969
-
-
- @@BYB
- Break on direct write to Byte address
-
- format:
- BYB <byte address>
-
- <byte address> is between 0 and FFH. This command will go through
- the entire code memory and look for the following instructions:
-
- ANL dir,A
- ANL dir,#data
- DEC dir
- DJNZ dir,rel
- INC dir
- MOV dir,A
- MOV dir,R0
- MOV dir,R1
- MOV dir,R2
- MOV dir,R3
- MOV dir,R4
- MOV dir,R5
- MOV dir,R6
- MOV dir,R7
- MOV dir, dir
- MOV dir,*R0 * means "at"
- MOV dir,*R1 * means "at"
- MOV dir,#data
- ORL dir,A
- ORL dir,#data
- XCH A,dir
- XRL dir,A
- XRL dir,#data
-
- When any of them is found a corresponding breakpoint is activated
- in the breakpoint RAM. Then when the GB command is used these
- breakpoints will break the program when a byte is written to the
- specified byte address. NOTE: only DIRECT byte writes. You can
- combine with the BB or IB commands. (See the BRK paragraph).
-
- Examples:
- BYB 4 ;set up breakpoints on bit writes to bit
- address 4
- BYB .IE ;set up breakpoints on byte writes to the
- IE register).
-
-
- @@CAL
- The CALC Command
-
- format:
- CALC <start address> TO <stop address>
-
- CALC calculates a 16 bit checksum by adding all bytes in code
- memory between and including <start address> and <stop address>.
- On a regular PC a calculation of 64K bytes takes approx. 1.5 min.
-
- Example:
-
- CALC 0 TO 1FFF ;calculates checksum of all bytes
- between 0 and 1FFF
-
-
- @@CB
-
- MEMORY CONTENTS commands
-
- The following types of memory space can be displayed or
- changed via EMUL51-PC:
-
- Type of memory Command Range
- _______________________________________________________________
- On-chip data memory: DB, DBY, DBYT, DBYTE. 0 - 7FH
- Register memory: RB, RBY, RBYT, RBYTE. 80H - FFH
- Bit addressable memory: RBI, RBIT. 0 - FFH
- External data memory: XB, XBY, XBYT, XBYTE. 0 - FFFFH
- (with read back check)
- External data memory: PB, PBY, PBYT, PBYTE. 0 - FFFFH
- (without read back check)
- Code memory: CB, CBY, CBYT, CBYTE. 0 - FFFFH
-
- Examples:
-
- You can use memory contents commands in many ways. The
- following are examples for each possibility. CB in the examples
- can be substituted with any of the above commands. The numbers
- can be substituted with any number within the valid range shown
- above. Symbols defined in the internal or external symbol table
- may also be used.
-
- 1. CB 23 Displays data byte on address 23.
-
- 2. CB 23 TO 35 Displays data bytes on addresses 23
- through 35.
-
- 3. CB 23 L 10 Displays data bytes on address 23 +
- another 10 bytes. L means length and
- can also be expressed as LEN or
- LENGTH.
-
- 4. CB 23 = 10 Changes the contents of address 23
- to 10.
-
- 5. CB 23 = 10,14,15 Same as 4. but the contents of the
- addresses following the first
- address are also changed to the data
- separated by commas.
-
- 6. CB 23 TO 70 = 12 All addresses from 23 through 70
- are filled with 12.
-
- 7. CB 23 L 10 = 12 Addresses from 23 + another 10
- addresses are filled with 12.
-
- 8. CB 23 TO 45 = 12,13,14 Addresses from 23 through 45 are
- filled with a repeating pattern of
- 12,13,14
-
- 9. CB 23 L 10 = 12,34,56 As 8.
-
- 10. CB 100 = XB 400 TO 40F Specifies addresses from other
- memory areas on the right side of =.
-
- 11. Examples #9 and #10 can be combined in a number of ways:
-
- CB .LOOP L 100 = 12,34,'ABC',XBYT 1000 TO 1010
-
- 'ABC' will be evaluated as three bytes with the ASCII equivalents
- of A, B and C. (41H, 42H, 43H).
-
-
- @@CLB
- CLear Breakpoint RAM.
-
- format:
- CLB
-
- CLB clears the breakpoint RAM. The following commands can be used
- to set patterns of breakpoints to the breakpoint RAM: BB, BYB,
- BIC, and IB. These instructions will overlay patterns in the
- RAM without destroying earlier patterns. The GO command will also
- clear the breakpoint RAM before putting in active breakpoints as
- defined by the BR registers. After the GO command these
- breakpoints are still active and can thus be combined with more
- patterns created with the above mentioned commands. The CLB
- command will clear the breakpoint RAM.
-
-
- @@COU
-
- COUNT command
-
- abbreviation: COU
-
- format:
-
- COUNT decimal-expression<cr>
-
- [command<cr>]
- [WHILE boolean-expression<cr>]
- [UNTIL boolean-expression<cr>]
-
- ENDCOUNT
-
- COUNT;
- Begins a block of commands to be executed a specific number
- of times.
-
- DECIMAL EXPRESSION;
- A decimal number or an expression in which the default radix
- is decimal.
-
- <cr>;
- An intermediate carriage return. In a block command such as
- Count, all carriage returns are intermediate (terminating the
- input line but not terminating the command entry) until the
- ENDCOUNT keyword is entered.
-
- WHILE, UNTIL (see these keywords)
-
- BOOLEAN EXPRESSION;
- Least significant bit in an expression. Condition is TRUE if
- the least significant bit is 1, otherwise it is FALSE.
-
- ENDCOUNT;
- Terminates the block of commands.
-
- To end a COUNT command before the full number of loops are done
- just press the ESC key. It may take a couple of loops before the
- break occurs.
-
-
- @@DAS
-
- THE DISASSEMBLER
-
- abbreviation: D
-
- format:
-
- DASM
- DASM partition
-
- Disassembles the contents of user program memory into
- assembler mnemonic and operands.
-
- If DASM without partition is used, 10H bytes starting from the
- address currently pointed to by the disassembly pointer are
- disassembled. The disassembly pointer will be automatically
- incremented so that if you issue the D command again disassembly
- will continue from where the previous disassembly command ended.
- The D command with a partition and the DP command will
- automatically change the disassembly pointer, so that it is
- available for the next D command.
-
- PARTITION;
- A single address, or a range of addresses expressed as
- address TO address, or address LENGTH address. An instruction is
- displayed if its first byte is within the partition, even if
- subsequent bytes are outside.
-
- Examples:
-
- D .LOOP ;disassembles one instruction starting
- on the label .LOOP
-
- D 100 TO 200 ;disassembles from 100 and 200
- addresses
-
- D .START L 20 ;disassembles from .START and 20H
- addresses
-
- D .#120 L 10 ;disassemble from PL/M line 120. (Domain
- must be set. See Domain command.)
-
- D ;disassembles 10H bytes starting from the
- disassembly pointer.
-
-
- @@DP
-
- Disassemble from PC
-
- format:
- DP
-
- Disassembles 16 bytes starting from where PC (Program Counter)
- points. This command will change the disassembly pointer (see the
- DASM paragraph).
-
-
- @@DEF
-
- DEFINE MACRO. DEFINE SYMBOL.
-
- DEFINE MACRO
-
- abbreviation: DEF
-
- format:
-
- DEFINE :macroname<cr>
-
- [command<cr>] ....
-
- EM
-
- DEFINE;
- Enters user defined macro name and block of commands into
- the macro definition table.
-
- :macroname;
- Name of the macroblock preceded by a colon.
-
- <cr>;
- Carriage Return
-
- COMMAND;
- Any emulator command except DEFINE macro or REMOVE macro.
- Calls to other macros are allowed, but a macro can not call
- itself. Formal parameters (%0 through %9) are substituted with
- text at macro invocation.
-
- EM;
- Terminates the macro definition.
-
- Examples:
-
- *DEF :G
- .*GO FROM .START TILL .END
- .*R
- .*EM
- *
-
- DEFINE SYMBOL
-
- format:
- DEFINE [..module-name].symbol-name = expression [type]
-
- DEFINE;
- Enters user defined symbol and corresponding numeric value
- into the user symbol table.
-
- ..module-name;
- The name of an existing module to contain the symbol being
- defined. If no module name is specified, the symbol is placed in
- the unnamed module. Unnamed modules occurs before named modules
- in the symbols table.
-
- .symbol-name;
- The name of the symbol preceded by a period.
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed.
-
- type;
- CODE, XDATA, DATA, IDATA, BIT, NUMB, LINE, UNDEF
-
-
- Examples:
-
- * DEFINE .MOTOR = 210T ;add new symbol to unnamed
- module.
- * DEF .FLAG = 34 BIT ;new symbol gets BIT type.
-
-
- @@DIR
-
- DIR command
-
- format:
-
- DIR
-
- DIR;
- Displays a directory of the names of all macros. In the
- macro definition table, the names are listed in the order that
- they were entered.
-
-
- @@DIS
-
- DISABLE command
-
- abbreviation: DIS
-
- format:
-
- DISABLE [CASE]
- [CODE]
- [EXPANSION]
- [GLOBAL]
- [HELP]
- [LABEL]
- [LSYMB]
- [NSYMB]
- [NUMB]
- [PLUS]
- [REG]
- [SOURCE]
- [SYMBOLIC]
- [SYNTAX]
- [WATCH]
- [WINDOW]
- [XDATA]
-
- DISABLE;
- Cancels the effect of its object on the EMUL51-PC.
-
- CASE;
- By default the characters in symbols are not case sensitive.
- ENA CASE will make them case sensitive while DIS CASE
- makes them non-sensitive.
-
- CODE;
- Disables the CODE window if it was active. By default it
- is not enabled.
-
- EXPANSION;
- When disabled, macro expansion is not displayed. When
- enabled, the macro expansion is displayed on the console before
- execution. Disabled by default.
-
- GLOBAL;
- When enabled ALL symbols will be searched. If disabled ONLY the
- current module will be searched. Disabling GLOBAL will speed up
- disassembly, trace disassembly and CODE WINDOW update. Disabled
- by default.
-
- HELP;
- When enabled the small HELP window at the lower right of the
- screen is visible. Can also be toggled on and off with Alt+F10.
- Enabled by default.
-
- LABEL;
- By default labels are automatically shown during disassembly.
- DIS LABEL supresses labels in disassembly listings.
-
- LSYMB;
- When disabled, no symbols are shown when listings generated
- by DBYTE, CBYTE, XBYTE, PBYTE, RBYTE, or RBIT are used. Disabled
- is default.
-
- NSYMB;
- When enabled, symbols typed as NUMB will be used in place of
- all other types. Useful only with Archimedes / IAR C-51, if you
- have used the XOBJ program to generate an OBJ file. Disabled by
- default.
-
- NUMB;
- When enabled the symbol table will search through all variables
- defined as "NUMB". Normally "EQU's". Disabling NUMB may
- significantly speed up disassembly, trace disassembly and
- CODE WINDOW update. Enabled by default.
-
- PLUS;
- See ENABLE command.
-
- REG;
- Disables the REGS window.
-
- SOURCE;
- Enables the Source only in the CODE window.
-
- SYMBOLIC;
- When disabled, addresses are displayed in hexadecimal radix.
- When enabled, addresses are displayed in symbolic format.
- Symbols are initially enabled.
-
- SYNTAX;
- When enabled context sensitive help line will be seen at the
- bottom of the screen when typing new commands. Enabled by default.
-
- WATCH;
- Disables the WATCH window if it was active. It is disabled by
- default.
-
- WINDOW;
- When enabled the static windows reflecting different memory
- locations are shown. Enabled by default.
-
- XDATA;
- Disables the EXTERNAL DATA window. When the EXTERNAL DATA window
- is on READ signals (/RD) will be emitted from the chip to either
- the target or emulator depending on how the mapping is set.
- That may create a problem in the target. By using DIS XDATA
- no /RD signals are emitted and the EXTERNAL DATA window will not
- be seen.
-
- Examples:
-
- DISABLE SYMBOLIC
- DIS EXPANSION
- DIS LSY
- DIS NSY
- DIS WI
- DIS H
- DIS SYN
- DIS NUMB
- DIS GLO
- DIS SO
- DIS PLUS
- DIS XDATA
-
- @@DOM
-
- DOMAIN command
-
- abbreviation: DOM
-
- format:
-
- DOMAIN [..module-name]
-
- DOMAIN;
- Displays or sets the default module-name. The default is
- used for all line number references not specified with a
- modulename. Symbol references are not affected by this command.
-
- ..module-name;
- An existing module-name that becomes the default module for
- referencing line numbers.
-
- Example:
-
- DOMAIN ..ETON1
-
-
- @@DPT
-
- DPTR command
-
- abbreviation: DPT
-
- format:
-
- DPTR = [expression]
- TM0 = [expression]
- TM1 = [expression]
-
- DPTR;
- Displays or sets the 16-bit data pointer register.
-
- TM0, TM1;
- Displays or sets the 16-bit value of Timer 0 or Timer 1.
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed; 16 bits are assumed.
-
- For DPTR the low 8 bits are stored in DPL (address 82H in
- Register memory). The high 8 bits are stored in DPH (address 83H
- in Register memory).
-
- For TM0 the low 8 bits are stored in TL0 (address 8AH in
- Register memory). The high 8 bits are stored in TH0 (address 8CH
- in Register memory).
-
- For TM1 the low 8 bits are stored in TL1 (address 8BH in
- Register memory). The high 8 bits are stored in TH1 (address 8DH
- in Register memory).
-
- Examples:
-
- DPTR ;display data pointer
- DPTR = .TABLE ;sets to 16-bit value.
- TM0 ;displays TM0
- TM1 = 1A5D ;sets TM1 to 1A5DH
-
-
-
- @@ENA
- ENABLE command
-
- abbreviation: ENA
-
- format:
-
- ENABLE [CASE]
- [CODE]
- [EXPANSION]
- [GLOBAL]
- [HELP]
- [LABEL]
- [LSYMB]
- [NSYMB]
- [NUMB]
- [PLUS]
- [REG]
- [SOURCE]
- [SYMBOLIC]
- [SYNTAX]
- [WATCH]
- [WINDOW]
- [XDATA]
-
- ENABLE;
- Causes its object to affect the EMUL51-PC.
-
- CASE;
- By default the characters in symbols are not case sensitive.
- ENA CASE will make them case sensitive.
-
- CODE;
- Enables the CODE window. By default it is not enabled.
-
- EXPANSION;
- When enabled, the macro expansion is displayed on the
- console before execution.
-
- GLOBAL;
- When enabled ALL symbols will be searched. If disabled ONLY the
- current module will be searched. Disabling GLOBAL will speed up
- disassembly, trace disassembly and CODE WINDOW update. Disabled
- by default.
-
- HELP;
- When enabled the small HELP window at the lower right of the screen
- is visible. Can also be toggled on and off with Alt+F10.
-
- LABEL;
- By default labels are automatically shown during disassembly.
- DIS LABEL supresses labels in disassembly listings. ENA LABEL
- makes labels appear.
-
- LSYMB;
- When enabled, appropriate symbols will interleave listings
- generated with CBYTE, DBYTE, XBYTE, PBYTE, RBYTE, or RBIT
- commands. Default is disabled.
-
- NSYMB;
- When enabled, symbols typed as NUMB will be used in place of
- all other types. Useful only with Archimedes / IAR C-51, if you
- have used the XOBJ program to generate an OBJ file.
-
- NUMB;
- When enabled the symbol table will search through all variables
- defined as "NUMB". Normally "EQU's". Disabling NUMB may
- significantly speed up disassembly, trace disassembly and
- CODE WINDOW update. Enabled by default.
-
- PLUS;
- Enables the disassembler to display numbers as symbols followed by
- " + hex number " if a number not exactly matching a symbol was found.
- Default is disabled. For example MOV DPTR, #4005 could be
- MOV DPTR, #LOOP+5 if PLUS was enabled.
-
- REG;
- Enables the REGS window.
-
- SOURCE;
- Enables the Source only in the CODE window.
-
- SYMBOLIC;
- When enabled, it causes display of addresses in symbolic
- format. Symbols are initially enabled.
-
- SYNTAX;
- When enabled context sensitive help line will be seen at the
- bottom of the screen when typing new commands.
-
- WATCH;
- Enables the WATCH window. It is disabled by default.
-
- WINDOW;
- When enabled the static windows reflecting different memory
- locations is shown.
-
- XDATA;
- Enables the EXTERNAL DATA window. Normally the XDATA WINDOW is on
- by default except when "bondout" pods or some of the "hooks pods"
- are used. When the EXTERNAL DATA window is on READ signals (/RD)
- will be emitted from the chip to either the target or emulator
- depending on how the mapping is set. That may create a problem in
- the target. By using DIS XDATA no /RD signals are emitted and
- the EXTERNAL DATA window will not be seen.
-
- Examples:
-
- ENABLE SYMBOLIC
- EN SYM
- EN EXP
- EN LSY
- EN WI
- EN H
- EN SYN
- EN NUMB
- EN GLO
- EN REG
- EN SO
- EN PLUS
- EN XDATA
-
- @@END
- END command.
-
- The END command is used to end a REPEAT or COUNT loop. Please
- see these commands for further information.
-
-
- @@EVA
-
- EVALUATE command
-
- abbreviation: E, EVA, EVAL
-
- format:
-
- EVALUATE expression
-
- EVALUATE;
- Performs the specified mathematical operations to convert
- the expression to a 16-bit numeric result. The result is
- displayed in binary, octal, decimal, and hexadecimal, as a pair
- of ASCII characters (if value is between 20H and 7EH), and as an
- address. The address displayed is the name of the user symbol or
- a line number.
-
- EXPRESSION;
- A number, reference, or a formula that can be equated to a
- numeric result.
-
- Examples:
-
- EVAL 100Q + 13T
-
- E CBYTE .VAL + 100
-
- @@EVENT
-
- EVENT Specify a simulation event.
-
- abbreviation EVE
-
- format:
-
- EVENT {R,W,*} <addr[range]> {CB,XB,DB,RBY,RBI,PC} [lo hi value]] [:mac]
-
- description:
-
- This command specifies events to be intercepted. The
- default action is 'break'. However, the user can attach a MACRO
- that will be executed automatically without stopping.
-
- { R,W,*} Read/Write access or both
- <addr[range]> address
- address LEN count
- address TO address
-
- {CB,XB,DB,RBY,RBI,PC} memory type or program counter
-
- [lo [hi value]] optional contents of address is included in the
- event specification. A single value or a range.
-
- [:mac] an optional macro
- It will be called with 3 operands:
-
-
- :MACRONAME ADDRESS COUNT CYCLES
-
- where ADDRESS is the trapped address,
- COUNT is an individual event count,
- CYCLES is a machine cycle counter, all modulo 64K.
-
- Note: events are only sensitive to instruction
- execution, NOT to memory accesses from
- the command line (to avoid the risk of infinite nesting).
- However, macros can install or remove events!
-
- EVENT
- without arguments will list the installed
- events, showing their ID numbers and counts.
-
- see also REMOVE EVENT number
- REMOVE EVENTS
- RESET EVENTCOUNT number
- RESET EVENTCOUNTS
-
- examples EVENT W .p0 RBY :setP0
- EVENT * 8000 TO FFFF PC
- EVENT R 0 TO FFFF XB
-
-
- MACDELAY Execution of a macro after a time delay.
-
- abbreviation MACD
-
- format MACDELAY count [msec | sec] :macro [operand ..]
-
- Description:
-
- This command is intended to be combined with a
- macro in order to implement time delays. The specified
- macro will be executed after the specified time or cycles
-
-
- Arguments:
-
- count [msec | sec]
-
- Time delay.
- The default time unit is 'machine cycles',
- but can be altered to milliseconds or
- seconds.
-
- :macro [operand ..]
-
- The macro to be scheduled for
- later execution. The optional
- arguments are frozen at the time
- of the 'MACDELAY' command.
-
- examples
- MACDELAY 100 msec :startmotor
-
-
- define :event_P1
- macdelay 850 :printer_ready %0 %1 %2 ; inherit operands
- em
-
- @@EXI
-
- EXIT and QUIT Commands.
-
- abbreviation: EX QUI
-
- format:
- EXIT
- QUIT
-
- EXIT;
- Terminates EMUL51-PC and returns to DOS.
-
- QUIT;
- Returns to DOS without terminating the emulator if it was running.
-
-
- @@FIL
-
- The FILL command.
-
- abbreviation: F
-
- format:
- FILL <range> <value> <type>
-
- FILL writes a specified value to a range of addresses of a
- specified type. You can do the same using CB, DB, XB etc. but the
- FILL command is much faster.
-
- Examples:
- F 0 TO FFFF 55 XB ;writes 55H to the external memory.
- F 30 L 20 0 DB ;clears internal data memory from
- address 30H and the following 20H
- bytes.
-
- @@FORM
-
- FORMAT Commands (In support of C-Compilers)
-
- abbreviations: DI, DU, DF, DS, XI, XU, XF, XS, CI, CU, CF, CS
-
- format:
- DINT address [range]
- DUINT address [range]
- DFLOAT address [range]
- DSTRING address [range]
-
- XINT address [range]
- XUINT address [range]
- XFLOAT address [range]
- XSTRING address [range]
-
- CINT address [range]
- CUINT address [range]
- CFLOAT address [range]
- CSTRING address [range]
-
- [range] is either of the form
- [<address> TO <address>] or
- [<address L <number>]
-
- x in the explanations below is either D, X, or C
-
- xINT will display the contents of <address> and <address+1> as a
- signed integer. If a range is specified, signed integers will be
- displayed until the range is exhausted.
-
- xUINT will display the contents of <address> and <address+1> as an
- unsigned integer. If a range is specified, unsigned integers will be
- displayed until the range is exhausted.
-
- xFLOAT will display the contents of <address>, <address+1>,
- <address+2> and <address+3> as a float. If a range is specified,
- floats will be displayed until the range is exhausted. NAN and -NAN
- (Non Applicable Number) means that the four bytes could not be
- translated to a float.
-
- xSTRING will display the contents of <address> as an ASCII character
- or a ".", if the byte was not translatable as a printable ASCII
- number. If a range is specified, ASCII characters will be
- displayed until the range is exhausted or a 0 is encountered. If
- no range is specified ASCII characters will be displayed till
- a 0 is encountered or maximum 16 characters have been printed.
- The ASCII string will be surrounded by quotes ("). The ending
- quote will only be seen if the ending 0 was found within the
- range (or 16 bytes if no range was specified).
-
- Examples:
-
- CI 0 ;Display CODE memory address 0 and address 1
- ;as a signed integer
- DI 30 L 10 ;Display DATA memory from address 30H to address
- ;40H as signed integers
- XU 3000 TO 3020 ;Display XDATA memory from address 3000H to
- ;address 3020H as unsigned integers
- XF 4000 L 40 ;Display XDATA memory from address 4000H to
- ;address 4040H as floats
- DS 0 ;Display DATA memory adress 0 as an ASCII
- ;character. Up to 16 ASCII characters will
- ;be displayed unless a 0 is encountered
- XS 1000 L 100 ;Display XDATA memory starting from address 1000H
- ;as ASCII characters. Display will stop if a 0 is
- ;encountered or when the range is exhausted
-
-
- @@GB
-
- The Go until Break command.
-
- format:
- GB [FROM <address>]
-
- Starts execution without first erasing the breakpoint RAM. Useful
- after breakpoint RAM has been initiated by BB, BYB, IB, SLM or/and
- BIC.
-
-
-
- @@GI
- GI. Go till Internal contents match.
-
- format:
- GI [SY0]
- GI [FROM addr] [SY0]
-
- Description:
-
- Used together with the BIC command which presets breakpoints for the desired
- address, and also specifies which range of contents to break on. (See BIC
- for all details).
-
- note 1. If, when you use GI, a breakpoint is not reached and you use ESC to
- manually break, you will get WRITE TIMEOUT and READ TIMEOUT errors.
- This is because the code which is handling breakpoints is modified
- to check if the contents of the specified address is within range.
- If this occurs YOU MUST ISSUE THE COMMAND "* RES EMUL" which reloads
- the 8051 overlay code.
-
- note 2. When you look back in the trace buffer after a break has occured
- after using the GI command you will see the instruction:
-
- JBC .IE+7(EA),addr
-
- or
-
- if you use the TDF command a number of frames starting with the
- following data:
-
- 10 AF 01 00
-
- This is because the trace will always sample the first instruction
- in the breakpoint handling routine (which is JBC .EA, addr) before
- it turns off. This is normally taken care of in software so you will
- not see it. In this case we decided to let it show for a number of
- reasons: You get an indication where "check breaks" were taken. It
- is also difficult to remove part of the trace without inadvertently
- removing "valid" trace frames.
-
- THIS COMMAND SHOULD ONLY BE USED AFTER "BIC" HAS FIRST SET UP BREAKPOINTS
- AND SPECIFIED ADDRESS AND RANGE OF CONTENTS!
-
- Examples:
-
- GI ;Go from present PC (Program Counter)
-
- GI SY0 ;As example above but qualified with SY0
-
- GI FROM 0 ;Go from address 0
-
- GI F 100 ;Go from address 100H
-
- GI F 100 SY0 ;As example above but qualified with SY0
-
-
-
- @@GO
-
- GO command
-
- format:
- GO [FROM address] [FOREVER]
- [TILL SY0]
- [TILL BR0]
- [TILL BR0 WITH SY0]
- [TILL BR0 OR SY0]
- [TILL BR1]
- [TILL BR1 WITH SY0]
- [TILL BR1 OR SY0]
- [TILL BR]
- [TILL BR WITH SY0]
- [TILL BR OR SY0]
- [TILL address [OR address]
- [TILL address [OR address] WITH SY0]
- [TILL address [OR address] OR SY0]
-
- GO;
- Begins real time emulation.
-
- FROM;
- Specifies the start address for emulation. FROM changes the
- program counter before the start of emulation. It also resets the
- emulation timer (cycle counter). If the FROM is omitted the
- current PC is used.
-
- FOREVER;
- Disables all breakpoints except the ESC key and TBR = ON.
-
- TILL SY0;
- Halts emulation when the external signal SY0 goes low (or
- high, depending on the SY0A register).
-
- TILL BR0;
- TILL BR1;
- TILL BR;
- Halts real time emulation when an address matches BR0, BR1
- or BR (BR0 or BR1).
-
- Breakpoint registers BR2 - BR9 may also be set up to break
- emulation. They can not be set up in the GO command. They must be
- set up separately with the BR command.
-
- WITH SY0;
- Halts emulation when a breakpoint condition and SY0 are
- simultaneously true. (SY0 true can be high or low depending on
- the SY0A register).
-
- OR SY0;
- Halts emulation when either a breakpoint condition is true
- or SY0 is true (high or low depending on the SY0A register).
-
- Examples:
-
- G ;starts emulation at present PC value.
- All breakpoint factors remain unchanged
-
- G F .START ;starts emulation at .START. All
- breakpoints factors remain unchanged.
-
- G F .START T .LOOP ;starts emulation at .START. BR0 is set
- to .LOOP. Other breakpoints remain
- unchanged.
-
- G F .START T .LOOP OR .STOP ;starts emulation at .START. BR0 is
- set to .LOOP and BR1 is set to .STOP.
- Other breakpoints remain unchanged.
-
- G F .START TILL BR ;starts emulation at .START and will end
- when BR0 or BR1 is encountered. (Or any
- of BR2 - BR9 if they are active).
-
- G F 0 T BR W SY0 ;SY0 is part of the break condition.
-
- G F 0 T BR0 OR SY0 ;BR0 or SY0 true breaks emulation.
-
- G T SY0 ;SY0 true breaks emulation.
-
-
-
- @@GR
-
- GO REGISTER command
-
- format:
- GR
-
- GR = [FOREVER]
- [TILL SY0]
- [TILL BR0]
- [TILL BR0 WITH SY0]
- [TILL BR0 OR SY0]
- [TILL BR1]
- [TILL BR1 WITH SY0]
- [TILL BR1 OR SY0]
- [TILL BR]
- [TILL BR WITH SY0]
- [TILL BR OR SY0]
- [TILL address [OR address]
- [TILL address [OR address] WITH SY0]
- [TILL address [OR address] OR SY0]
-
- GR;
- Displays or sets halt conditions for real time emulation
- without starting emulation.
-
- See GO for other details.
-
-
- @@GS
- Go Slow Command
-
- format:
- GS [FROM <address>]
-
- This command will make the emulator single step (without showing
- anything on the screen). Between each step the BRS conditions
- will be checked for matches. When a match occurs single stepping
- will break and registers will be shown on the screen. This break
- check is edge sensitive, which means that it will NOT break
- continuously on a constant match of memory contents. Only
- if a match first fails will it break on the next match.
-
- Example:
- GS ;Go Slow from current PC address
- GS F 10A8 ;Go Slow from 10A8H
-
-
- @@HEAP
-
- HEAP command
-
- abbreviation: HEA
-
- format:
- HEAP
- HEAP = [STD] [EXT] [EMS] [DISK]
-
- The HEAP command is used to "expand the heap" to memory located
- outside the standard 640K of the PC. This is useful if you have
- a very large symbol table that does not fit in the standard memory.
- The symbol table will be loaded to the specified memory location
- instead of to the standard memory. Up to 64K of the standard memory
- will be allocated in some cases to handle the "outside memory".
- Use the MEM command to see how much memory is left after the
- emulator software has been loaded, after your file has been loaded
- etc.
-
- STD = standard memory (640K)
- EXT = extended memory
- EMS = expanded memory (LIM)
- DISK = file in current directory
-
- The HEAP command can only be used once and only BEFORE any file
- has been loaded into the EMUL51. Observe that symbol handling
- when doing disassembly and updating the CODE window will be
- much slower when this option is used. It is possible to disable
- searching for specific symbols to speed up the search:
-
- DIS LABEL disables search for CODE symbols.
- DIS SYMBOL disables search all symbols.
- ENA LABEL enables search for LABELS only.
-
- Examples:
-
- HEA ;display which "HEAP" memory is being used
- HEA = DISK ;use a diskfile to store symbols
- HEA = EXT ;use extended memory to store symbols
- HEA = EMS ;use expanded memory to store symbols
-
-
- @@HELP
- The HELP command.
-
- This command takes you back up to the top menu and "pulls down"
- the HELP menu. Choose any item and press RETURN.
-
-
- @@IB
- Internal Break on pattern.
-
- format:
- IB <byte1>, <byte2 or x>, <byte3 or x>
-
- <byte1> should normally be an instruction code.
- "x" means don't care
-
- This command will look for the specified pattern throughout the entire
- code memory and progam a breakpoint whereever a match is found. Breakpoints
- will only be executed if the corresponding address is executed as the first
- byte in the instruction. (The emulator generated Valid Fetch signal takes
- care of this). Please also see the "CLB", "BB", and "BYB" commands. More
- details are also available in the "BRK" paragraph. (Help via F1 from
- "top menu line").
-
-
- @@IF
-
- IF command
-
- format:
-
- IF boolean-expression [THEN] <cr>
- [command <cr>]
- [ORIF boolean-expression <cr>]
- [command <cr>]
- [ELSE <cr>]
- [command <cr>]
-
- IF;
- Begins a block of commands to be executed when the IF
- condition is TRUE.
-
- BOOLEAN EXPRESSION;
- Any of the forms of expression. When the boolean expression
- after IF or ORIF is TRUE, the commands in that block are executed
- to the exclusion of all other blocks in that IF command
-
- THEN;
- Optional addition to the IF command.
-
- <cr>;
- Intermediate carriage return. Ends each input line of the IF
- command. It does not terminate the entry of the command.
-
- COMMAND;
- Any EMUL51-PC command except DEFINE Macro and REMOVE Macro.
-
- ORIF;
- Introduces a secondary block of commands. When the condition
- after the IF is FALSE, the first ORIF condition found to be TRUE
- executes the ORIF block to the exclusion of all other command
- blocks.
-
- ELSE;
- Introduces a block of commands to be executed when no IF or
- ORIF condition is TRUE.
-
- ENDIF;
- Terminates the entire IF command.
-
- Examples:
-
- *IF .VAL EQ 200H
- *.GO FROM .ST TILL .END
- *ORIF .VAL EQ 100H
- *.GO FORE
- *ELSE
- *.WRITE 'DONE'
- *ENDIF
-
-
- @@INC
-
- INCLUDE command
-
- abbreviation INC
-
- format:
- INCLUDE [drive] filename
-
- INCLUDE
- Reads a sequence of emulator commands from the specified
- drive and file.
- INCLUDE is used to load macro definitions from disk.
-
- Examples:
-
- INCLUDE GO.MAC ;load the macro GO.MAC from the
- default drive.
-
-
- @@INT
-
- INTERRUPT command
-
- abbreviation: INT
-
- format:
- INTERRUPT
-
- INTERRUPT;
-
- (Except Siemens 80535)
-
- Displays the Interrupt level 0 (IIP0), Interrupt level 1
- (IIP1), Interrupt Enable register (IE), and Interrupt Priority
- register (IP). IIP0 and IIP1 are displayed as YES or NO to
- indicate whether an interrupt on that level is active or not. To
- obtain information on the cause of interrupt, compare the program
- counter (PC) with the code listing. If an emulation session is
- started and the PC was changed since the last session without
- resetting all interrupts, a warning will be issued: "WARNING
- ACTIVE INTERRUPTS". To reset the interrupt in progress registers
- internal to the microprocessor, take one of the following
- actions:
-
- 1. A RETI is executed.
- 2. A RESET CHIP command is issued.
- 3. The Reset push button on the pod is pressed.
- 4. A reset from the target.
-
- Siemens 80535:
-
- Works essentially as above, but IEN0, IEN1, IP0, and IP1 are
- displayed. Four levels of Interrupt In Progress, indicated as YES
- or NO.
-
-
-
- @@LIN
- Linestep Command
-
- format:
- L [FROM <address>]
-
- This command goes through the symbol table and locates all symbols with
- the type LINE and sets a breakpoint on the corresponding addresses.
- Then the code will be executed until a breakpoint is encountered. ESC
- will also break execution. This is usable only when working with C51
- (Archimedes / IAR) and PL/M-51 (Intel). Using the GO or SN commands
- will erase all LINE number breakpoints, but the STEP command will not.
- The L command erases all previously activated breakpoints in the
- breakpoint RAM before it is executed.
-
-
-
- @@LC
-
- LOOP COUNTER command.
-
- format: LC
- LC = decimal value
-
- LOOP COUNTER;
- Displays or sets the Loop Counter. LC is used in some trace
- conditions. (See TR command).
-
- Examples:
- LC ;display the loop counter value.
- LC=2000 ;sets the loop counter to 2000 decimal.
-
-
- @@LIST
-
- LIST command
-
- format:
- LIST filename
- [STOP]
-
- LIST
- Outputs a copy of everything printed on the screen to the
- specified file. The word STOP instead of a file name will close
- the file. By choosing a new file name the old file will be closed
- and the new file will be opened.
-
- Examples:
- LIST LPT1 ;list on parallel printer
- LIST EMSESS.EMU ;save on file
- LIST A:EMUDATA.DAT ;save on file
- LIST STOP ;close existing file
-
-
- @@LOA
-
- LOAD command
-
- abbreviation: LOA
- Format:
-
- LOAD [d:] filename [NOCODE]
- [NOSYMBOLS]
- [RELMS]
- [?M <modulname>]
- [MOTO]
- LOAD;
- Loads the user program and symbol table from the specified
- drive and file name into code memory on the emulator. If the file
- contains a symbol table it will be loaded without a check for
- duplicate symbols. This means that multiple loads of the same
- file will result in multiple versions of the same user symbols.
- If the symbol table contains references to system symbols, they
- will not be loaded.
-
- NOCODE;
- suppress loading of the code from the file. It will load
- the symbol table if present.
-
- NOSYMBOLS;
- suppress loading of the symbol table from the file. It will
- load the code if present.
-
- RELMS
- Loads a RELMS obj file. (8080 object format).
-
- ?M <modulname>
- Loads symbols only from the specified module. May be used if
- you run out of memory with big symbol files. This command may
- be repeated any number of times for different modules to load
- only the modules currently needed for debugging. If you need
- to load many modules but not all, you should set up a macro
- for loading. This works only for INTEL OBJ (OMF) formats.
- (See example below).
-
- MOTO
- Used when loading Motorola "S1" files with extended "SA" symbol
- records
-
- The following file formats are supported:
-
- 1. INTEL HEX ;Only code
- 2. INTEL OBJ (OMF, AOMF) ;Code, modules, typed symbols
- 3. AVOCET SYM ;Code is same as Intel HEX. Separate
- symbol file, typed symbols
- 4. IAR SYMBOLIC ;Code and untyped symbols
- 5. HMI SYM ;Intel HEX. Separate symbol file.
- Untyped symbols.
- 6. INTEL SYM ;Can appear together with INTEL HEX
- 7. RELMS OBJ ;Equivalent with Intel's 8080 obj format
- Untyped symbols
- 8. AMERICAN AUTOMATION ;Separate symbol file, untyped symbols
- 9. 2500 AD ;Separate symbol file, untyped symbols.
- Microtek symbols supported.
- 10. MOTOROLA S1 ;Used by American Automation.
- 11. IAR UBROFF ;IAR/Archimedes format for source level
- debugging
- 12. KEIL EXTENDED ;Keil / Franklin OBJ EXTENDED format for
- source level debugging
- 13. COSMIC ;Intermetrics / Whitesmiths / Cosmic
- format for source level debugging
- 14. IEEE 695 ;BSO / Tasking source level debugging
-
- Examples:
-
- LOAD TEST.A03 ;load an Archimedes file
- LOA COUNT.OBJ NOCODE ;load only symbols from COUNT.OBJ
- LOA TME NOSYMBOLS ;load only code from TME
- LOA SDER.OBJ ?M VIR ;load code and symbols from SDER.OBJ, but
- symbols only from the module VIR
- DEF :LOAD ;macro to load symbols from three modules out
- LOA PLM.OBJ ?M MAIN of PLM.OBJ
- LOA PLM.OBJ ?M TINT
- LOA PLM.OBJ ?M FINISH
- EM
-
-
-
- @@LOB
-
- LOB command
-
- Format:
-
- LOB <[d:]filename> <start address in hex>
-
- LOB;
- Loads the user program given in raw binary form from the specified
- drive and file name into code memory on the emulator.
-
- Examples:
-
- LOB CHK.BIN 1000 ;Load the binary file CHK.BIN to the emulator
- code memory. Load to address 1000H and up.
-
-
- @@LOP
- LOad Ppa setup command
-
- Format:
- LOP <[d:]filename>
-
- Load PPA setup data previously saved using the SAP command.
-
- Example:
- LOP PPA.SAV ;Load data from PPA.SAV to PPA setup window.
-
-
- @@LOW
- LOAD WINDOW SETUP command
-
- format:
- LOW [d:] filename
-
- Loads a window setup file which was previously saved using the
- SAW command.
-
- Example:
-
- LOW WIN.SUP ;loads win.sup from current directory.
- LOW A:XDAT.SUP ;loads XDAT.SUP from the a: drive.
-
-
- @@MAC
- MACRO command
-
- abbreviation: MAC
-
- format:
- MACRO [:macroname]
-
- MACRO;
- Displays the definition of a macro defined by :macroname. If
- MACRO is used without a name specification, all macros will be
- displayed.
-
- :macroname;
- Must be defined previously.
-
- Examples:
-
- MACRO ;display all macros
- MAC :EXEC ;display the macro :EXEC
-
-
- @@MAP
-
- MAP commands
-
- format:
- MAPX
- MAPC
- MAPX = E [T] E [T] .....
- MAPC = E [T] E [T] .....
- MAPC = USER
- MAPX = USER
- MAPC = EMUL
- MAPX = EMUL
-
-
- MAPX, MAPC;
- Displays mapping of external memory (X) and code memory (C).
- The maps are set in 16 4K portions. Each 4K byte segment of
- memory may be mapped either to the emulator (E) (default) or to
- the target system (T). Start with the lowest 4K (0000H to 0FFFH)
- section and end with the highest 4k (F000H - FFFFH section).
- MAPC = USER maps all code memory to the target.
- MAPX = USER maps all external data memory to the target.
- MAPC = EMUL maps all code memory to the emulator.
- MAPX = EMUL maps all external data memory to the target.
-
- Examples:
-
- MAPX ;displays mapping of external
- memory
-
- MAPC = E E T T T T T T T T T T T T T T ;maps the first 8K of
- code memory to the
- emulator and the
- remaining 56K to the
- target system.
-
- MAPX = USER ;maps all xdata memory
- to the target.
-
- MAPC = EMUL ;maps all code memory
- to the emulator.
-
- @@MEM
- MEM command.
-
- Will report how much memory is available for symbols, SYSTEM, SHELL
- etc. If you seem to have too little memory left you may be able to
- use the HEAP command to take advantage of EXT or EMS memory. You may
- also be able to remove resident programs or reduce "buffers" in
- CONFIG.SYS.
-
-
- @@MOD
- MODULE command.
-
- This command shows the current module.
-
-
- @@NOHIT
- NOHIT command.
-
- format:
- NOHIT [0] [1]
-
- This command is used in connection with the SYSTEM command.
- NOHIT 1 will supress the "Hit any key to continue.."
- message when returning to the emulator after a SYSTEM command.
- NOHIT 0 will return to normal operation where you must
- press a key before returning to the emulator.
-
-
- @@NOS
-
- NOSNOW command.
-
- format:
- NOSNOW
-
- This command is used if you get "snow" on the screen when
- the static window is active. The window update will then be
- slightly slower because the output is only done when the video is
- "retracing". There is no command to go back to "snow".
-
- Example:
-
- NOSNOW ;prevents snow on screen
-
-
- @@OST
- Open (Close) Step Trace file Command.
-
- format:
- OST
- CST
-
- This command will open a file, "STEPTRAC.TRC" in the current
- directory where it will store trace data from each single step.
- Data from STEP will be stored in this file in a circular fashion.
- Maximum 1000 instructions will be stored in this file. Then the
- oldest frame will be overwritten. While this file is open the TDS
- and TDFS commands can be used to view the contents of the trace
- file. The CST command is used to close the file. After the CST
- command is used the file is lost and can not be viewed.
-
-
- @@PC
-
- PC command
-
- format:
- PC = [expression]
-
- PC;
- Displays or sets the 16-bit program counter.
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed.
-
- Examples:
- PC ;Display program counter
-
- PC = .BEGIN + 7 ;Set PC to new address
-
-
- @@PPA
-
- Program Performance Analysis command.
-
- format:
- PPA
-
- This command works only if you have the trace board.
-
- This command takes you into the PPA window where it is possible
- to monitor where the program spends its time. This is done by
- using the trace board to sample where the program is. The PPA
- program updates one counter for each programmed "bin". The result
- can then be displayed dynamically either in numbers and
- percentages or with bargraphs. The usage is self explanatory but
- here follows a short description of the commands:
-
- The commands are activated by typing the upper case letter
- associated with each command. You can also move the cursor to the
- desired command and then press the return key.
-
- Edit
-
- Takes you into the edit mode. Use the arrow keys to move to
- the desired positions to enable or disable any of the
- "bins" or ranges. Then program the "bin" itself by putting
- in either a single address or a range of addresses.
- Examples:
- 1000
- 320 TO 330
- 200 L 10
-
- Run/Hold
-
- If Run is visible and activated the program and the PPA
- will begin from where the PC is. If Hold is visible and
- activated the PPA will stop until Run is activated
- again. (The program will not stop however).
-
- _________________________________________________________________
- Bargraph On / Bargraph off
-
- Toggles between showing numbers and bargraphs
- _________________________________________________________________
- Clear count.
-
- Resets all "bin" counters and immediately starts counting again.
- _________________________________________________________________
- eXit
-
- Breaks program execution if it was not active when PPA was
- entered.
-
-
- @@PUT
-
- PUT command
-
- format:
- PUT [drive:]filename :macro-name, :macro-name ......
- MACRO
-
- PUT;
- Stores macro definitions in a DOS file.
-
- drive:filename;
- The drive and filename of the file that will receive the
- macro definitions. If the file already exists on that drive, the
- old file will be overwritten. If drive: is omitted the default
- drive is assumed.
-
- MACRO;
- Stores all macro definitions currently in the macro table.
-
- :macro-name;
- The name of a macro preceded by a colon.
-
- Examples:
-
- *PUT C:SAVMAC :TSTLOOP :G
- *PUT MACRO
-
-
-
- @@QRA
-
- TRACE QUALIFIER register commands
-
- (The new TS command is recommended)
-
- format:
- QRAx
- QRBx
- QRAx = [ADR spec1] & [DAT spec2] & [P1 spec3] & [P3 spec3]
- QRBx = [ADR spec1] & [DAT spec2] & [P1 spec3] & [P3 spec3]
-
- x is 0 - 9
-
- spec1 is address
- address TO address
- address LENGTH number
- wildcard (hex)
- wildcard (binary)
- spec2 is VF + WR + RD + SY1 + SY0 + I2 + I1 + I0 + 8 bit DATA
- can be specified as in spec1 above. Normally only wild
- cards would be used.
- spec3 is Port 1. 8 bits can be specified as in spec1 above but
- normally only wild cards would be used.
-
- VF = Valid Fetch ;active high
- WR = WRite to external memory ;active high (not low!!!)
- RD = ReaD from external memory ;active high (not low!!!)
- SY0 = external signal from pod
- SY1 = external signal from pod
- I2, I1, I0 indicates interrupt
- level from 0 to 7. ;I2 most significant
-
-
- The QRA and QRB registers are used to set up trig conditions
- together with the TR register. It can also be used as trace
- conditions with the TR register.
-
- The A and B in QRAx and QRBx stand for A-condition and B-
- condition respectively.
-
- The four fields that make up a condition (ADR, DAT, P1, and
- P3) are ANDed together, meaning that all four fields have to
- match to produce a true condition. The fields are, however,
- independent of each other. If you for example set up QRA0 to
- trace all WRITEs to address 4000H and QRA1 to trace all READs
- from address 2000H, you will also trace all WRITEs to 2000H and
- all READs from address 4000H.
-
- If any of the four components of the QR register are left
- out when QRAx (QRBx) is set up, it will default to all wild
- cards.
-
- For an overview of how the trace works see the TRA paragraph.
-
- Examples:
-
- QRA0 ;display QRA0
-
- QRA1 = A 0 TO 7FF & D xx80 ;set up QRA1 so that it will match
- frames only with addresses between
- 0H and 7FFH when data is 80H. VF,
- WR, RD, SY1, SY0, I2, I1, I0, Port
- 1 and Port 3 will all be set to
- wild cards (don't cares).
-
- QRB9 = P1 12 ;set up QRB9 to match frames only
- when Port 1 is 12H
-
- QRB7 = D 00XXXXXX10000000Y ;matches only when 80H is read from
- external memory. Observe the "Y"
- indicating binary.
-
-
- @@QUIET
- QUIET command.
-
- format:
- QUIET
-
- This command is used to supress printing registers etc. to the
- screen after breakpoints or single steps. Instead of printing
- several lines only a dot, '.', is printed. Normally used to
- speed up executions of MACROs. For this to make a difference the
- CODE WINDOW should be off. Each time the command is used
- it toggles supression ON or OFF.
-
-
- @@RBI
-
- RBIT command
-
- abbreviation: RBI
-
- format:
- RBIT partition [ = boolean expr., boolean expr.], ..
-
- RBIT;
- Displays or sets the contents of one or more addresses in
- the bit addressable memory.
-
- PARTITION;
- A single address, or arrange of addresses expressed as
- "address TO address" or "address LENGTH address".
-
- BOOLEAN EXPRESSION;
- A number, reference, or expression. The result is truncated
- to its least significant bit.
-
- Examples:
- RBIT .CY ;display carry bit
-
- RBI .ACC+4 ;displays bit 4 in the accumulator
-
- RBI .P1+2 ;displays bit 2 in Port 1
-
- RBI 0 to 7F = 1 ;set all bit locations in RAM to 1
-
-
-
- @@RBS
-
- RBS command
-
- format:
- RBS [= expression]
-
- RBS;
- Displays or sets the register bank select (bits 3 and 4 of
- PSW). RBS governs the location of working registers R0 through R7
- in internal data memory.
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed. For RBS, the result must be 0, 1, 2, or 3. Otherwise
- an error results.
-
- Examples:
-
- RBS ;displays current bank number
-
- RBS=3 ;Set RBS to 3
-
-
- @@RCS
- RCS command. Relative Computer Speed.
-
- RCS will print a number indicating the speed of your computer.
- Here are some numbers:
-
- 4.7 MHz XT 268
- 10 MHz XT 531
- 20 MHZ '286 2302
-
- If you run a fast machine and your crystal frequency is low you
- may want to use the -d option when you invoke the emulator.
- (See the INSTALLATION Chapter in the manual.)
-
-
- @@REG
-
- REGISTERS command
-
- abbreviation: R, REG
-
- format:
- REGISTERS
-
- REGISTERS;
- Displays the contents of program counter (PC), accumulator
- (ACC), multiplication register (B), stack pointer (SP), data
- pointer (DPTR), working registers R0 and R1 in the bank currently
- selected, and program status register (PSW). PSW is displayed in
- binary radix.
-
- Instead of "PSW" the register names are displayed.
- The abbreviations have the following meaning:
-
- C = Carry flag (CY)
- A = Auxiliary carry flag (AC)
- F = Flag 0 (F0)
- RS = Register bank select control bits (RS1, RS0)
- O = Overflow flag (OV)
- - = reserved
- P = Parity flag (P)
-
- The other registers are displayed in hexadecimal.
-
- After the registers, the next instruction is displayed in
- disassembled form.
-
-
- @@REM
-
- REMOVE command
-
- abbreviation: REM
-
- format:
- REMOVE SYMBOLS
- ..module-name.symbol-name
- MACROS
- :macro-name
-
- REMOVE;
- Deletes user defined symbols or macros from the symbol table
- or macro definition table.
-
- SYMBOLS;
- Removes all user defined symbols. See the SYM paragraph.
-
- ..module-name;
- The name of the module containing the symbol to be removed.
-
- .symbol-name;
- The name of a user defined symbol preceded by a period. If
- two or more symbols exist with the same name, only the first one
- is removed.
-
- MACROS;
- Removes all macro definitions.
-
- :macro-name;
- The name of a macro preceded by a colon (:).
-
- Examples:
-
- REMOVE SYMBOLS ;remove all modules, user symbols,
- and line numbers.
-
- REMOVE .VALUE ;remove the first occurrence of the
- user symbol .VALUE.
-
- REM ..ETON4.LOOP ;remove the user symbol from one
- module.
-
- REM MACROS ;remove macros.
-
- REM :REPCYC ;remove a macro.
-
-
-
- @@REP
-
- REPEAT command
-
- abbreviation: REP
-
- format:
- REPEAT <cr>
- [command <cr>]
- [WHILE boolean-expression] <cr>]
- [UNTIL boolean expression <cr>]
- ENDREPEAT
-
- REPEAT;
- Introduces a block of commands to be repeated.
-
- <cr>;
- Intermediate carriage return. It ends each input line but
- does not terminate the command entry. The carriage return after
- the END keyword is the termination of the command.
-
- COMMAND;
- Any EMUL51-PC command except DEFINE macro and REMOVE macro.
-
- WHILE;
- Introduces a halt condition for the command block. The loop
- halts when the WHILE condition is tested and found to be FALSE.
-
- UNTIL;
- Introduces a halt condition for the command block. The loop
- halts when the UNTIL condition is tested and found to be TRUE.
-
- BOOLEAN EXPRESSION;
- Any number, reference, or expression. The result is TRUE
- when the least significant bit of the result is 1. It is FALSE
- otherwise.
-
- ENDREPEAT;
- Terminates entry of the command block. It may be abbreviated
- to END.
-
- To end a REPEAT command before a condition ends it, just press
- the ESC key. It may take a couple of loops before the break
- occurs.
-
-
- Example:
- *REP
- .*STEP
- .*REG
- .*UNTIL PC EQ .DONE
- .*ENDR
-
-
-
- @@RES
-
- RESET commands
-
- abbreviation: RES
-
- format:
- RESET BRx
- BR
- QRAx
- QRBx
- QRA
- QRB
- EM
- CHIP
-
- RESET;
- Restores its object to the initial status of EMUL51-PC.
-
- BRx x is 0 - 9;
- Resets breakpoint register x to no breakpoints.
-
- BR;
- Resets breakpoint registers 0 and 1 to no breakpoints.
-
- QRAx QRBx;
- Resets the QRAx or QRBx to their inactive state.
-
- QRA, QRB;
- Resets all QRA0 - QRA9, or QRB0 - QRB9 to their inactive
- states.
-
- EM;
- Resets the microprocessor and all registers to their initial
- state. This is like restarting the EMUL51-PC.
-
- CHIP;
- Resets the microprocessor to its initial state. The same
- effect is obtained if the reset push button is pressed. (If
- jumper JB1 is closed).
-
-
- Examples:
-
- RES EM ;resets hardware and all registers
- RES CHI ;resets only hardware
-
-
-
- @@R0
-
- R0 - R7 commands
-
- format:
- Rn = [expression] ;n = 0, 1, 2, 3, 4 ,5 ,6, or 7
-
- R0 - R7;
- Display or set contents of working registers in the
- currently selected register bank. (See the RBS command).
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed. For R0 - R7, the result is truncated to the low byte.
-
- Examples:
-
- R0
-
- R4=20H
-
- @@SAP
- SAve Ppa setup command.
-
- Format:
- SAP <[d:]filename>
-
- Save PPA setup window to a file. Use LOP command to reload.
-
- Example:
- SAP PPA.SAV ;Save the PPA window setup to PPA.SAV
-
-
- @@SAV
-
- SAVE command
-
- abbreviation: SAV
-
- format:
-
- SAVE [d:] filename [NOCODE]
- [NOSYMBOLS]
- [HEXCODE] [partition]
- [partition]
-
- SAVE;
- Copies the user program and symbol table to the specified
- drive and filename. If NOCODE or "partition" are NOT used the
- partition of code affected by the most recent LOAD or SAVE
- command will be saved. At start up the default partition is set
- to 0. This means that no code will be saved if a SAVE (without
- partition) is used before LOAD.
-
- NOCODE;
- No code will be saved. The symbol table will be saved if
- present.
-
- NOSYMBOLS;
- No symbols will be saved. Code from the default partition
- will be saved.
-
- HEXCODE;
- The code will be saved in "INTEL HEX" format. This format is
- used by many PROM programmers. Partition may be used. No symbol
- table is saved.
-
- Examples:
- SAV A:MYPROG ;save current program to a: drive.
- SAV A:MYPROG NOCODE ;save only symbols.
- SAV MYPROG NOSYMBOLS ;save only code.
- SAV MYPROG 0 TO FFF0 ;save code from 0 to FFF0H.
- SAV MYPROG HEXCODE 0 TO 1000 ;save code from 0 to 1000H in
- Intel hex format.
-
- @@SAW
- SAVE WINDOW SETUP command
-
- format:
- SAW [d:] filename
-
- Saves current window setup to the specified file. Use LOW to read
- file back into the emulator. This makes it possible to store any
- number of setups and switch between them using the LOW command.
- For more details on the windows please see the WIN paragraph.
-
- Examples:
-
- SAW WIN.SUP ;save window setup to WIN.SUP
- in the current directory
- SAW A:XDAT.SUP ;save window setup to XDAT.SUP
- on drive a:
-
- @@SEB
-
- SEt Breakpoints.
-
- format:
- SEB
-
- Description
-
- The SEB command is used to set the complete 64K bit breakpoint RAM.
- This is useful in conjunction with the ABR command.
- (Automatic Breakpoint Remove). Please see the ABR paragraph for
- details). For regular breakpoints see the Breakpoint paragraph.
- (F1 at the Breakp. item at the top menu line if you are in the emulator.
- In the manual: see the "Breakpoints. How they work" paragraph).
-
- Example:
-
- SEB ;set the 64K bit breakpoint RAM to all 1's.
-
-
- @@SEC
-
- SECONDS. (EXECUTION TIME COUNTER) command
-
- abbreviation: SEC
-
- format:
- SECONDS
-
- SECONDS;
- Displays the number of cycles (in the case of 12MHz crystal
- equal to microseconds) that elapsed during emulation. The timer
- is reset when the PC is changed either with a PC command or when
- the FROM is used in the GO command. RESET EM also resets it.
-
- @@SERIAL
-
-
- SERIAL SIMULATOR Map serial port to data source/destination.
-
- abbreviation SER
-
- format SERIAL In {COM1|COM2} baudrate
- KEY [hotkey (hex)]
- FILE filename1
- MACRO :macroname1
- STR string
- Out {COM1|COM2} baudrate
- WIN upper row lower row
- FILE filename2
- MACRO :macroname2
- SERIAL OFF
- SERIAL
-
- description When the program under simulation accesses SBUF,
- the simulator will intercept the processing and
- take an 'action'. The following options are
- available:
-
- COM1
- COM2 use the COM-port of PC. Its
- baudrate should be set to match
- the external hardware device and
- does not need to correspond to
- that of the simulated CPU.
-
- KEY read input from the PC's
- keyboard. An optional 'hotkey',
- given in hex, will stop the
- simulation (default Esc).
-
- WIN Direct output to a window on the
- screen.
-
- FILE read/write data to the specified
- file, one byte at a time.
-
- MACRO execute a MACRO.
-
- STR a string is used as input. The string
- which follows the STR cannot contain
- any blanks. STR and "string" should
- be separated by a blank. The string
- will be used over again after it has
- been exhausted. See example below.
-
- The timing of RI and TI is determined by the simulated baudrate.
- The "input device" is only polled at intervals corresponding to a
- "character time". Then, if a character is available, RI will be
- set. The RI and TI status bits will be simulated according
- to the following rules:
- RI: if more data is available, the 'RI' bit
- will be set. Conditions:
- COM character in buffer
- KEY keyboard hit
- FILE not end-of-file
- MACRO RI set by macro
- TI: set after a delay corresponding to
- the baudrate and number of bits.
-
-
- Examples:
-
- SER I KEY O WIN 15 ;input is keyboard, output is screen window
- at starting at row 15 of the screen.
-
- SER I FILE A:SERDATA O FILE C:SEROUT ;input is file a:serdata
- and output is c:serout.
-
- SER I STR HELLO_THERE O WIN 15 ;input is the string HELLO_THERE
- (the string input cannot have
- any blanks). The string will be
- used over again when it has
- been exhausted.
-
- SER I COM1 300 O FILE SAVE ;COM1 300 baud is used as input.
-
-
- @@SL
-
- SL Command
-
- format:
- SL [module name]
-
- This command is used to specify that you want to linestep only in
- a certain module. No breakpoints will be placed in other modules.
- See the L command for detailes on how linestep works.
-
- Examples:
-
- L ;Linestep in all modules (SL not previously used)
- SL EXEC ;Enter Line Breakpoints only in module EXEC
- L ;Linestep only in module EXEC
- SL ;Enter Line Breakpoints to Linestep in all modules
- L ;Linestep in all modules
-
-
- @@SO
-
- SO Command
-
- format SO [=<type>,<path>,<extension>]
-
- SO;
- Displays or sets parameters used by the source level debugger.
-
- <type> Type of source file.
- S stands for a regular source file where line numbers in the
- corresponding object file refer to the actual line numbers
- in the source file. (Unlike Intel's PL/M-51).
- P stands for an Intel PL/M-51 file where line numbers in the
- object file correspond to information not in the source file,
- but in the list file.
-
- <path> By default the debugger will look for the source file (or list
- file) in the current directory. Setting <path> to point
- to any other directory will cause the debugger to look there
- for the file.
-
-
- <extension> By default the extension the debugger looks for is .C.
-
- Examples:
- SO ;display current parameters
- SO=S,\PROJ\FILES\,SRC ;regular source, source files are in \PROJ\FILES\
- extension is .SRC
- SO=P,,LST ;Intel PL/M-51, current directory, extension .LST
-
-
- @@SL
- SL command.
-
- This command will set breakpoints on all line numbers. Can then be used
- with the GB command. Normally you would simply use the L command which
- automatically sets breakpoints on all line numbers and starts emulation.
-
-
- @@SPECIAL
-
- This command was developed for a specific customer application
- and has no general interest.
-
- @@SST
-
- SST Single Step Trace
-
- format:
- SST ON (default)
- SST OFF
-
- When emulation starts (GO, STEP, GB etc.) the trace buffer is reset and
- all old information is lost. If SST OFF is used a STEP will not affect
- the trace buffer. Instead the trace buffer is left intact. Only the STEP
- command is affected. GO, GB etc. will still reset the old trace buffer.
- The instructions executed by the STEP will NOT be appended to the trace
- buffer.
-
-
-
- @@STA
-
- STACK command
-
- abbreviation: STA
-
- format:
- STACK [expression]
-
- STACK;
- Displays the contents of the EMUL51-PC processor stack area
- and stack pointer value.
-
- EXPRESSION;
- Indicates the number of bytes at the top of the stack to be
- displayed. If the result exceeds the value of the stack pointer
- plus one (SP + 1), the display terminates at data location 0. If
- the expression is omitted, the display starts at the current
- stack top and stops at data location 0.
-
- examples:
-
- *STACK 6 ;displays 6 bytes of the stack.
-
- *STA ;displays the stack pointer
- value and the contents of the
- stack area.
-
-
-
- @@STE
-
- STEP command
-
- abbreviation: S
-
- format:
- STEP [FROM address]
- STEP <number>
-
- STEP;
- Executes one instruction, then stops and displays registers,
- and shows the next instruction in disassembled form.
-
- FROM;
- Sets the PC to "address". If the FROM is omitted, the
- current PC is used.
-
- <number>
- Will single step specified number of times. ESC will abort stepping.
-
- Examples:
-
- STEP ;step one step from current PC.
- S F .LOOP ;steps one step starting at .LOOP.
- S 10 ;make 10 single steps.
-
-
- @@NEXT
- Step Next Commands. SN, N and J
-
- format:
- SN [FROM <address>]
- J
- N
-
- The SN command is "single straight step". The regular Step will
- always execute the next instruction, which means that it will go
- through all subroutine calls and interrupt service routines. The
- SN command on the contrary, will skip over CALLs, and
- interrupts. This means, of course, that if you don't come back
- after a subroutine or an interrupt the program will continue to execute
- forever or until you hit the ESC key or encounter another breakpoint.
-
- The SN command uses it own "disassembly pointer" to calculate where
- the next instruction is located. This means that in order for this
- "disassembly pointer" to be initialized you must first use
- SN FROM <address>. SN F PC will make it start from the present
- location. Thereafter SN with no parameters should be used.
- SN will follow JUMP instructions and branch instructions. It will
- also step out of subroutines and interrupt service routines, but
- will not go into subroutines or interrupt service routines.
- After breakpoints and regular single steps the next instruction
- in line to be executed will be shown together with some register
- values. In the "SN mode", however, the next instruction in
- "straight line" will be shown. Observe that this instruction may
- or may not be the next instruction in turn to be executed. An
- indefinite number of instructions in a subroutine or in an interrupt
- service routine may be executed before it. It will, however, be the
- last instruction to be executed before a break is taken. Also note
- that SN uses the BR0 breakpoint register.
- Any previous breakpoints held in this register will be destroyed.
-
- N and J is used only to skip over LCALLs and ACALLs. With these two
- commands no "disassembly pointer" is used. Instead the PC (Program
- Counter) is used. If PC points to a LCALL or a ACALL a breakpoint
- will be generated on the instruction following the CALL. Then with
- the "N" command a GO SLOW (GS) will be executed. The break will then
- be taken on the instruction following the CALL. The "J" command will
- instead execute a "GO" and consequently run through the subroutine at
- full speed. "J" will work as regular breakpoints, which means that the
- instruction following the CALL will be executed before the break is
- taken.
-
- It is important to realize that J will execute the
- instruction following the CALL before the break is taken. If for
- example you had two LCALLs following each other the first one could
- be skipped over using J. But the next LCALL instruction would
- be executed resulting in that you would wind up in the second sub-
- routine without being able to step over it. This would not happen
- with the SN and N commands.
-
- The SN command should NOT be used with the CODE window even though
- it works fine. The update information on the next "straight line"
- instruction will not be shown so it would be difficult to make any
- sense out of it.
-
- Examples:
-
- SN F 1000 ;Set "disassembly pointer" at 1000 and step
- straight to the next instruction.
-
- SN ;Step straight to the next instruction starting
- from the "disassembly pointer".
-
- J ;Step straight starting from the "PC" at
- full speed.
-
- N ;Step straight starting from the "PC" at
- GO SLOW speed.
-
-
- @@SNAP
-
- SNAP command
-
- format:
- SNAP <mode>, [<type>, <address>]
-
- <mode>
- 0 Disable SNAP
- 1 Enable SNAP
- 2 Enable "one shot SNAP"
- 3 Enable "show one address only SNAP"
- 4 Enable "show one address only one shot SNAP".
-
- <type> (only used in modes 3 and 4 above)
-
- D (internal data)
- R (Special Function Register SFR)
- X (External Data)
-
- <address> address of desired "SNAP address".
- (only used in modes 3 and 4 above)
-
-
- Description:
-
- The SNAP command changes the use of breakpoints. Rather than actually
- breaking it uses the break only to update the windows (mode 1 and 2) or
- displaying the specified address (mode 3 and 4) before execution is
- resumed. Once SNAP is activated (mode 1 and 3) the only way to stop
- execution is to do: "SNAP 0". Otherwise each attempt to break only will
- result in updating windows or specified address. Mode 2 and 4 will
- automatically return to mode 0 after the first breakpoint was
- encountered and used to update.
-
- Examples:
-
- SNAP 1 ;Use breakpoints to update windows
- SNAP 2 ;One shot update
- SNAP 3 D 20 ;Display data address 20 at each breakpoint
- SNAP 3 X 3000 ;Display external data address at each breakpoint
- SNAP 4 R 80 ;Display SFR at address 80 one time
- SNAP 4 R .SBUF ;Display SBUF one shot.
-
-
- @@SUF
-
- SUFFIX command
-
- abbreviation: SUF
-
- format:
- SUFFIX = [Y]
- [Q]
- [T]
- [H]
-
- SUFFIX;
- Displays or sets the default radix for numbers entered at
- the console.
-
- Y;
- Binary radix.
-
- Q;
- Octal radix.
-
- T;
- Decimal radix.
-
- H;
- Hexadecimal radix. Hexadecimal is the initial default radix.
-
- Examples:
-
- *SUFFIX ;displays current radix.
-
- *SUF = Y ;sets to binary radix.
-
- *SUF = H ;sets to hexadecimal.
-
-
- @@SWD
- SETUP WINDOW DATA ADDRESS
-
- format:
- SWD <data address> (0 < data address < E7H)
-
-
- Sets up the first address to be displayed in the DATA window.
- The contents of this address and the contents of the next 23
- addresses will be automatically displayed in the DATA window.
- Please refer to the WIN paragraph for an overview on the
- windows.
-
- Examples:
-
- SWD 40 ;first address to be displayed will be 40H
- SWD 80 ;only relevant in 8052 type CPU's.
-
-
- @@SWR
- SETUP REGISTER WINDOW command
-
- format:
- SWR
- SWR <position> <type> <symbol> <address>
-
- 1 <= position <= 18
-
- type = DB, RB, RBI, XB, CB or PB. (or any equivalent
- notation.)
- symbol = any ASCII string max 8 characters.
-
- 0 <= address <= FFFFH
-
- The 18 positions have the following physical placement on the
- screen:
-
- 1. 4. 7. 10. 13. 16.
- 2. 5. 8. 11. 14. 17.
- 3. 6. 9. 12. 15. 18.
-
-
-
-
- The SWR command makes it possible to set up any of the 18
- positions in the REGISTER window to reflect any address in any
- of the different address spaces of the microprocessor. Using
- the SWR command without any parameters will show the setup.
- Please see the WIN paragraph for an overview on the windows.
-
- Examples:
-
- SWR ;display current setup
-
- SWR 10 XB X4000 4000 ;make position 10 on the screen
- reflect the contents of external
- address 4000H. The symbol X4000 is
- chosen to indicate eXternal memory
- 4000H, but the symbol may be any
- ASCII string with less than 9
- characters.
-
- SWR 2 RB IRCON C0 ;Interrupt Request Control Register
- (used in Siemens 80535). Displayed in
- position 2. RB indicates Register
- Byte.
-
-
- @@SWX
- SETUP WINDOW EXTERNAL DATA ADDRESS
-
- format:
- SWX <external data address> (0 < address < FFE7H)
-
-
-
- Sets up the first external address to be displayed in the XDATA
- window. The contents of this address and the contents of the next
- 23 addresses will be automatically displayed in the XDATA window.
- Please refer to the WIN paragraph for an overview on the windows.
-
- Examples:
-
- SWX 40 ;first address to be displayed will be 40H
- SWX 1000 ;first address to be displayed is 1000H
-
-
-
- @@SY0
-
- The SY0A command.
-
-
- format:
- SY0A
- SY0A = H [L]
-
- SY0A;
- Displays or sets the SY0A register. This command determines
- if SY0 shall be active high (default) or active low.
-
- Examples:
- SY0A ;displays SY0A
- SY0A = L ;sets SY0A to active low
- SY0A = H ;sets SY0A to active high.
-
-
-
- @@SYM
-
- SYMBOLS command
-
- abbreviation: SYM
-
- format:
- SYMBOLS [module name | ?] [symbol name | ?] [data type | ?]
- [address] [| more]
-
- "|" means "or" except [| more] where | should be typed
-
- SYMBOLS;
- Displays user defined symbols and their corresponding
- values. Or as specified.
-
- Example:
-
- SYM ;display all symbols.
-
- SYM ESIN ? ? ;display all symbols in module ESIN
-
- SYM ? SEW BIT ;display all BIT symbols with the name SEW
-
- SYM ? ? DATA ;display all DATA symbols
-
- SYM ? ? MOD_BEG ;displays all module names
-
- SYM ? ? MOD ;displays all MOD_BEG and MOD_END. Useful to
- see where modules begin and end!
-
- SYM ? ? ? 2014 ;display all symbols with value 2014 (hex)
-
- SYM | more ;stop listing after 5 lines. Resume with
- keystroke. Line numbers (LINE) will not
- count in the "5 lines".
-
- @@SYML
-
- SYMLOAD command
-
- abbreviation: SYML
-
- format:
- SYMLOAD <filename>
-
- <filename> is a file created by a utility program that extracts
- line number information from a list file created by an 8051 cross-
- assembler. The format of the contents of this file should be:
-
- <filename.ext> <linenumber in decimal> <address in hex>
-
- example:
-
- 51demo.lst 43 0000
- 51demo.lst 46 000B
- 51demo.lst 47 000E
- 51demo.lst 48 0010
-
- SYMLOAD should be used in conjunction with the loadable file created
- by the crossassembler.
-
- Nohau provides a utility, CONVERT.EXE which works on some assembly
- list files. There is no guarantee that it will work on your assembly
- list file. Therefore we provide CONVERT.C which is the source file
- of CONVERT.EXE so that you can modify this to work on you list file.
- Below is a description of how CONVERT works:
-
- CONVERT <list file name> <output line number file name>
-
- e.g. CONVERT 51DEMO.LST 51DEMO.LSY
-
- Restrictions are that the list files must have absolute addresses
- (linking not necessary to resolve absolute addresses). Also 'org '
- is a keyword that must be followed by hex address.
-
- This was tried on two assembler list files. They both had
- format: <hexaddress> <opcode> <linenumber> <source statement>.
- Changes will need to be made for other assemblers.
-
- This is a typical sequence of commands that would be used in the
- emulator to debug in "assembly source":
-
- SO = S,\FILES\ASSY\,ASM ;see SO command for details
- LOAD PROG.OBJ ;Load object file created by the assembler
- SYML PROG.LSY ;PROG.LSY contains line symbols as
- described above
- CW ;Turn on the CODE WINDOW
-
- Now you should see a mix of the source code from PROG.ASM and
- disassembly of the code from the emulator. To view only source
- press function key F2. F2 toggles between mixed mode and source
- mode. You may use the L or the S commands to step in your code.
- Use CTRL+R to see registers. Also see Source Level Debugging for
- more details.
-
-
-
- @@SYS
-
- SYSTEM command
-
- abbreviation: SYS
-
- format:
- SYSTEM <DOS command>
-
- SYSTEM
- Executes the specified DOS command and returns to the
- emulator. Enough memory must be available for this to work. Also
- COMMAND.COM must be available on the drive from which you loaded
- DOS.
-
- Examples:
- SYS AEDIT MYPROG.SRC ;executes AEDIT to edit the
- file MYPROG.SRC When you exit from
- AEDIT you return to EMUL51-PC
-
- SYS DIR \BIN\*.OBJ ;Makes a directory of all files
- with the extension OBJ in
- subdirectory BIN, then returns to
- EMUL51-PC
-
-
- @@TABS
- TAB command.
-
- format:
- TAB
- TAB <number>
-
- This command displays or changes the number of blanks that replaces
- TABs from a source file. Useful when the CODE WINDOW is used with
- source level debugging. Default number is 8.
-
-
- Examples:
-
- TAB 4 ;use 4 blanks for TAB expansion
- TAB ;display TAB expansion
-
-
- @@TB
-
- TRACE BEGIN command.
-
- format:
- TB
-
- TRACE BEGIN;
- Begins a new trace. TB can only be used when the EMUL51-PC
- is in emulation mode.
-
-
-
- @@TBR
- TRACE BREAKPOINT command.
-
- format:
- TBR = [ON]
- [OFF]
-
- The TBR command displays, sets or resets the TBR register.
- If TBR = ON a trig condition on the trace will unconditionally
- break emulation. Observe that this command together with
- appropriate setting of the QR's can be used to set new
- breakpoints even after the emulation has begun. (See the
- TRA paragraph for details on how to set up trace
- conditions. See BRK paragraph for details on how the TBR
- breakpoint works).
-
- Examples:
-
- TBR ;display status of the TBR register
- TBR = ON ;activate TBR
- TBR = OFF ;reset TBR
-
-
- @@TC
-
- TRIG COUNTER command
-
- format:
- TC [= decimal number]
-
- TC
- Displays or sets the trig counter. By default the trig counter is
- set in the middle of the trace buffer. The TC register is used to
- count the number of frames to be traced after the trace
- encountered a trig condition. A low number gives you more
- information of what happened before the trig point, while a
- larger number gives you more information what happened after the
- trig condition. (Usually done in the TS screen instead of from the
- command line).
-
- Examples:
-
- TC ;Display current setting of TC
- TC = 0 ;trace stops immediately after the trig
- condition was encountered.
- TC = 2000 ;2000 frames after trig will be
- collected. With the 4K deep trace
- buffer you will also have about 2000
- frames collected before trig
- TC = 4000 ;You will get about 90 frames before
- trig and 4000 frames after the trig.
- (With the 4K deep trace buffer).
-
-
-
- @@TD
-
- TRACE DISPLAY command.
-
- format:
- TD [frame]
- TDS [frame]
- TDP [frame]
- TDD [frame]
-
- TD
- Displays frames collected in the trace buffer, in disassembled
- form. Special text lines like *** PROCESSING INTERRUPT ***, or
- *** MAIN *** clarifies what has been collected. If TD is used
- without a frame number, frames around the trig point will be
- displayed. If trace was interrupted, either by a break condition
- or a TE command, the last frames in the trace buffer will be
- displayed. The trig frame is always number 0. All frames before
- the trig frame are minus frames. (see example below).
-
- If you have used the trace filter function you must be careful
- when you use the TD command, as the disassembler will not recognize
- if some frames are missing.
-
- The TDP command is the same as TD, but displays ports and external
- data addresses in addition to the regular TD display.
-
- The TDD command is the same as TD, but displays DMA info ('152 and '452),
- external data addresses and data in addition to the regular TD display.
-
- For more details see the TRA paragraph.
-
- TDS
- As TD but displays from "file buffer". See OST command for
- details.
-
- Examples:
- TD ;display frames around the trig point
- TD -4000 ;display starting with frame number
- -4000. (4000 frames before the trig)
- TD 319 ;display starting with frame number
- 319 after the trig point.
-
-
-
- @@TDF
-
- TRACE DISPLAY FRAMES command.
-
- format:
- TDF [frame]
- TDFL start [TO stop] [-filename]
- start [LEN number] [-filename]
- TDFS [frame]
-
- TDF
- Displays frames collected in the trace buffer, in frame
- form. If TDF is used without a frame number, frames around the
- trig point will be displayed. If trace was interrupted, either by
- a break condition or a TE command, the last frames in the trace
- buffer will be displayed. The trig frame is always number 0. All
- frames before the trig frame are minus frames. (see example
- below). For more details see the TRA paragraph.
-
- TDFL
- Works as TDF but outputs continuous data without stopping
- after each page. If the optional -filename is used, the
- output is written to the specified file only and not to the
- screen. In this case LIST should not be active.
-
- TDFS
- As TDF but displays from "file buffer". See OST commands for
- details.
-
- Examples:
- TDFS ;display frames around the trig point
- TDFS -4000 ;display starting with frame number
- -4000. (4000 frames before the trig)
- TDF 319 ;display starting with frame number
- 319 after the trig point.
-
- TDFL -1000 ;displays all frames starting at -1000
-
- TDFL -500 TO -400 ;displays all frames between -500 and
- -400
-
- TDFL -100 -FRAME.SAV ;saves all frames from -100 to the file
- FRAME.SAV in the current directory.
-
- TDFL -1000 TO 1000 -\TRACE\SAMPLE1 ;saves all frames between
- -1000 and 1000 to the file
- SAMPLE1 in the sub
- directory \TRACE
-
-
- @@TDL
- TRACE DISPLAY LIST Command.
-
- format:
- TDL frame [TO frame] [-filename]
- [LEN number] [-filename]
-
- TDSL frame [TO frame] [-filename]
- [LEN number] [-filename]
-
- TDPL frame [TO frame] [-filename]
- [LEN number] [-filename]
-
- TDDL frame [TO frame] [-filename]
- [LEN number] [-filename]
-
- Works as TD but outputs continuous data without stopping
- after each page. If the optional -filename is used, the
- output is written to the specified file only and not to the
- screen. In this case LIST should not be active.
-
- TDSL works as TDL but from the "trace file".
-
- TDPL shows information with ports and External Data Addresses.
-
- TDDL shows information with DMA cycles (for '152 and '452),
- External Data Addresses and data.
-
- Examples:
-
- TDL -4000 ;display starting with frame number
- -4000. (4000 frames before the trig)
- TDL 319 ;display starting with frame number
- 319 after the trig point.
-
- TDL -1000 ;displays all frames starting at -1000
-
- TDL -500 TO -400 ;displays all frames between -500 and
- -400
-
- TDL -100 -FRAME.SAV ;saves all frames from -100 to the file
- FRAME.SAV in the current directory.
-
- TDL -1000 TO 1000 -\TRACE\SAMPLE1 ;saves all frames between
- -1000 and 1000 to the file
- SAMPLE1 in the sub
- directory \TRACE
-
-
- @@TE
-
- TRACE END command.
-
- format:
- TE
-
- TRACE END;
- Ends trace. TE can only be used when EMUL51-PC is in
- emulation mode.
-
-
-
- @@TR
-
- TRACE REGISTER command.
-
- (the new TS command is recommended)
-
- format:
- TR
- TR = TRACE ALL & TRIG NOTRIG & ITRAC ALL
- ACOND ACOND INT
- BCOND BCOND MAIN
- A & B ACOND THEN BCOND
- A LOOP
- A LOOP THEN B
-
- TRACE REGISTER;
- Displays or sets the Trace Register. Any combination of the
- TRACE, TRIG and ITRIG conditions may be set. The examples below
- provide a number of possibilities.
-
- Examples:
-
- TR ;displays Trace Register.
-
- TR = TRA A & B ;sets trace condition to ACOND
- and BCOND. Both A and B must
- be true to trace.
-
- TR = TRI A LOOP ;sets the trace to trig when the A
- condition(s) has appeared the
- number of times set in LC (Loop
- Counter).
-
- TR = ITR MAIN ;traces only instructions in the
- main program. It does not trace
- instructions executed within
- interrupts.
-
- TR = TRA ALL & TRI A ;traces all. Trigger on A
- condition(s).
-
- Any TRACE, TRIG and ITRAC not mentioned in a setup, remains
- untouched.
-
-
- @@TS
-
- Trace Set Command.
-
- format:
- TS
-
- This command takes you to a "static screen" where all trace
- functions can be programmed and altered. This replaces the
- following commands: TR, TC, LC, QRAx, QRBx, RES QRAx, RES QRBx.
- The use of the TS screen is explained in detail under the TRA
- paragraph. Accessible from the TRACE item at the top menu line.
- (Via the F1 key).
-
-
- @@TSG
-
- EMUL51 TSGET. Trace Status GET.
-
-
- abbreviation: TSG
-
- format:
- TSGET [drive]<filename>
-
- Description:
-
- Loads a previously saved trace set up window. (Saved with TSPUT).
-
- Example:
-
- TSG COPTRIG ;loads COPTRIG to the TS window
-
-
- @@TSP
-
- TSPUT. Trace Status PUT.
-
-
- abbreviation: TSP
-
- format:
- TSPUT [drive]<filename>
-
- Description:
-
- Saves the TS window (Trace Set). (Loads back with TSGET).
-
- Example:
-
- TSP COPTRIG ;saves contents of the TS window to the file
- COPTRIG.
-
-
-
- @@VER
-
- VERSION command
-
-
- format:
- VER
-
- VER
- Displays software version number. Also displayed when EMUL51
- is invoked.
-
-
-
- @@WAI
-
- WAIT command.
-
- format:
- WAIT
- WAIT <number>
-
- The WAIT command outputs the text "Press any key to continue" to
- the screen. It then waits for a key stroke before it continues.
- This could be useful to halt execution of REPEAT commands to be
- able to read results of emulation.
-
- WAIT <number> forces a delay of <number> seconds before returning
- to the prompt.
-
- Examples:
-
- WAIT
- WAIT 10 ;wait 10 seconds before continuing
-
-
- @@WRI
-
- WRITE command
-
- abbreviation: WRI
-
- format:
- WRITE [expression]
- [string]
-
- WRITE;
- Displays an (evaluated) expression or a string of characters
- for a sequence of such elements on your monitor.
-
- EXPRESSION;
- A number, reference, or formula that equates to the number
- expressed. For WRITE, the expression is
- evaluated and the result is displayed in hex.
-
- STRING;
- A sequence of characters enclosed in apostrophes (').
-
- Examples:
-
- WRI 'START PUMP 1' ;displays message.
-
- WRITE .SEC, 'SECONDS PASSED' ;expression and text.
-
- (See the MRO paragraph (MACROS) for more information).
-
-
- @@25
-
- 25, 43, 50 Commands.
-
- format:
- 25
- 43
- 50
-
- Used to switch to 25, 43 or 50 lines on the display. These
- commands will only work if your hardware is set up to handle
- 43 or 50 lines. (EGA for 43 lines and VGA for 50 lines).
-
- @@WATCH
- ? and W[x]? Commands. To display C variables.
-
- format:
- ?[*..]name[,[#][x | s | d]] [=value]
- w[z]?[*..]name[,[#][x|s]] [=value] (Descriptions and
- example at the
- end of this
- paragraph)
-
- Details for the '?' command explained as follows:
-
- - no <space> between the '?' and the variable name!
- - pointers can be preceeded by an appropriate number of
- indirections ('*'). Only last component of the 'name'
- need be a pointer.
- - 'name' is a simple C-expression for a variable with the
- following features:
- - nesting of pointers, arrays and structures.
- - a single element in an array to be given
- by a decimal number in brackets.
- - no parenthesis permitted.
- - the default format can be changed by a trailing:
- ,# a repeat counter
- ,x hex format
- ,#x combination of above
- ,s string format
- ,d decimal format
-
- otherwise 'floats' are printed as 'floats',
- 'ints' as decimal 'ints', etc.
-
- - new values can be assigned to simple variables
- (using the same format for input and output).
-
- Example:
-
- C-declarations:
-
- struct { int number; char name[8]; } list[3] = {
- 1, "ADAM",
- 4, "DAVID",
- 15, "ROBERT" };
-
- struct tag {
- struct tag *next;
- char symbol[20];
- } head,*p=head;
-
- int i = 0x1000;
- int tbl[6] = { 10,11,12,13,14,15 };
- int *ptbl = tbl;
- int *pptbl = ptbl;
-
-
- Command Output
-
- ?i 4096
- ?i,x 0x1000
- ?tbl[4] 14
- ?*ptbl 10
- ?*ptbl,3 10,11,12
- ?**pptbl 10
- ?ptbl D:ADDR:
- where 'D' is memory type
- and 'ADDR' is hex-value of pointer
-
- ?list {{1,"ADAM",4},{"DAVID"},{15,"ROBERT"}}
- ?list[2].name "ROBERT"
- ?list[0].name[3] 'M'
- ?head.next->symbol "nextsymb"
- ?p->next->symbol "nextsymb"
- ?*p {X:1234,"headsymbol"}
-
-
- Only simple items can be assigned to new values,
- but it works in complex expressions.
-
- e.g. ?list[3].name[2] = 'A'
- ( or = 0x41 )
-
- sets a single character in the string 'name[]'
- which is a member of a struct. 'list' is an
- array of structs.
-
- Note. The input format is always the same as
- the output format, but can always be overridden
- by '0x' for input of HEX code.
-
- int *tbl;
-
- ?*tbl = 100
-
- but ?*tbl,4 = 1024
- *tbl: {100,2,3,4}
- assignment ignored
-
- prints 4 elements and ignores the
- assignment since only single simple
- item can be assigned.
-
-
- If a symbol is multiply defined, the local variable is taken
- before a global variable.
-
- When the watch window is enabled (visible) you may define new
- watchpoints by typing 'w[x]' before the expression described above.
- The Watch window is enabled with ENA WAT or Ctrl+W.
- -------------------------------------------------------------------------
- The w[z]? Command:
-
- Syntax: w[z]?[*..]name[,[#][x|s]] [=value]
-
- where [z] is an optional number to specify in which location
- in the Watch window the variable is to appear. If the [z] is
- omitted the current contents in the Watch window will scroll up.
-
- Definition of locations:
-
- 1.
- 2.
- 3.
- 4.
-
-
- Example: w2?tbl
-
-
- @@COPYRIGHT
-
- COPYRIGHT
-
- Copyright (C) 1986 - 1991 by NOHAU Corporation. All rights
- reserved worldwide.
-
- D I S C L A I M E R
-
- Nohau Corporation's EMUL51-PC is sold with a one-year warranty on
- the hardware. The software is sold with no warranty, but upgrades
- will be distributed to all customers up to one year from the date
- of purchase.
-
- Nohau Corporation makes no warranties, expressed or implied,
- including, but not limited to, the implied warranties of
- merchantability and fitness for a particular purpose. In no event
- will Nohau Corporation be liable for consequential damages.