home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s260 / 1.ddi / PART1.EXE / EMUL31.HLP < prev    next >
Encoding:
Text File  |  1991-06-27  |  179.3 KB  |  5,514 lines

  1. @@MENU
  2.  
  3.                          USER INTERFACE
  4.  
  5. This is a simulator version of NOHAU CORPORATION's EMUL51-PC
  6. in-circuit emulator for the entire 8051 family of microcontrollers
  7. For more information:
  8.  
  9. Phone U.S.  (408) 866 1820
  10. FAX   U.S.  (408) 378 7869
  11.  
  12.  
  13. There are probably as many ideas of how a user interface 
  14. should work as there are users. We have tried to combine a fast 
  15. command language for the frequent user with a menudriven, context 
  16. sensitive help, interface for the beginner and infrequent user. 
  17. The idea is that by using the menus you will automatically learn 
  18. the commands. 
  19.  
  20. This is intended to be a shortform overview of how to move about 
  21. the screen using both menus and commands. For a more detailed 
  22. hands on session please refer to the tutorial section in the 
  23. manual.
  24.  
  25. 1. The Menu line.
  26.  
  27. The top line on the screen shows the 11 major command groups. 
  28. You can use the right and left arrow keys or the mouse to move 
  29. between the 11 groups. At the bottom of the screen you will 
  30. always see a help line explaining each item in more detail. By 
  31. pressing RETURN or clicking the mouse a "pulldown" menu with 
  32. detailed command choices will be seen. 
  33.  
  34. 2. Pull Down Menus.
  35.  
  36. The first item will be highlighted. You can now use the up and 
  37. down arrows or the mouse to choose command. Also here the bottom 
  38. line will explain each command in detail. If you use the right or 
  39. left arrow key or the mouse you will move to the top item on the 
  40. next menu. To "escape" up to the menuline from a pull down 
  41. menu use the ESC key. To go to the command line, type ESC while at
  42. the menu line.
  43.  
  44. 3. Help window.
  45.  
  46. If you press function key 1 (F1) at any time the help window will 
  47. open and a detailed description of the current item will appear. 
  48. You can then use the arrow keys and PgUp and PgDn keys when you 
  49. study the help text. ESC closes the help window.
  50.  
  51. 4. Executing a command from the menu.
  52.  
  53. If you press RETURN or click the mouse at the command 
  54. you want to perform, the corresponding command will appear at the 
  55. bottom of the screen. You will now also see an additional 
  56. "syntax" help line telling you what possible parameters you now 
  57. must enter. This extra help line may be turned on and off by 
  58. pressing the F9 function key. 
  59.  
  60. 5. Moving back to the menu from the command line.
  61.  
  62. If you want to move back from the command line to the menu line 
  63. press the ESC key. You can also type MENU at the command line to get 
  64. to the menu line. A third way is to simply use the mouse to point 
  65. at the desired group and click it to pull down the desired menu. 
  66.  
  67. 6. Editing command lines.
  68.  
  69. You can use the LEFT ARROW and RIGHT ARROW keys to insert or over-
  70. type the text already on the command line. You can toggle between 
  71. INSERT Mode (underscore cursor) and OVERTYPE Mode (block cursor) 
  72. using the "Ins" key.
  73. See F7 below for more information.
  74.  
  75. 7. Function keys.
  76.  
  77. The function key specification will appear at the 
  78. bottom of the screen when you are in command mode. You can 
  79. activate them by pressing the desired function key or point at 
  80. the desired function at the bottom of the screen with the mouse 
  81. and click it. They have the following functions:
  82.  
  83. F1  Help     Puts the HELP window with appropriate help text up on 
  84.              the screen. Especially useful when you are in the 
  85.              pull down menus although the "function key line" at 
  86.              the bottom of the screen is not visible at that 
  87.              point.
  88.  
  89. F2  CpyChr   Copy characters one by one from the previous 
  90. |            commandline. 
  91. |
  92. F2  SrcAsm   When the CODE window is open F2 is used to toggle 
  93.              between Assembly Mode and Source Mode.
  94.  
  95. F3  CpyCmd   Copy Command. Copy the previous command line.
  96.  
  97. F4  AdjWin   Adjust Windows. Move current window and/or change 
  98.              size. (See help line on bottom line).
  99.  
  100. F5  NxtWin   Change current window. Window border will indicate 
  101. |             current window.
  102. |
  103. F5  Speed?   When the CODE Window is open F5 is used to toggle
  104.              between the full speed GO mode and GO SLOW mode which
  105.              is a single step mode (See the GS command). GO mode
  106.              will execute the instruction where the breakpoint is
  107.              set, while GO SLOW will stop at the breakpoint.
  108.  
  109. F6  WOnOff   Window On / Off. Remove window and show full screen. 
  110.              Toggles On and Off. (See help window at WIN on the 
  111.              top menu line).
  112.  
  113. F7  PrvCmd   Previous Command. Allows you to go back and look at 
  114.              the most current 20 commands. You may edit and reuse 
  115.              any command. These 20 commands are stored in a 
  116.              circular buffer so by pressing F8 (NxtCmd) when you 
  117.              are at the current command will give you the oldest 
  118.              command. When you edit a line you may toggle the 
  119.              cursor between INSERT Mode (underscore cursor) and
  120.              OVERTYPE Mode (block cursor). Use the "Ins" key to
  121.              toggle.
  122.  
  123. F8  NxtCmd   Next command. Step forward in the command buffer. 
  124.              (See description of F7 also).
  125.  
  126. F9  HlpOnf   Help On / Off. Switch syntax help at second last line 
  127. |            On or Off.
  128. |
  129. F9  GoCurs   When the Code Window is open, F9 sets a breakpoint
  130.              at the cursor location in the Code Window and executes
  131.              a GO command.
  132.  
  133. F10 Repeat   Repeat last command. Works like F3 but includes at 
  134.              RETURN to complete the command.
  135.  
  136.  
  137. -   shortcuts for toggling some windows:
  138.     CTRL-R  register window (Not REGISTER WINDOW on top of screen)
  139.     CTRL-W  watch window
  140.     CTRL-A  code window
  141.     CTRL-D  data windows
  142.  
  143. @@HDW
  144.                          HARDWARE OVERVIEW.
  145.  
  146.     The basic hardware consists of the emulator board, mounted in 
  147. one of the PC's slots. The pod board is the small board that 
  148. replaces the microcomputer chip on the target system. The ribbon 
  149. cable connects these two boards. The optional trace board 
  150. contains a piece of ribbon cable to connect the trace board to 
  151. the emulator board. All three boards have jumpers to configure 
  152. them for different functions. (See manual).
  153.  
  154.     The pod board has an LED which is on when EMUL51-PC is in 
  155. emulation mode. Pushbutton switch S1 can be used to reset the 
  156. microprocessor. The target systems reset can be disconnected by 
  157. removing jumper JB1. (Useful if your target has a watchdog, 
  158. controlled under software, which resets the chip if the software 
  159. is not running). 
  160.  
  161.     Additional 40 pin sockets may be added to the socket pins  on 
  162. the solder side of the board. This may have to be done if 
  163. components on the target system are too high. There are also different
  164. adapters available. Please refer to a current pricelist.
  165.  
  166. @@SIMUL
  167.  
  168.             SIMUL51-PC. Software simulator for the 8051.
  169.  
  170.  
  171. Overview.
  172.  
  173. The SIMUL51-PC has been derived from the EMUL51-PC's software.  
  174. The EMUL51-PC is an in-circuit emulator, so its software 
  175. communicates with the emulator's hardware.  In the simulator 
  176. version the hardware has been replaced with software that 
  177. simulates the 8051.  All hardware features like ports, timers, 
  178. interrupts etc. are also simulated.  External hardware is 
  179. simulated through a scheme using the EVENT command combined with 
  180. macros as described below.
  181.  
  182. SIMUL51-PC consists of the following three major components:
  183.  
  184. 1. User interface (Same as EMUL51-PC).
  185. 2. Simulator engine (Instruction and SFR simulator).
  186. 3. External environment simulator. EVENT - MACRO and SERIAL 
  187.    CHANNEL simulation.
  188.  
  189.  
  190. Invocation.
  191.  
  192. SIMUL51 is normally started with two parameters which specify how 
  193. much CODE memory and XDATA memory the program needs to allocate. 
  194. The -m parameter specifies amount of CODE memory expressed in 
  195. number of Kilobytes. The -x parameter specifies amount of XDATA 
  196. memory expressed in number of Kilobytes.   
  197.  
  198. Examples:
  199.  
  200. SIMUL51 -m10 -x5     ;10K CODE and 5K XDATA
  201. SIMUL51 -m64 -x64    ;64K CODE and 64K XDATA
  202. SIMUL51 -m1          ;1K CODE and no XDATA
  203. SIMUL51              ;32K CODE (default) and no XDATA (default)
  204.  
  205. Don't allocate more memory than you need! It will "eat up" memory 
  206. that could be used for symbol tables and other things. The HEAP 
  207. command can be used to allocate more memory in EMS or EXT memory 
  208. or on DISK. (See the HEAP command for details.)  For your 
  209. convenience six batch files for starting the SIMUL51-PC have been 
  210. included:
  211.  
  212. ss.bat        ;SIMUL51  -m4 -x4       4K CODE 4K XDATA
  213. ms.bat        ;SIMUL51  -m32 -x32     32K CODE 32K XDATA
  214. ls.bat        ;SIMUL51  -m64 -x64     64K CODE 64K XDATA
  215. sso.bat       ;SIMUL51O -m4 -x4       4K CODE 4K XDATA
  216. mso.bat       ;SIMUL51O -m32 -x32     32K CODE 32K XDATA
  217. lso.bat       ;SIMUL51O -m64 -x64     64K CODE 64K XDATA
  218.  
  219. SIMUL51O is an "overlay version" of SIMUL51.  The benefit of 
  220. SIMUL51O over SIMUL51 is that it uses 90K less of your DOS 
  221. memory.  The disadvantage is that it might be somewhat slower.
  222.  
  223. User Interface.
  224.  
  225.   Please refer to chapters 1, 3, and 6 in this manual.
  226.  
  227. Simulator Engine.
  228.  
  229. The simulator performs a number of tasks: 
  230.  
  231. - It allocates memory to simulate the different memory areas in 
  232.   the 8051.
  233.  
  234. - It simulates 8051 instructions.  The speed at which this is 
  235.   done is about 650 times slower than executing code at 12 
  236.   MHz if you run the simulator on a '286 20MHz computer.
  237.  
  238. - It simulates the 8051 hardware like SFR's and interrupts.
  239.  
  240. - The trace is simulated only as straight tracing.  
  241.   Features like triggering and filtering which are available in 
  242.   the emulator are not implemented in the simulator.
  243.  
  244.  
  245. External environment simulator (EVENT - MACRO).
  246.  
  247. An EVENT is a READ or WRITE to any memory location in the 8051.  
  248. When a READ or WRITE occurs as specified with the EVENT command, 
  249. a break occurs or a macro is executed. (See MACROS 1-15)
  250.  
  251. A macro is basically one or a number of commands executed from 
  252. a preprogrammed macro rather than from the command line. 
  253. When the macro is executed the program continues to execute, 
  254. after the macro has completed.
  255. For more details on macros see MACROS page 1-15.
  256. We will start with examples to clarify how the EVENT - MACRO 
  257. concept is used. 
  258.  
  259. For a formal description of the EVENT command and the MACDELAY 
  260. command, please type EVE or MACD at the command line and press F1.
  261.  
  262. Examples:
  263.  
  264. EVE * 10C PC        ;breaks when the program attemps to execute
  265.                      an instruction a address 10C.
  266.  
  267. EVENT W 34 db       ;breaks when the program writes to internal                       
  268.                      data memory 34 hex
  269. EVENT R 80 rb       ;breaks when the program reads address 80. 
  270.                      (P0) 
  271. EVENT W 1289 XB 12  ;breaks when the value 12 hex is written to 
  272.                      address 1289
  273.  
  274. EVENT W 1289 XB 12 56   ;breaks when a value within the range 12 
  275.                          to 56 hex inclusive, is written to 
  276.                          address 1289 hex
  277.  
  278.  
  279. EVENT W 45 DB :MAC      ;executes macro :MAC when the program 
  280.                          writes to data address 45 hex, then the 
  281.                          program continues.
  282.  
  283. EVENT R 1234 TO 1256 XB 30 40 :FEED  ;executes macro :FEED when a 
  284.                                       value between 30 and 40 hex 
  285.                                       inclusive is written to an 
  286.                                       address between 1234 and 
  287.                                       1256 hex inclusive
  288.  
  289. It is important to note that macros must be defined before they 
  290. are used in an EVENT.
  291.  
  292.  
  293. Examples of how a macro can work with two EVENTs:
  294.  
  295. DEF :MAC
  296. RBI .P3+2 = RBI .P1+5 
  297. EM
  298.  
  299. Together with the following macros this example forces bit 2 of 
  300. Port 3 (P3) to follow bit 5 of Port 1 (P1).
  301.  
  302. EVENT W .P1 RBY :MAC
  303. EVENT W .P1+5 RBI :MAC
  304.  
  305. To summarize:  When an instruction writes to P1, whether byte or 
  306. bit, P3.2 will be made to follow P1.5.
  307.  
  308. You may want to implement a delay from when the EVENT 
  309. is detected until the macro is executed.  This can be done with 
  310. the MACDELAY command.  If you want to delay changing P3.2 for 
  311. 50ms from when P1.5 was written to, you would define a new macro 
  312. which uses the MACDELAY command:
  313.  
  314. DEF :MACD
  315. MACDELAY 50 MSEC :MAC
  316. EM
  317.  
  318. If you change :MAC in the EVENTs above to MACD, 50ms delay will be 
  319. added before :MAC is executed. Observe that it is 50ms counted in 
  320. cycles where it is assumed that 12MHz is used. 
  321.  
  322. For a formal description of the EVENT command please type EVE at
  323. the command line and then F1.
  324.  
  325. External environment simulator (SERIAL CHANNEL)
  326.  
  327. Simulating the serial channel of the 8051 presents a challenge 
  328. both for us and for you. For us to make it as easy for you as 
  329. possible, and for you to set it up so that it resembles the real 
  330. world.
  331.  
  332. For a formal description of the SER command please type SER at
  333. the command line and then F1.
  334.  
  335. @@SHELL
  336.                SHELL command
  337.  
  338. abbreviation: SH
  339.  
  340. format:
  341.       SHELL  [/d]  [DOS command]
  342.  
  343. SHELL
  344.   Swaps out the emulator program to EMS or disk and loads a new DOS shell.
  345. Almost the entire memory will be available to run the new shell.
  346. The path to the shell must be defined by the environment variable COMSPEC.
  347. Typically you may put something like
  348.  
  349.         SET COMSPEC=C:\DOS\COMMAND.COM
  350.  
  351. in your AUTOEXEC.BAT file.
  352.  
  353.   EMS has priority, but disk can be forced as swapping media with the
  354. optional switch /D.   Note that EMS is by an order of magnitude faster!
  355.  
  356.   A full DOS command line can be given and executed with automatic return
  357. to the emulator. If the DOS command is left out, the SHELL will prompt you
  358. for a DOS command. The command "EXIT" brings you back to the emulator.
  359.  
  360.  
  361. Examples:
  362.  
  363. SHELL                         ; Swaps the emulator to EMS, if available,
  364.                 otherwise to disk. Then it puts you in
  365.                 command under the DOS command processor.
  366.                 Terminate and return to the emulator with
  367.                 the command:  EXIT
  368.  
  369. SHELL /D edit myfile.c        ; Swaps the emulator to disk (leaves the EMS
  370.                 available for the editor), then lets you
  371.                 edit the specified file. When you exit
  372.                 from 'edit', you will come directly back
  373.                 to the emulator.
  374.  
  375.  
  376.  
  377. @@SLD
  378.            The Code Window. Source Level Debugging.
  379.  
  380. The EMUL51-PC lets you open a "Code Window" with the command 
  381. CW which toggles the CODE Window On and Off. 
  382. (You can also use CTRL+A to toggle the CODE window on / off.
  383. The commands ENA CODE and DIS CODE can also be used to open / close 
  384. the Code Window).
  385.  
  386. format:
  387.        CW
  388.  
  389. When the Code window is open two modes of display are available. 
  390. By default "assembly mode" is enabled. In this mode the disassembler
  391. is used generate the text in the Code window. 
  392.  
  393. The second mode is the "source mode". 
  394. This mode depends on a combination of the contents of the 
  395. symbol table and the corresponding source files or list files.
  396.  
  397. The function key F2 is used to toggle between these two modes.
  398. Here follows detailed descriptions of how the two modes are used:
  399.  
  400. 1. Assembly mode.
  401.  
  402. Disassembly is started at the Program Counter (PC). The next 
  403. instruction to be executed is high-lighted. The cursor is on the 
  404. command line. The user interface works as usual, so you may enter
  405. any command or use ESC to go up to the menu line. The contents of
  406. the code window will follow the program counter (PC) when you use
  407. the STEP commands and the GO commands. By pressing the ARROW UP key
  408. you can move into the CODE WINDOW. The four leftmost positions in 
  409. the CODE WINDOW will then be high-lighted. By pressing F9 a 
  410. breakpoint will be placed at the cursor position and a GO will 
  411. be generated. By using PgUp and PgDn you can move the contents 
  412. of the CODE WINDOW to new addresses. You may also use the mouse to
  413. do PgUp, PgDn. Just point to the arrows in the corners of the
  414. code window and click the left mouse button. The "down arrows" will
  415. scroll the CODE WINDOW one line. If you point in the border between the
  416. arrows the window will scroll one page. Above the middle of the border 
  417. it will scroll up and below the middle it will scroll down. If you use 
  418. the disassembly command (D, DASM) you can change the contents to start 
  419. at any address. (D 500 would disassemble code from 500H and put it in 
  420. the CODE WINDOW). After STEP or GO the registers will not automatically
  421. be displayed as they are when the CODE WINDOW is not turned on. 
  422. But you can use CTRL+R to toggle on a window overlaying the STACK WINDOW
  423. to see the most common registers. The REGISTER WINDOW on
  424. top of the screen is of course updated as usual between each command.
  425. You can redefine some items there to correspond to registers of
  426. interest. The Assembly mode is really "mixed" mode as it will display
  427. source lines intermixed with assembly if they are available. (See
  428. description of Source mode below). For each disassembled line a check
  429. is made if there is an active breakpoint from the BRx registers. If
  430. that is the case a "comment" is displayed to the right of the  
  431. mnemonic preceded by a ";". Also a comment is generated for all JMP
  432. instructions; either ";jump" or ";no jump" to indicate if the jump
  433. will be taken or not.
  434.  
  435.  
  436. Source mode.
  437.  
  438. Source mode is usable when you are working with Archimedes/IAR 
  439. C-Compiler, Keil/Franklin C-Compiler, Intermetrics/Whitesmiths
  440. C-Compiler, BSO/Tasking C-Compiler, Intel's PL/M-51 compiler or
  441. when the "OBJ" file contains LINE numbers and is supported by
  442. EMUL51-PC.
  443.  
  444. Each time the disassembler finds a code symbol (from the symbol 
  445. table) it examines the symbol and if the first character is a '#'
  446. it assumes that it is a line number. It also notes the module name.
  447. It will then look for a file with the same name as the module name
  448. and with extension ".C" or ".LST", depending on the "SO" command.
  449. (by default ".C" is assumed). If it is found it will locate
  450. the current line number and display that line. In Assembly Mode
  451. or for that matter any time the disassembler is used, only "code
  452. generating" source lines will be displayed. In Source Mode, however,
  453. "non code generating" source lines will automatically be inserted.
  454. If you should put a breakpoint (as described in Assembly Mode "ARROW
  455. UP") on a "non code generating" line, the breakpoint will 
  456. automatically be generated on the first assembly line in the next
  457. "code generating" source line. 
  458.  
  459. On top of the CODE WINDOW the name of the module currently displayed,
  460. is shown.
  461.  
  462. You can only switch to Source Mode when a source line is visible in the
  463. Code window. Therefore if you try to switch to Source Mode
  464. when no source line is visible in the Code Window you will stay in 
  465. Assembly Mode. To get to a point where a source line is visible any
  466. of the following methodes can be used:
  467.  
  468. 1. Use PgDn, PgUp or ARROW DOWN until a source line shows up.
  469.  
  470. 2. If you want to show a certain module, first use the DOMAIN (DOM) 
  471.    command to specify the module (DOM ..<module name>). Then use the
  472.    Disassembler command (D .#line number in specified module).
  473.  
  474. 3. If you want to "single step" on line numbers use the L command, 
  475.    which automatically sets breakpoints on all line numbers, then
  476.    executes the code until it hits the first instruction 
  477.    generated by a source line. 
  478.  
  479. The GS (Go Slow) command is very useful both in Assembly mode and in 
  480. source mode. The Code window will be automatically updated as program
  481. is executed, giving you a very good picture of what is happening
  482. assembly instruction by assembly instruction or high level statement 
  483. by high level statement. The "-" key will decrease the speed of the 
  484. execution and the "+" key increases speed.
  485.  
  486. The "Highlighted bar", HB, in the CODE window.
  487.  
  488. In assembly mode the HB always shows the next instruction to be 
  489. executed. This is in principal also the case in source mode. 
  490. The problem here is when the sourceline corresponds to only one 
  491. assembly line. As explained earlier the L command causes breaks
  492. at the first instruction in each sourceline. The EMUL51-PC always
  493. executes the instruction at the breakpoint before breaking. So if
  494. there was only one instruction, the next instruction would be the
  495. first instruction of the next sourceline. The HB will be at the 
  496. sourceline closest to the next assembly instruction. Therefore in
  497. cases where the sourceline corresponds to only one assembly 
  498. instruction the HB will show one sourceline ahead of the "current
  499. line" (which was actually already executed). In most C-Compilers
  500. this problem can be solved by using a compiler switch which always
  501. generates an extra NOP at every sourceline. In PL/M-51 this is
  502. not possible so in this case working in mixed mode may be the
  503. best solution.
  504.  
  505. The AV (Auto Variable) command lets you view C stack variables when you
  506. are inside the function where the variable is "alive". 
  507.  
  508. The EMUL51-PC supports different C-Compilers in different ways, 
  509. depending on what information is supplied by the compiler in the
  510. "OBJ" file. NOHAU is continuously updating the software to take
  511. advantage of the compiler manufacturer's debug information. This is
  512. the latest update:
  513.  
  514. "C-variable support" available for:
  515. Archimedes:  C-Compiler 3.0  and later.  Linker 4.0 and later.
  516. Franklin:    C-Compiler 2.12 and later.  Linker 2.4 and later.
  517. Whitesmiths: C-Compiler 3.32 mod 0 and later.
  518. BSO:         C-Compiler 1.1A and later.  Assembler 3.0B and later.
  519.         Linker 5.0A and later.
  520.  
  521.      Examples of how correct object files are generated for EMUL51-PC
  522.      to support C-variables.
  523. ---------------------------------------------------------------------
  524. FRANKLIN / KEIL:
  525.  
  526. Example 1:
  527.  
  528. Used INSIDE the file:
  529.  
  530. #pragma code symbols debug objectextend
  531.  
  532. Example 2:
  533.  
  534. Used in batch file:
  535.  
  536. Assembler:    a51 sample1.a51 debug xref oe
  537. C-Compiler:    c51 sample1.c debug xref oe
  538. Linker:        l51 sample1.obj to sample
  539.  
  540. ---------------------------------------------------------------------
  541. IAR / ARCHIMEDES:
  542.  
  543. For compilation, switches are as usual but either -r0 or -r1 should
  544. be added. -r1 provides an extra NOP for each C-line. This is
  545. useful for the EMUL51-PC's handling of breaking on the first
  546. instruction of the C-line, as the instruction on which the 
  547. breakpoint is put will also be executed. If you use -r1, be sure
  548. to change it to -r0 before burning PROM otherwise the code would be
  549. unneccesarily big!
  550.  
  551. For linking, switches are also as usual but  the -F(format) switch 
  552. is changed to -r.
  553. ---------------------------------------------------------------------
  554. INTERMETRICS / WHITESMITHS:
  555.  
  556. Example:
  557. 'C'    c -v -dprom -dxdebug -dlistcs -o sample sample.c
  558. 'Asm'   c -v -dprom -dxdebug -dlistcs -o sample sample.s
  559.  
  560. When you are ready to program you PROM remove the -dxdebug switch
  561. so that your code with not be unneccesarily big!
  562. ---------------------------------------------------------------------
  563. BSO / TASKING:
  564.  
  565. Compiler:
  566.     cc51 -Ml -s -g sample.c
  567. Assembler:
  568.     asm51 sample.src
  569. Linker:
  570.     link51 \lib\cstart.obj,sample.obj,lib\c51l.lib to sample.abs
  571. Formatter:
  572.     oct_ieee sample.abs sample.out
  573.  
  574. When you are ready to program you PROM remove the -g switch
  575. so that your code with not be unneccesarily big!  Also you can use
  576. a different formatting program to produce a straight HEX file.
  577. ---------------------------------------------------------------------
  578.  
  579. All models are supported. A WATCH WINDOW can be activated to
  580. display up to four C variables. It overlays the REGISTER WINDOW.
  581. (See below for detailed description how it works).
  582.  
  583. There are no restrictions on how local variables should be 
  584. declared. There is also a way to display and set both local 
  585. and global variables. This is done with the "?" command. 
  586. Structures, arrays, arrays of structures and members of 
  587. structures can be shown. Here follows some examples to 
  588. illustrate what can be done:
  589.  
  590.     Syntax:     ?[*..]name[,[#][x | s | d]] [=value]
  591.  
  592.     with the details explained as follows:
  593.  
  594.     -   no <space> between the '?' and the variable name!
  595.     -   pointers can be preceeded by an appropriate number of
  596.         indirections ('*'). Only last component of the 'name'
  597.         need be a pointer.
  598.     -   'name' is a simple C-expression for a variable with the
  599.         following features:
  600.         -   nesting of pointers, arrays and structures.
  601.         -   a single element in an array to be given
  602.             by a decimal number in brackets.
  603.         -   no parenthesis permitted.
  604.         -   the default format can be changed by a trailing:
  605.             ,#          a repeat counter
  606.             ,x          hex format
  607.             ,#x         combination of above
  608.             ,s          string format
  609.             ,d          decimal format
  610.  
  611.             otherwise 'floats' are printed as 'floats',
  612.                   'ints' as decimal 'ints',  etc.
  613.  
  614.         -   new values can be assigned to simple variables
  615.             (using the same format for input and output).
  616.  
  617.        Example:
  618.  
  619.         C-declarations:
  620.  
  621.         struct { int number; char name[8]; } list[3] = {
  622.              1,  "ADAM",
  623.              4,  "DAVID",
  624.             15,  "ROBERT" };
  625.  
  626.         struct tag {
  627.             struct tag *next;
  628.             char   symbol[20];
  629.             } head,*p=head;
  630.  
  631.         int     i = 0x1000;
  632.         int     tbl[6] = { 10,11,12,13,14,15 };
  633.         int     *ptbl  = tbl;
  634.         int     *pptbl = ptbl;
  635.  
  636.  
  637.         Command             Output
  638.  
  639.         ?i                  4096
  640.         ?i,x                0x1000
  641.         ?tbl[4]             14
  642.         ?*ptbl              10
  643.         ?*ptbl,3            10,11,12
  644.         ?**pptbl            10
  645.         ?ptbl               D:ADDR:
  646.                      where    'D' is memory type
  647.                      and   'ADDR' is hex-value of pointer
  648.  
  649.         ?list               {{1,"ADAM",4},{"DAVID"},{15,"ROBERT"}}
  650.         ?list[2].name       "ROBERT"
  651.         ?list[0].name[3]    'M'
  652.         ?head.next->symbol  "nextsymb"
  653.         ?p->next->symbol    "nextsymb"
  654.         ?*p                 {X:1234,"headsymbol"}
  655.  
  656.  
  657.          Only simple items can be assigned to new values,
  658.          but it works in complex expressions.
  659.  
  660.          e.g.      ?list[3].name[2] = 'A'
  661.                   ( or  = 0x41 )
  662.  
  663.             sets a single character in the string 'name[]'
  664.             which is a member of a struct. 'list' is an
  665.             array of structs.
  666.  
  667.             Note. The input format is always the same as
  668.             the output format, but can always be overridden
  669.             by '0x' for input of HEX code.
  670.  
  671.             int *tbl;
  672.  
  673.             ?*tbl = 100
  674.  
  675.           but   ?*tbl,4 = 1024
  676.             *tbl: {100,2,3,4}
  677.             assignment ignored
  678.  
  679.                  prints 4 elements and ignores the
  680.                  assignment since only single simple
  681.                  item can be assigned.
  682.  
  683.  
  684.     If a symbol is multiply defined, the local variable is taken
  685.     before a global variable.
  686.  
  687.     When the watch window is enabled (visible) you may define new
  688.     watchpoints by typing  'w[x]' before the expression described above.
  689.     The Watch window is enabled with ENA WAT or Ctrl+W.
  690.  
  691.     Syntax:     w[z]?[*..]name[,[#][x|s]] [=value]
  692.  
  693.         where [z] is an optional number to specify in which location 
  694.         in the Watch window the variable is to appear. If the [z] is 
  695.         omitted the current contents in the Watch window will scroll up.
  696.  
  697.         Definition of locations:
  698.  
  699.         1.
  700.         2.
  701.         3.
  702.         4.
  703.  
  704.  
  705.     Example:   w2?tbl
  706.     
  707.  
  708. Displaying stack variables using the AV command.
  709.  
  710. AV can be used with or without parameters. Without parameters all stack-
  711. variables will be displayed. With the variable name only the desired
  712. variable will be displayed.
  713.  
  714. By default AV displays values in hex bytes. You may, however, instruct
  715. AV to display values in any format by adding the first character in the
  716. type in which you want the value to be displayed, except that "s" means 
  717. "string". (See the AV paragraph)
  718.  
  719. Examples:
  720.  
  721. AV i i           ;display variable i as an integer.
  722. AV i c           ;display variable i as a character.
  723. AV sune f        ;display variable sune as a float.
  724. AV               ;display all stackvariables.
  725.  
  726.  
  727.  
  728.  
  729.  
  730. @@TRACE
  731.                    The Trace. How it works.
  732.  
  733. The optional trace board provides the possibility of recording what 
  734. the microprocessor is doing. However, if everything is recorded 
  735. you may end up with some useless information. Therefore the Trace 
  736. facility of EMUL51-PC provides a number of means by which the 
  737. trace can be set up to record only the information you want. The 
  738. following describes how the trace is programmed and how the collected
  739. information can be displayed and optionally saved to a file.
  740.  
  741. The Trace Setup screen (TS):
  742.  
  743. The TS screen in entered either from the "Trace" item at the top
  744. menu or from the command line with the TS command. The following 
  745. description refers to the TS screen (see figure below)
  746.  
  747. TRACE  ALL   TRIG     NOTRIG     ITRACE  ALL   TC=  2048  LC=     0 TBR= OFF  
  748. ─────────────────────────────────────────────────────────────────────────────
  749.      ACTIVE?     ADDRESS                DATA               P1          P3     
  750. QRA0 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  751. QRA1 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  752. QRA2 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  753. QRA3 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  754. QRA4 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  755. QRA5 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  756. QRA6 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  757. QRA7 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  758. QRA8 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  759. QRA9 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  760.                                                                               
  761. QRB0 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  762. QRB1 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  763. QRB2 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  764. QRB3 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  765. QRB4 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  766. QRB5 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  767. QRB6 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  768. QRB7 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  769. QRB8 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  770. QRB9 = no  XXXX XXXX XXXX XXXXY  XXXX XXXX XXXX XXXXY  XXXX XXXXY  XXXX XXXXY 
  771.     'space bar': toggle,  Arrow: next field,  Esc: Exit from this screen.     
  772.  
  773.  
  774. There are six programmable fields on top of the screen. These fields
  775. control how the A (QRA0-9) and B (QRB0-9) conditions will be used when
  776. the trace is collecting data during emulation. The TRACE field controls
  777. the filtering mechanism. By default ALL frames are collected. By pressing
  778. the space bar the following options will appear:
  779.  
  780. A           collect frame only when an A-condition is true
  781. B           collect frame only when a B-condition is true
  782. A & B       collect frame only when both A and B are true
  783.  
  784. What is a "true" condition?
  785.  
  786. Each machine cycle of the 8051's execution will present different
  787. address, data and port information. We call the information from one
  788. such cycle a "frame". One frame consists of 16 bits address, 8 bits data,
  789. 8 bits miscellaneous signals, 8 bits from P1 and 8 bits from P3. A total
  790. of 48 bits. For each machine cycle executed by the 8051, the trace board 
  791. compares the 48 bits with the preprogrammed A and B-conditions. Actually 
  792. each condition consists of four separate fields, ADDRESS, DATA, P1 and P3,
  793. and compares are made for each field separately. The result of the compare
  794. for each field is vertically OR'ed (QRA0 - QRA9). The result for each 
  795. field is then AND'ed with the other fields (ADDRESS * DATA * P1 * P3).
  796. This is done independently for both the A and B-conditions. Each "FIELD"
  797. compare has to match exactly with the current data from the active
  798. machine cycle to be true. x'es denote "don't care" and the corresponding
  799. signal can then be either "0" or "1". The "Y" denotes binary. Values
  800. written into the fields without the ending Y are assumed to be hex.
  801.  
  802. Now back to the top line of the TS screen which controls what to do with
  803. the result of every machine cycle compare. As described above the TRACE
  804. field controls the filter mechanism, whether or not to save the collected
  805. frame. The next field is the TRIG field. By default the trigger is off,
  806. NOTRIG. Pressing the space bar brings up more choices:
  807.  
  808. A                trigger on a true A-condition
  809. B                trigger on a true B-condition
  810. A THEN B         first find a true A-condition, then trigger on the next 
  811.                  true B-condition.
  812. A LOOP           trigger when LOOP number of true A-conditions have been 
  813.                  found.
  814. A LOOP THEN B    first find LOOP number of true A-conditions, then 
  815.                  trigger on the next true B-condition.
  816.  
  817.  
  818. The ITRACE field is similar to the TRACE field. It controls a different
  819. filter function. By default ALL frames are saved. By pressing the
  820. space bar two more options will appear:
  821.  
  822. MAIN          trace frames from the main program only.
  823. INT           trace frames from interrupts only.
  824.  
  825. The TC (Trigger Counter) field holds the number of frames to be
  826. collected after a trigger is detected before tracing stops. By
  827. default this number is 2048 (4K trace board) or 8196 (16K trace 
  828. board). This means that you will use half the trace buffer for
  829. pre-trigger frames and half the buffer for post-trigger frames.
  830. Programming a small number into TC would give you more pre-trigger
  831. information while a larger number would give more post-trigger 
  832. information.
  833.  
  834. The LC (Loop Counter) field is used to program the number of loops
  835. to be used by the trigger options (A LOOP and A LOOP THEN B).
  836.  
  837. The TBR (Trace BReakpoint) field is used to connect the trace 
  838. trigger with the breakpoint logic. By default it is OFF. By pressing
  839. the space bar it toggles between ON and OFF.
  840.  
  841. The trace will automatically start when emulation begins. 
  842. When emulation is on, you may view the results of a trace, set up 
  843. new trace conditions, break the trace, and restart it again. When 
  844. emulation ends the trace will automatically stop.
  845.  
  846. Instead of the normal prompt (*) the trace status is shown 
  847. at the bottom of the screen. When a key is pressed trace status 
  848. disappears and you may now enter a trace command. The trace 
  849. status will reappear as soon as the command is executed.
  850. If the ESC key is pressed during trace status, emulation breaks 
  851. unconditionally.
  852.  
  853. Trace Display Commands:
  854.  
  855. There  are two commands that may be used only in emulation 
  856. mode. They are:
  857.  
  858. TE,  Trace End.     Ends a trace "manually".
  859. TB,  Trace Begin.   Starts a new trace. Can be used only if the trace
  860.                     was stopped either by a trigger or by the manual
  861.                     TE command. Works only when the emulator is 
  862.                     running.
  863.  
  864. The collected trace data can be viewed only after the trace has been
  865. halted, either by a trigger or by the TE command. After the emulation
  866. is halted it can of course also be viewed, as the trace is automatically
  867. halted when emulation is stopped.
  868.  
  869. The following commands are used to display the trace:
  870.  
  871. TD,          [start] ;displays trace result in disassembled form.
  872. TDF,         [start] ;displays trace in frame form.
  873. TDL          <start> <TO | LEN> <STOP> [-filename]. ;List without pause
  874.                                                      disassembled form
  875.                                                      optional to disk.
  876. TDFL         <start> <TO | LEN> <STOP> [-filename]  ;As TDL. In frame
  877.                                                      form.
  878. TDP          [start] ;As TD but displays with Port info and ext. address
  879. TDS          [start] ;"Slow trace". From file opened with OST and closed
  880.                        with CST.
  881.  
  882. If [start] is left out, a default number of frames are displayed. 
  883. (Not to exceed one screen). PgUp can then be used to display more
  884. information.
  885.  
  886. Observe that if you use the filter (TRACE field) you must be careful
  887. when you use the TD, TDL, and TDP display commands. This is because the
  888. disassembler is used on the information in the trace buffer. Therefore
  889. if frames are missing from instructions the disassembly may be misleading.
  890. If for instance you program the filter so that only one address is 
  891. collected (over and over) and use the TD command to display the result,
  892. *** PROCESSING INTERRUPT *** will be shown. This is because the address
  893. following the F frame (First byte of an instruction) is the same as
  894. the F frame. This normally indicates an interrupt. This would happen
  895. if the address you traced was in fact an F frame. Otherwise the TD may
  896. not show anything. In other words TDF and TDFL should be used here!
  897.  
  898. For the exact format of each command refer to the detailed 
  899. description of each command.
  900.  
  901. The trace memory is 48 bit wide and 4K deep (16K deep  if 
  902. you have that option). One frame (48 bit) consists of the 
  903. following:
  904.  
  905. - 16 bits address
  906.  
  907. - 8 bit miscellaneous (VF, (Valid Fetch), WR (WRite to external 
  908.   memory), RD (ReaD from external memory), SY1, SY0, INT2, INT1, 
  909.   INT0, (The last three bits indicates interrupt level)
  910. - 8 bit data
  911.  
  912. - 8 bit from P1
  913. - 6 bit from P3
  914. - 2 extra bits. Marked E0 and E1 on the pod.
  915.  
  916. If P1 and / or P3 do not need to be traced, remove the 
  917. jumpers on the pod. That means that 18 of the trace inputs can be 
  918. used to trace external signals. They are easily connected with 
  919. the optional EZ-hook wires.
  920.  
  921. The lower 8 bits of the address are sampled on the trailing 
  922. edge of ALE. The higher 8 bits of the address and P3 are sampled 
  923. on the leading edge of PSEN, READ or WRITE. P1, data and the 8 
  924. miscellaneous signals are sampled on the trailing edge of PSEN, 
  925. READ or WRITE.
  926.  
  927. The display of frame data is organized in the following way:
  928.  
  929. Leftmost column: Frame number
  930.  
  931. Second column:   F = Valid fetch frame
  932.                  R = External memory read frame
  933.                  W = external memory write frame
  934.                  - = none of the above
  935.  
  936. Third column:    Address in hex.
  937.  
  938. Fourth column:   Data in hex
  939.  
  940. Fifth column:    Interrupt level. 0 is main program.
  941.  
  942. Sixth column:    Port 1  / Port 3
  943.  
  944. Seventh column:  SY1, SY0, E1, E0  
  945.  
  946. Eighth column:   Machine cycle count (see below for detailed 
  947.                  explanation)
  948.  
  949. The Machine cycle count can be regarded as a "time stamp". 
  950. If a 12MHz clock or crystal is used, "machine cycles" are 
  951. equivalent to microseconds. If the filter function is used, 
  952. the "count" is only accurate on a relative basis within a 
  953. block of trace frames with contiguous addresses. In other 
  954. words: the counter does not recognize "gaps" in the trace
  955. caused by "filtering out" frames. 
  956.  
  957.  
  958.  
  959. @@BREAK
  960.                    Breakpoints. How they work.
  961.  
  962. Emulation  is  started with the GO command.  The  ending  of 
  963. emulation can occur in a number of ways.
  964.  
  965. 1. Press the ESC key. This will immediately stop emulation and
  966.    allow access to the monitor.
  967.  
  968. 2. A previously set up breakpoint is encountered. A breakpoint
  969.    can only be set up to break on addresses.  It can break on three
  970.    kinds of addresses: Opcode address, Read external memory address, 
  971.    and Write external memory address.  Breakpoints are programmed in 
  972.    the BRx registers where x is 0 - 9. (See BR for details). The BRM 
  973.    register holds the address type(s) that the breakpoints work  on. 
  974.    (See  BRM for details.)  Breakpoints are activated either in  the 
  975.    GR  (Go  Register) register,  by setting the GR or inside the  GO 
  976.    command. (See GR and GO).
  977.  
  978. 3. An external signal SY0.  It works in a number of combinations 
  979.    with breakpoints, set up in GR. SY0 can be programmed active high 
  980.    or active low. This is set up in the SY0A register. (See SY0A).
  981.  
  982. 4. A trace condition. With the TBR register you can use the trace 
  983.    conditions to activate a breakpoint.  This means that you can use 
  984.    any  combination  of the 48 bits wide trace frame  to  trigger  a 
  985.    breakpoint. (See TBR). Observe that all 48 bits are used. If for 
  986.    instance you want to trigger on an address you will probably want 
  987.    to set VF (Valid Fetch, indicating first frame of an instruction) 
  988.    to a "1". Because the trace is delayed a couple of PSEN cycles, 
  989.    the actual break will occur one instruction after where the trace 
  990.    condition was set. This means that the PC (program counter) will 
  991.    show two instructions after the trace condition that caused the 
  992.    break. 
  993.  
  994. 5. If you happen to write a 0 to RD (P3.7) or WR (P3.6) a break
  995.    point is forced. An error line "BREAK OCCURRED BECAUSE RD OR WR 
  996.    IS LOW" is displayed as the first line after the break occurred.
  997.  
  998. 6. The L command sets up breakpoints on all LINE numbers 
  999.    defined in the symbol table. The code is then executed until any
  1000.    of the breakpoints is encountered. Previously activated 
  1001.    breakpoints in the Breakpoint RAM are erased before this command 
  1002.    is executed. Used in PL/M-51 and C-51.
  1003.  
  1004. 7. The BB command sets up breakpoints on all locations where a 
  1005.    specified bit address is written to. Use the GB command to execute.
  1006.  
  1007. 8. The BYB command does the same where a specified byte address 
  1008.    is written to. Use the GB command to execute.
  1009.  
  1010. 9. The IB command lets you specify a pattern of three bytes 
  1011.    where a breakpoint will be programmed. The first byte should be 
  1012.    the hex number for an instruction OP-code while the second and 
  1013.    third can be either numbers or X (don't care). Use the GB command
  1014.    to execute. 
  1015.  
  1016. 10.The BIC command will set up breakpoints on all instructions 
  1017.    which may possibly alter the contents of a specified address to a 
  1018.    specified value or range of values. The breakpoints set up with 
  1019.    BIC should be used in conjunction with the GI command which will 
  1020.    use the breaks to check if the specified condition is reached. If 
  1021.    not the program will resume. Each break will steal approximately 
  1022.    200 microseconds from the program before it returns. If the 
  1023.    condition was reached a regular breakpoint will be taken.
  1024.  
  1025. 11.The BB, BYB, IB, and BIC commands may be used to implement 
  1026.    many "overlayed" breakpoint patterns in the breakpoint RAM. The 
  1027.    breakpoint RAM is always cleared before a GO or an L command is 
  1028.    executed. It can also be cleared with the CLB command.
  1029.  
  1030. 12.The SEB, ABR and GB commands are used to to trap the cause of
  1031.    a program that "jumps out of bounds". See the ABR paragraph). 
  1032.  
  1033. Observe that the instruction where the breakpoint is set will 
  1034. also be executed before the break occurs. This means that the PC 
  1035. will show the next instruction to be executed. (Except TBR. 
  1036. See 4. above).
  1037.  
  1038. note on TIMERS:
  1039. If the timers are active when a break occurs they will keep 
  1040. counting for a couple of cycles before they are stopped by the 
  1041. emulator software. When emulation is then started again the 
  1042. timers will be turned back on by the emulator software a couple 
  1043. of cycles before the actual emulation begins. The following table 
  1044. shows how many cycles are lost:
  1045.  
  1046.                      |T0, T1|  T2  |
  1047. ---------------------|------|------|-------
  1048. EMULATION TO MONITOR:| 8    |  15  |
  1049. MONITOR TO EMULATION:| 6    |  15  |
  1050. ---------------------|------|------|-------
  1051. If this is a problem you will have to manually adjust the timers 
  1052. with these numbers. A macro could be used to do this.
  1053.  
  1054.  
  1055.  
  1056.  
  1057. @@MACRO
  1058.                  MACROS. HOW THEY ARE USED.
  1059.  
  1060. Macros are used to automate the emulation commands. A macro 
  1061. consists of a number of commands. Instead of being input from the 
  1062. keyboard they are read from the macro block. Macros can be saved 
  1063. on a file and later read back into the emulator. They are 
  1064. extremely useful when you need to repeat the same sequence of 
  1065. commands over and over again.
  1066.  
  1067. Another way to repeat and store command sequences is to write them
  1068. in a regular ASCII file and then use the INCLUDE (INC) command to
  1069. execute them. This is also normally faster than macros. (See the INC
  1070. command for details).
  1071.  
  1072. To define a macro you use the DEFINE command. See the DEF 
  1073. paragraph for details. If you create more complex macros it is best
  1074. to use an editor to create a regular ASCII file with the macro 
  1075. definition. If you use the SYSTEM command this can be done without
  1076. leaving the emulator. When you have edited your macro setup you can
  1077. load it into the emulator with the INC command.
  1078.  
  1079. Example: (This could be the contents of a file, except the "*" and ".*")
  1080.  
  1081. *DEF :R                       This defines a macro called R
  1082. .*RESET CHIP                  First command in the macro
  1083. .*GO FROM .START TO .STOP
  1084. .*TD -100
  1085. .*EM                          Ends macro
  1086. *
  1087.  
  1088. To run the macro you simply enter:
  1089.  
  1090. *:R
  1091.  
  1092. The macro can be made more flexible by using parameters. You may 
  1093. use up to 10 different parameters in each macro. The parameters 
  1094. are entered into the macros using the % character followed by a 
  1095. number from 0 to 9.
  1096.  
  1097. Example:
  1098.  
  1099. *DEF :FLEX
  1100. .*XBYTE %0 = %1
  1101. .*GO FROM %2 T %3
  1102. .*XBY %4 L 10
  1103. .*EM
  1104. *
  1105.  
  1106. As we used 5 parameters in the macro (%0 - %4) we must supply the 
  1107. macro with these 5 parameters when we execute the macro. The 
  1108. parameters must be separated by commas:
  1109.  
  1110. *:FLEX 1000,23,.START,.STOP,2000
  1111.  
  1112. So in this case %0 corresponds to 1000, %1 corresponds to 23, and 
  1113. so on. Each parameter can be used any number of times inside the 
  1114. macro. The parameters may appear in any order inside the macro.
  1115.  
  1116. If you use %np in a macro it will be replaced with a number indicating
  1117. the number of parameters (np) that were fed to the macro.
  1118.  
  1119. Instead of creating the macros with the DEFINE command in the emulator
  1120. you can use your editor to edit the "DEFINE block" in a regular ASCII
  1121. file. It can then be loaded into the emulator with the INCLUDE command.
  1122. Especially if you create more complex macros this is the prefered
  1123. methode since it it easy to correct if it should not work immediately.
  1124. Even if you do create the macro directly in the emulator with the
  1125. DEF command you can save it to a file with the PUT command. Then you
  1126. can edit it, (using the SYSTEM command to invoke the editor without
  1127. leaving the emulator), maybe use the REMOVE command to remove the old
  1128. macro and then INCLUDE the edited macro.
  1129.  
  1130. Example:
  1131.  
  1132. * DEF :M                   ;defining a macro in the emulator
  1133. .* LOA TEST.A03
  1134. .* RES CHI
  1135. .* GO FOREVER
  1136. .* EM                      ;end macro
  1137. * PUT A:START.MAC :M       ;save macro to a file
  1138. * SYS WS A:START.MAC       ;edit macro
  1139.  
  1140. (editing the macro using WORDSTAR).
  1141.  
  1142. * REM :M                   ;remove old macro
  1143. * INC A:START.MAC          ;load the new edited macro
  1144.  
  1145. Comments in a macro are allowed. Any line that starts with /* is
  1146. treated as a comment and the command interpreter ignores it.
  1147.  
  1148. Example:
  1149.  
  1150. /* This is a comment line.
  1151. DBYTE 56 = 45
  1152. G F 0 T 1234
  1153. /* Another comment 
  1154.  
  1155.  
  1156. The WRITE command is often used in a macro to have text mixed with
  1157. numbers printed to the screen. It is possible to format the 
  1158. printing of the numbers to the screen:
  1159. We use the same conventions as are used in the "C" language, but the
  1160. "%" sign has been replaced with the "~" sign (tilde).
  1161.  
  1162. The format string is placed after the number to be formatted.
  1163.  
  1164. Examples:
  1165.  
  1166. WRI 'This is an integer: ', XBY 1000,~d
  1167. WRI 'This is a 4-digit hex number with leading zeros: ',DB 26,~04X
  1168. (See the WRI command).
  1169.  
  1170.  
  1171. To list macros use the DIR command. See the DIR paragraph.
  1172.  
  1173. To save a macro use the PUT command. See the PUT paragraph.
  1174.  
  1175. To load a macro use the INC command. See the INC paragraph.
  1176.  
  1177. To  enable or disable macro expansion please refer to the ENA and 
  1178. DIS paragraphs.
  1179.  
  1180. Macros can be programmed to form their own small programs using 
  1181. IF, ORIF, THEN, ELSE structures, or REPEAT, WHILE, UNTIL, or 
  1182. COUNT, WHILE, UNTIL. See the IF, REP, and COU paragraphs for 
  1183. details.
  1184.  
  1185. @@WIN
  1186.  
  1187.                 HOW THE DATA WINDOWS ARE USED.
  1188.  
  1189. The data windows are automatically updated between commands. 
  1190. This causes a short delay after each command. As the specified 
  1191. memory locations are all read, read (RD) signals will go out 
  1192. to the target system if the external data is mapped to the target 
  1193. system (which it is by default). If this causes a problem please 
  1194. disable the window by using DIS XDATA.
  1195.  
  1196. There are four data windows. The REGISTER WINDOW on the top have 
  1197. 18 locations that can be programmed by the user to reflect any 
  1198. memory location in any of the address spaces of the 8051. By 
  1199. default the 18 locations are set up to reflect the most common 
  1200. special function registers (RBYTE) of the 8032. For details on 
  1201. how to change each individual location, please refer to the SWR 
  1202. paragraph. Here is an example how to change location 5 to reflect 
  1203. address 1E85H in external memory. The symbol name that we have 
  1204. chosen is A_VALUE:
  1205.  
  1206. SWR 5 XBYTE A_VALUE 1E85
  1207.  
  1208. The DATA window reflects 24 contiguous memory locations in the 
  1209. internal data memory. The first location is 20H by default but 
  1210. can be set up to any position between 0 and E7H. For details 
  1211. please see the SWD paragraph. This example changes the first 
  1212. address to 60H:
  1213.  
  1214. SWD 60
  1215.  
  1216. The XDATA window reflects 24 contiguous memory locations in the 
  1217. internal data memory. The first location is 4000H by default but 
  1218. can be set up to any position between 0 and FFE7H. For details 
  1219. please see the SWX paragraph. This example changes the first 
  1220. external address to 0H:
  1221.  
  1222. SWX 0
  1223.  
  1224. Both the DATA and XDATA windows may be moved around on screen. You 
  1225. may also change size on them using the function keys on the bottom of
  1226. the screen. 
  1227.  
  1228. The STACK window always reflects the stack. It shows max. nine 
  1229. positions of the stack starting with the byte to which the 
  1230. stack pointer is currently pointing. The contents of the stack is 
  1231. then shown in descending order.
  1232.  
  1233. The static window is by default enabled. It can, however, be 
  1234. disabled using the DISABLE command or the F6 key. See the 
  1235. DIS paragraph for details.
  1236.  
  1237. DIS WINDOW
  1238.  
  1239. It may then be reenabled by using the ENABLE command or press
  1240. F6 again. See the ENA paragraph for details.
  1241.  
  1242. ENA WINDOW
  1243.  
  1244. You can move the windows and expand them using the F4 and F5
  1245. function keys.
  1246.  
  1247. Inside the DATA or XDATA window you can use PgUp and PgDn to
  1248. scroll information.
  1249.  
  1250. It is also possible to save set ups to a file using the SAW 
  1251. command. See the SAW paragraph for details.
  1252.  
  1253. SAW A_SETUP
  1254.  
  1255. Set ups can the be loaded back using the LOW command. See the LOW 
  1256. paragraph for details.
  1257.  
  1258. LOW A_SETUP
  1259.  
  1260. By using many set up files you can switch the static window to 
  1261. reflect different parts of the memory. By using macros to do that 
  1262. you could switch windows using only three key strokes!
  1263.  
  1264. @@BANK
  1265.  
  1266.                BANK SWITCHING. (SOFTWARE).
  1267.  
  1268. Many users are breaking through the 64K code barrier for 8051 based 
  1269. chips. The problem for Nohau is that everybody uses different 
  1270. schemes to implement the bank switching hardware. Our solution 
  1271. for now will be to modify the emulator board to mimic individual 
  1272. targets' bank switching schemes.
  1273.  
  1274. We have attempted to find a universal solution to the problem of
  1275. connecting symbols and source level debugging to bank switching. 
  1276. It is probably not sufficient to cover all needs, so please 
  1277. contact us so that we can discuss your problems.
  1278.  
  1279. The emulator must be started with the -m32 switch even though
  1280. the emulator has 128K installed.
  1281.  
  1282. If the emulator is used without bankswitching there will be 64K
  1283. of overlaid memory. (CODE and XDATA). In this case the "bankswitch
  1284. cables" should be left unconnected.
  1285.  
  1286. Breakpoints involving bank can only be done using the trace.
  1287. The TBR should be ON and bank programmed in E1, E0 which are 
  1288. located in the two most significant bits of P3 in all "external
  1289. pods".
  1290.  
  1291. The following commands can be used:
  1292.  
  1293. BANKBYTE [address] [memtype]
  1294.  
  1295.     Where [address] is a dedicated address either in internal data 
  1296.     memory, DB, or in external data memory, XB. The contents of
  1297.     this address must "shadow" current bank. In other words: the
  1298.     user's bank switching code must write to this address when 
  1299.     bank switching is done. 
  1300.  
  1301. BANK [bank] 
  1302.  
  1303.    Displays or sets current bank. Actually displays or sets the 
  1304.    contents of BANKBYTE.
  1305.  
  1306. BANKADDRESS [address1] TO [address2]
  1307.  
  1308.     Where [address1] TO [address2] is the "banked address area".
  1309.  
  1310.     This command MUST be issued BEFORE the user file is loaded.
  1311.     This is because the loader uses this information to "mark" 
  1312.     the bank number.
  1313.  
  1314.     The default values are 8000 TO FFFF
  1315.  
  1316. BANKSEGMENT [number] [segment name]
  1317.  
  1318.     Where [number] can be 1, 2 or 3. [segment name] is the segment
  1319.     name in the symbol table that your assembler or compiler must
  1320.     produce. At this point only Intel's OMF is supported. Many 
  1321.     segments can be associated with one bank, but you must enter 
  1322.     them one by one (see example below). All symbols in a bank
  1323.     should be covered by the correct number of segments present
  1324.     in that bank. Segment and bank boundaries should coincide.
  1325.  
  1326.     This command should be issued BEFORE the user file is loaded if
  1327.     you use the "segment method" to indicate bankswitch while loading
  1328.     symbols. (See below). This is because the loader uses this 
  1329.     information to "mark" the bank number.
  1330.  
  1331. Using any of the BANKBYTE, BANKADDRESS or BANKSEGMENT commands
  1332. to assign new values will enable "bank handling" of symbols.
  1333.  
  1334. There is no way to reset "bank handling", except to exit EMUL51
  1335. and restart.
  1336.  
  1337. All actual bankswitching, (meaning writing to the hardware) is performed
  1338. either from the customers code or by commands in monitor mode. Normally
  1339. a macro would be used to save typing. In some cases the loader can
  1340. perform bankswitching "automatically". This will work through a special
  1341. macro that the user must define - BANKSWITCH. See examples below.
  1342.  
  1343. As mentioned above there are different ways to let the loader know which
  1344. bank number should be assigned to which symbol. Any CODE symbol that has
  1345. a value which is within the range specified by the BANKADDRESS command
  1346. will be assigned the number in the byte defined by the BANKBYTE command.
  1347. The segment information in the load file (using INTEL OMF format) will
  1348. automatically switch the contents of "bankbyte" according to the 
  1349. information specified by the BANKSEGMENT command(s). If segments are 
  1350. not used, all CODE symbols in a file within the "bankaddress range"
  1351. will get the same bank number, namely the number in "bankbyte".
  1352.  
  1353. In other words, if you don't use the "segment" method you must change
  1354. the bankbyte before and between loading files. Use BANK [bank number]
  1355. to do this.
  1356.  
  1357.  
  1358. Example 1: (using files without segments)
  1359.  
  1360. BANKBYTE 38 DB            ;internal data address 38 is used 
  1361.                            as "bankbyte"
  1362. BANKADDRESS 0 TO FFFF     ;all 64K is bankswitched!
  1363. BANK 1                    ;symbols in FILE1 belong to bank 1
  1364. :SWITCH 1                 ;invoke macro to switch hardware to bank 1
  1365. LOAD FILE1                ;load FILE1
  1366. BANK 2                    ;symbols in FILE2 belong to bank 2
  1367. :SWITCH 2                 ;switch hardware to bank 2
  1368. LOA FILE2                 ;load FILE2
  1369.  
  1370. Example 2: (using files with segment info)
  1371.  
  1372. BANKBYTE E023 XB          ;external data address E023 is used
  1373.                            as "bankbyte"
  1374. BANKADDRESS 8000 TO FFFF  ;upper 32K bankswitched!
  1375. BANKSEG 1 SEGMENT1        ;specify banks in different segments
  1376. BANKSEG 1 SEGMENT2
  1377. BANKSEG 1 SEGMENT3
  1378. BANKSEG 1 SEGMENT4
  1379. BANKSEG 2 SEGM1
  1380. BANKSEG 2 SEGM2
  1381. BANKSEG 2 SEGM3
  1382. LOA BASEBANK.OBJ          ;load. Should be addresses 0 to 7FFF
  1383. :SWITCH 1                 ;switch hardware to bank 1
  1384. LOA BANK1.OBJ             ;load bank 1. SEGMENT info should come
  1385.                            before any banked symbols. Otherwise
  1386.                            such symbols will be banked to whatever
  1387.                            is in "bankbyte"
  1388. :SWITCH 2
  1389. LOA BANK2.OBJ
  1390. :SWITCH 3
  1391. LOA BANK3.OBJ
  1392.  
  1393. Where :SWITCH is a macro that could be defined as follows:
  1394.  
  1395. DEF :SWITCH
  1396. RBY .P1 = %0     ;if P1 is used for bank switching
  1397. DBY 32=%0        ;BANKBYTE set to internal address 32H
  1398. EM
  1399.  
  1400.  
  1401. The  LOA 
  1402.      :SWITCH 
  1403. above could be defined as a macro called LOAD for
  1404. example. In that case loading the program would be very easy:
  1405.  
  1406. :LOAD
  1407.  
  1408. Here are more examples of how bank switching could be set up:
  1409.  
  1410. BANKSEG 1 SEGMENT1           ;SEGMENT 1 is in bank 1. This also 
  1411.                               initiates bank switching.
  1412. BANKSEG 1 SEG_SUB            ;This segment is also in bank 1. 
  1413.  
  1414. BANKSEG 2 SEGMENT2           ;SEGMENT 2 is in bank 2.
  1415.  
  1416. BANKADDRESS 8000 TO FFFF     ;Specify between which addresses bank
  1417.                               switching is done.
  1418. BANKBYTE 32 DB               ;Byte 32H in internal data memory must
  1419.                               indicate current bank. User code or
  1420.                               "switch macro" should change this byte
  1421.                               to "shadow" current bank.
  1422.  
  1423.  
  1424. As mentioned above bankswitching can be performed while the code is
  1425. loaded. At present this works for INTEL OMF with SEGMENT INFORMATION
  1426. as described above. It also works for IAR / Archimedes.  When the
  1427. loader detects that bankswitching needs to be done it checks to
  1428. see if a user defined macro called BANKSWITCH is present. If so,
  1429. it calls the macro with one parameter namely the bank number.
  1430.  
  1431. Example of how a BANKSWITCH macro might look. We assume in this 
  1432. example that P1.0 is used for switching and that BANK 1 is 
  1433. switched in when P1.0 is 0 and that BANK 2 should be switched in
  1434. when P1.0 is 1. (%0 in the example is used for the first parameter,
  1435. in this case the bank number).
  1436.  
  1437. DEF :BANKSWITCH
  1438. IF %0 EQ 1
  1439. RBI .P1+0=0
  1440. ENDIF
  1441. IF %0 EQ 2
  1442. RBI .P1+0=1
  1443. ENDIF
  1444. EM
  1445.  
  1446.  
  1447. Each user must create BANKSWITCH according to how bankswitching
  1448. is implemented is his target system.
  1449.  
  1450. __________________________________________________________________
  1451. SCOPE [module]
  1452.  
  1453. This command displays the scope of the code that was loaded for
  1454. each module. If the code is in a bank as defined by BANKSEG 
  1455. it is indicated.
  1456.  
  1457. Examples:
  1458.  
  1459. SCOPE               ;display code scope of all modules
  1460. SCOPE CMD_INT       ;display code scope of module CMD_INT
  1461. ___________________________________________________________________
  1462. SYM ? ? SEGMENT 
  1463.  
  1464. shows all segments loaded.
  1465. ____________________________________________________________________
  1466.  
  1467. TRACING DURING BANK SWITCHING.
  1468.  
  1469. When bank switching is activated (by using the BANKSEG command) 
  1470. the trace will use E1 and E0 to trace active bank. E1 and E0 are 
  1471. available on the pod board as "wire wrap posts". When nothing is 
  1472. connected a "1" will be traced. The following combinations on
  1473. E1 and E0 indicate current bank:
  1474.  
  1475. E1   E0
  1476. 0    0   bank 0
  1477. 0    1   bank 1
  1478. 1    0   bank 2
  1479. 1    1   bank 3
  1480.  
  1481. The result will be that the correct symbols will be shown 
  1482. according to the bank indicated by the values traced at E1 and E0.
  1483.  
  1484.  
  1485. @@COM
  1486.                 SHORTFORM LIST OF SOME COMMANDS.
  1487.               (Shortest form shown in upper case)
  1488.  
  1489. AAsm, ABr     DP             LC          REMove       TD       
  1490. ACc           DEFine         LIst        REPeat       TD
  1491. ADjust        DIR            LOad        RESet        TDF
  1492. Asm           DISable        LOW         R0 - R7      TDFL
  1493. AV            DOMain         MACro       SAVe         TDL             
  1494. B             DPTr           :"macro"    SAW, SEB     TDP
  1495. BB            ENable         MAPC        SEconds      TDS 
  1496. BIc           Evaluate       MAPX        SLM          TDFS        
  1497. BRx           EXit           NOsnow      STAck        TE 
  1498. BRM           Fill           OST         Step         TM0  
  1499. BRS           GB             P1          SN           TM1 
  1500. BYB           Go             P3          SUffix       TS   
  1501. CALC          GI             PByte       SP           TSGet
  1502. CByte         GR             PC          SWD          TSPut
  1503. CLb           GS             PPA         SWR          UNTil
  1504. COUnt         IB             PUT         SWX          Ver 
  1505. CST           IF             RBit        SY0a         WAit  
  1506. CW            INClude        RBS         SYMbols      WHile
  1507. Dasm          INTerrupt      RByte       SYStem       WRite
  1508. DByte         L              Registers   TB           Xbyte  
  1509.  
  1510.                 LIST OF SOME AVAILABLE COMMANDS.
  1511.                   (with short explanation)
  1512.  
  1513. AAsm                  Enter Automatic Assembly mode.
  1514. ABr                   Automatic Breakpoint Remove. "Out of bounds"
  1515.                       checking of code memory. Use with SEB and GB.
  1516. ACC                   Displays or sets accumulator.
  1517. ADjust                Adjust position and size of windows.
  1518. Asm                   One line assembler command.
  1519. AV                    Autovariables. View stack variables in C-51.
  1520. B                     Displays or sets the B register. (See ACC 
  1521.                       paragraph).
  1522. BB                    Set up Break on direct write to Bit address. 
  1523. BIC                   Set up Break on Internal Contents.
  1524. BRx                   BReakpoint registers. x is 0 - 9.
  1525. BRM                   BReakpoint Mode register.  OP (opcode),  RD 
  1526.                       (ReaD), WR (WRite) or any combination of 
  1527.                       them.
  1528. BRS                   Breakpoint Register Slow. Used with GS 
  1529.                       command.
  1530. BYb                   Set up Break on direct write on BYte address.
  1531. CAlc                  Calculate checksum in code memory.
  1532. CBYte                 Display or set contents of user code bytes.
  1533. CLB                   CLear Breakpoint RAM
  1534. COunt                 Begins block of commands to be executed
  1535.                       a specified number of times.
  1536. CSt                   Close Step Trace file. See OST command.
  1537. CW                    Code Window. Toggle ON/OFF.
  1538. Dasm                  Disassemble program memory.
  1539. DBYte                 Display or set contents of internal data. 
  1540.                       Address 0 - 7FH. (See CBY paragraph).
  1541. DP                    Disassemble from where PC points.
  1542. DEfine                Define macro or Define symbol.
  1543. DIR                   Displays directory of macros.
  1544. DIsable               Disable Macro expansion or Disable symbols
  1545.                       in Disassembly listings.
  1546. DOmain                Displays or sets default module name
  1547. DPTr                  Displays or sets Data Pointer (DPTR).
  1548. ENable                Enable Macro expansion or Enable symbols
  1549.                       in Disassembly listings.
  1550. Evaluate              Evaluate expression.
  1551. EXit                  Terminates the EMUL51-PC and returns to DOS
  1552. Fill                  Fills a specified memory area with a 
  1553.                       specified value.
  1554. GB                    Go till Breakpoint. Use after BB, BYB, etc.
  1555. Go                    Starts emulation.
  1556. GI                    Go till Internal register contents match.
  1557. GR                    Go Register. For break conditions.
  1558. GS                    Go Slow. Automatic single stepping. Can 
  1559.                       break on internal memory contents.
  1560. IB                    Set up Instruction Break.
  1561. IF                    Begins a block of commands to be executed
  1562.                       when the condition following IF is TRUE.
  1563. INClude               Reads a sequence of commands from the
  1564.                       indicated drive and file.
  1565. INTerrupt             Displays interrupt status.
  1566. L                     Line Step. Single step on PL/M-51 or C-51 
  1567.                       linenumbers.
  1568. LC                    Display or set the  Loop  Counter.  (Trace 
  1569.                       command. Also see TRA paragraph) 
  1570. LIst                  Outputs a copy of everything which is
  1571.                       printed on the screen to a specified device
  1572.                       or file.
  1573. LOAd                  Loads user program and symbol table from
  1574.                       indicated drive and file.
  1575. LOW                   LOad Window file.
  1576. MACro                 Displays the definitions of the indicated
  1577.                       macros.
  1578. : "MACRO NAME"        Invokes a previously defined macro. 
  1579. MAPC                  Map code memory to emulator or target.
  1580. MAPX                  Map external data memory to emulator or
  1581.                       target. 
  1582. NOsnow                Use if you get "snow" on the screen when 
  1583.                       using the static window   
  1584. OSt                   Open Step Trace file. Trace buffer from 
  1585.                       single steps.
  1586. P1, P3                Display or set ports P1 or P3. (See ACC 
  1587.                       paragraph).
  1588. PByte                 Display or set contents of external memory
  1589.                       without read back check. See CBY paragraph.
  1590. PC                    Displays or sets the Program Counter (PC)
  1591. PPA                   Program Performance Analyzer.
  1592. PUt                   Stores one or more macro definitions on
  1593.                       indicated drive and file.
  1594. RBIt                  Display or set bit memory.
  1595. RBS                   Display or set the register bank select.
  1596. RByte                 Display or set contents of special
  1597.                       registers. (Internal addresses 80H - FFH).
  1598.                       (See CBY paragraph). 
  1599. Registers             Display internal registers.
  1600. REMove                Remove Macro or Remove Symbol.
  1601. REPeat                Begins a block of commands to be repeated.
  1602. RESet                 Reset BRx, QRx, EM, or CHIP.
  1603. R0 - R7               Display or set Rx of current register bank.  
  1604.                       x = 0 - 7.
  1605. SAVe                  Copies user program and symbol table to
  1606.                       specified drive and file.
  1607. SAW                   SAve Window setups.
  1608. SEB                   SEt Breakpoints. Sets all 64K bits in the break-
  1609.                       point memory to 1's.
  1610. SEConds               Displays execution time counter. (Number of 
  1611.                       cycles since emulation started).
  1612. SLM                   Set Line numbers MCC C-compiler.
  1613. STAck                 Displays the contents of the stack and the
  1614.                       stack pointer value.
  1615. Step                  Executes  one instruction,  then  breaks. 
  1616.                       (Single step).
  1617. SN                    Step Next. Straight single step. Skips over 
  1618.                       subroutine calls, branches and interrupts.
  1619. SUffix                Displays or sets the default radix for
  1620.                       numbers entered to the emulator.
  1621. SP                    Display or Set Stackpointer. (See ACC).
  1622. SWD                   Setup Window Data address.
  1623. SWR                   Setup Window Registers.
  1624. SWX                   Setup Window eXternal data address.   
  1625. SY0A                  SY0 input. Active high or active low.
  1626. SYMbols               Displays all user defined symbols and
  1627.                       their values.
  1628. SYStem                Used to leave the emulator temporarily to
  1629.                       execute a DOS command.
  1630. TB                    Trace Begin.  Works only during emulation. 
  1631.                       (See TRA paragraph).
  1632. TBR                   Trace BReakpoint. This register can be set
  1633.                       ON for using the trace trig to activate
  1634.                       breakpoints, or OFF. 
  1635. TD                    Trace Display. Disassembled form.
  1636. TDF                   Trace Display Frame. Display in frame form.     
  1637. TDFL                  Trace Display Frame. No pause. File output 
  1638.                       option.
  1639. TDL                   Trace Display. Disassembled form. No pause. 
  1640.                       File output option.
  1641. TDP                   Trace Display with Ports and external data 
  1642.                       addresses.
  1643. TDS                   Trace Display Step. Displays trace from 
  1644.                       single steps in mnemonic form. Works only
  1645.                       after OST command.
  1646. TDFS                  Trace Display Frame Step. As TDS but in 
  1647.                       frame form. 
  1648. TE                    Trace End.  Works only  during  emulation. 
  1649.                       (See TRA paragraph).
  1650. TM0, TM1              Display or set Timer 0 or Timer 1. Word. 
  1651.                       (See DPT paragraph).
  1652. TS                    Trace Setup. Static screen for trace setup. 
  1653. TSGet                 Load a trace set up from a file.
  1654. TSPut                 Save a trace set up to a file.
  1655. UNTIL                 See COUNT and REPEAT commands
  1656. Ver                   Display software version number.
  1657. WAit                  Waits for a key stroke.
  1658. WHIle                 See COUNT and REPEAT commands
  1659. WRIte                 Displays an evaluated expression or a
  1660.                       string of characters on the screen.
  1661. XByte                 Display or set contents of external memory 
  1662.                       with read back check. (See CBY paragraph).
  1663.  
  1664.  
  1665. @@AASM
  1666.  
  1667.                  AASM. Automatic in-line ASseMbler.
  1668.  
  1669. abbreviation: AA
  1670.  
  1671. format:
  1672.        AASM
  1673.  
  1674. Description:
  1675.  
  1676. AASM enters a mode where you can only input instructions or ORG. To quit
  1677. this mode press ENTER at the prompt. (Works like the ASM command except
  1678. that you don't have to enter ASM (or A) in front of each instruction. 
  1679. Also see the ASM command.
  1680.  
  1681. Example:
  1682.  
  1683. AASM
  1684.  
  1685. @@ABR
  1686.  
  1687.                  Automatic Breakpoint Remove.
  1688.  
  1689. abbreviation: AB
  1690.  
  1691. format:
  1692.        ABR <start address> TO <stop address>
  1693.  
  1694. Description
  1695.  
  1696. The ABR command is always used in conjunction with the SEB command 
  1697. (SEt Breakpoints) and the GB command (Go till Breakpoint). First the
  1698. SEB command is issued to set the complete 64K bit breakpoint to all 
  1699. 1's. Using the GB command at this point would break immediately at the
  1700. first instruction. The ABR command, however, should first be used to
  1701. remove breakpoints from all opcode addresses which are within the legal
  1702. program. Normally, legal code resides in a number of different blocks
  1703. within the 64K address space of the 8051. Breakpoints must be removed 
  1704. from each of these blocks separately. The ABR will remove only the
  1705. breakpoint of the first byte in each instruction. Second and third
  1706. bytes will still have breakpoints. Data tables within the code must be
  1707. taken into consideration. If you should include a data table within a
  1708. block of legal instructions the ABR will treat the data table as if
  1709. it were instructions which will then remove breakpoint from some bytes
  1710. of the data table and then possibly on the wrong bytes of the rest of
  1711. the block. (Because the breakpoint removing program will get out of
  1712. sync). It is therefore extremely important that you remove breakpoint
  1713. from all legal program blocks, but it is equally important that they
  1714. are only removed from legal program blocks. Legal program blocks include
  1715. the RESET vector at address 0 as well as any active interrupt vectors.
  1716. The GB command should then be used. Now if code is executed outside
  1717. of the legal blocks that you programmed, a breakpoint will occur. By
  1718. looking back in the trace you should be able to figure out what caused
  1719. it to happen. Without the trace option it may be more difficult to see
  1720. exactly what actually happened. (Do NOT use the GO command, it will erase
  1721. all breakpoint and put in new breakpoints according to the BR registers).
  1722.  
  1723. Note: Breakpoints on code between FFFC and FFFF cannot be removed. You 
  1724. will get Error Message "STOP VALUE TOO BIG" if you try.
  1725.  
  1726. Example:
  1727.  
  1728. SEB                     ;set all breakpoints
  1729. AB 0 TO 0               ;remove breakpoint on reset vector
  1730. AB 13 TO 13             ;remove breakpoint on external int 1 vector
  1731. AB 100 TO 45F           ;remove breakpoints from legal program block
  1732.                          100H to 45FH
  1733. AB 470 TO 1134          ;remove breakpoints from legal program block
  1734.                          470 to 1134. Maybe there was a data table 
  1735.                          between 460 and 470.
  1736. RES CHI                 ;start from scratch (not neccesary)
  1737. GB                      ; Go till Breakpoint.
  1738.  
  1739.  
  1740.  
  1741. @@ADJ
  1742.  
  1743.                  ADJUST. Adjust windows command.
  1744.  
  1745. abbreviation: AD
  1746.  
  1747. format:
  1748.        ADJUST
  1749.  
  1750. Description
  1751.  
  1752. The ADJUST command will make the ADJUST window appear on the screen. Here
  1753. you can choose which window to adjust. You can also use the function keys
  1754. F4, F5 to do the same thing.
  1755.  
  1756. Example:
  1757.  
  1758. AD
  1759.  
  1760.  
  1761.  
  1762. @@ASM
  1763.                         THE ONE LINE ASSEMBLER.
  1764.  
  1765. abbreviation: A
  1766.  
  1767. format:
  1768.  
  1769.       ASM [ORG address]
  1770.           [instruction]
  1771.  
  1772.     ASM will either display or set the EMUL51-PC's assembly 
  1773. pointer, or assemble one instruction into code memory at the 
  1774. assembly pointer location. It displays the updated assembly 
  1775. pointer after assembling any instruction.
  1776.  
  1777. Addresses of JUMP and BRANCH instructions are written as absolute 
  1778. addresses. The one line assembler will automatically calculate 
  1779. the offset in the case of a relative jump.
  1780.  
  1781. Bits are denoted using a "+" and not a "."
  1782.  
  1783. Example:    A JNB  .P1+4,.LOOP
  1784.             A CLR  .ACC+2
  1785.             A SETB .B+5
  1786.  
  1787. ORG
  1788.  
  1789.     Sets the assembly pointer to the specified address.
  1790.  
  1791.  
  1792. instruction
  1793.  
  1794.     Any valid instruction mnemonic except CALL and JMP, which are 
  1795. "generic instructions".
  1796.  
  1797. Examples:
  1798.  
  1799. A                      ;displays assembly pointer
  1800.  
  1801. A ORG 200H             ;sets assembly pointer to 200H
  1802.  
  1803. A CJNE A,.DAT,.LOOP    ;assembles instruction
  1804.  
  1805. A JB .P1+5,1000              ;An offset to address 1000H will be 
  1806.                         calculated from the current position.
  1807.  
  1808.  
  1809. @@ACC
  1810.  
  1811.              Display and Set Commands for special registers.
  1812.  
  1813. Format:
  1814.       ACC [= <value>]
  1815.       B [= <value>]
  1816.       P1 [= <value>]
  1817.       P3 [= <value>]
  1818.       SP [= <value>]
  1819.  
  1820. Examples:
  1821.  
  1822. ACC              ;Display contents in the Accumulator.
  1823. ACC = 68         ;Set Acc to 68H.
  1824. B                ;Display contents in the B register.
  1825. B = 54           ;Set the B register to 54H.
  1826. SP               :Display contents in the SP register.
  1827. SP = 30          ;Set SP to 30H
  1828. P1 = FA          ;Set Port P1 to FAH.
  1829. P3 = C0          :Set Port P3 to C0H.  (Always keep P3.6 and P3.7 
  1830.                   high. Except POD-51).
  1831.  
  1832.  
  1833. @@AV
  1834.  
  1835.                    Autovariable command.
  1836.  
  1837. format:
  1838.        AV [C stackvariable] [type (i, c, u, s, f, l)]
  1839.  
  1840. For a detailed discussion of this command and Source Level debugging
  1841. in general please refer to the SDL paragraph in this document. If
  1842. you use this via the help window in the emulator this paragraph is
  1843. found under the "Help" and "SourceDeb." items as "Source Level 
  1844. Debugging".
  1845.  
  1846. @@BASE
  1847.  
  1848.                     The BASE command
  1849.  
  1850. format:
  1851.        BASE
  1852.        BASE [H,T]
  1853.  
  1854.  
  1855. @@BB
  1856.                     Break on write to Bit address
  1857.  
  1858. format:
  1859.        BB <bit address>
  1860.  
  1861. <bit address> is between 0 and FFH. This command will go through 
  1862. the entire code memory and look for the following instructions:
  1863.  
  1864. CLR bit
  1865. CPL bit
  1866. JBC bit, rel
  1867. MOV bit, C
  1868. SETB bit
  1869.  
  1870. When any of them is found a corresponding breakpoint is activated 
  1871. in the breakpoint RAM. Then when the GB command is used these 
  1872. breakpoints will break the program when a bit is written to the 
  1873. specified bit address. NOTE only DIRECT bit writes will work. You 
  1874. can combine with the BYB command. (See the BRK paragraph).
  1875.  
  1876. Examples:
  1877. BB 4                    ;set up breakpoints on bit writes to bit 
  1878.                          address 4
  1879. BB .EA                  ;set up breakpoints on bit writes to the 
  1880.                          EA bit address. (In the IE register).
  1881.  
  1882.  
  1883. @@BIC
  1884.  
  1885.                  BIC. Set Breakpoints on Internal Contents.
  1886.  
  1887. abbreviation: BI
  1888.  
  1889. format:
  1890.       BIC <address>, <low value>, <high value>, <low code address>,
  1891.           <high code address>, <type>
  1892.  
  1893. <address>            is the byte address of either an internal 
  1894.                      data byte (DBYTE) or a Special Function 
  1895.                      Register (SFR).
  1896.  
  1897. <low value>          is the lower limit of values on which to break.
  1898.  
  1899. <high value>         is the higher limit of values on which to break.
  1900.  
  1901. <low code address>   start address for "code scan".
  1902.  
  1903. <high code address>  stop address for "code scan".
  1904.  
  1905. <type>               must be DB (DBY, DBYT, DBYTE) or RB (RBY, RBYT, 
  1906.                      RBYTE)
  1907.  
  1908.  
  1909. Description:
  1910.  
  1911. BIC will scan the specified code area between <low code address> and 
  1912. <high code address> for all instructions, that if executed, can change 
  1913. the contents of the specified <address>. On all such instructions a 
  1914. breakpoint will be set at its corresponding code address. These 
  1915. breakpoints will be treated as regular breakpoints if you use the GB 
  1916. command to execute the code. In other words this would work as BB, 
  1917. BYB and IB. When using the GI command, however, the breakpoint 
  1918. will be taken, but if the contents of the address specified in BIC 
  1919. is not between (and including) <low value> and <high value>, the 
  1920. program execution will resume. This check takes approximately 580 
  1921. cycles which is equivalent to 580 us if a 12MHz crystal is used. 
  1922. For the "bondout PODs" (POD-C51B, POD-C552B, POD-C751, and POD-C517
  1923. it takes about 1050 us). (See GI for more details).
  1924.  
  1925. Before the command is executed the question "Do you want to clear
  1926. previous breakpoints (Y/N): " is asked. Press Y (or y) if you want them
  1927. to be erased. Any other keystroke will be interpreted as N (NO). The
  1928. breakpoints we talk about here are "hardware RAM breakpoints" and does
  1929. not affect the BRx registers which are used for GO.
  1930.  
  1931. Different categories of instructions can change the contents of an internal 
  1932. address. When BIC is executed, messages will be written on the screen, 
  1933. telling which category is presently scanned for. The following messages can 
  1934. be seen:
  1935.  
  1936. Scanning code (Direct byte). Takes time. Please wait...
  1937. Scanning code (Direct bit). Takes time. Please wait...
  1938. Scanning code (Indirect byte). Takes time. Please wait...
  1939. Scanning code (Register). Takes time. Please wait...
  1940. Scanning code (DPL, DPH). Takes time. Please wait...
  1941. Scanning code (PUSH). Takes time. Please wait...
  1942. Scanning code (CALL). Takes time. Please wait...
  1943. Scanning code (B-REG). Takes time. Please wait...
  1944.  
  1945. Direct byte:     Direct write to a byte address, like MOV addr,A. See BYB 
  1946.                  for a listing of all "direct write byte" instructions.
  1947.  
  1948. Direct bit:      Direct write to a bit address, like CLR bit. See BB for a
  1949.                  listing of all "direct write bit" instructions.
  1950.  
  1951. Indirect byte:   Only in the DBYTE area. Scanning occurs for the following 
  1952.                  instructions: (In the following the "at" sign is replaced
  1953.                  with a "*" because the "at" can't be used in the help text.
  1954.                  INC *R0; INC *R1; DEC *R0; DEC *R1; MOV *R0,#data;
  1955.                  MOV *R1,#data; MOV *R0,data; MOV *R1,data; XCH A,*R0;
  1956.                  XCH A,*R1; XCHD A,*R0; XCHD A,*R1; MOV *R0,A; MOV *R1;
  1957.  
  1958. Register:        Only in the DBYTE area on addresses under 20H. Scanning 
  1959.                  occurs for the following instructions:
  1960.                  INC Rn; DEC Rn; MOV Rn,#data; MOV Rn,data; XCH A,Rn
  1961.                  DJNZ Rn,addr; MOV Rn,A;  where n is 0 - 7.
  1962.  
  1963. DPH, DPL:        Only in the RBYTE area. Direct byte writes already covered
  1964.                  by "Direct byte" above. The following two instructions can
  1965.                  however also influence DPH and DPL:
  1966.                  MOV DPTR, #data; INC DPTR;
  1967.  
  1968. PUSH, CALL:      Only in the DBYTE area and for SP (81H) in the RBYTE area.
  1969.                  Following instructions:  PUSH data; any of the "CALL"
  1970.                  instructions (ACALL, LCALL)
  1971.  
  1972. B-REG:           Only for the B-register (F0H) in the RBYTE area. Direct
  1973.                  writes to B are covered by "Direct byte" above. The 
  1974.                  following two instructions can however also influence B:
  1975.                  DIV AB; MUL AB;
  1976.  
  1977.  
  1978. The following SFR:s are not fully covered:
  1979.  
  1980. ACC (E0H)
  1981. PSW (D0H)
  1982.  
  1983. All timer registers (TH0, TL0, TH1, TL1, TH2, TL2)
  1984.  
  1985. Port pins are covered but not Port latches. See Read-Modify-Write in 8051
  1986. data books for details.
  1987.  
  1988. All SFR:s where hardware directly changes bits. Like TCON, SCON and SBUF.
  1989.  
  1990.  
  1991. note 1. If, when you use GI, a breakpoint is not reached and you use ESC to
  1992.         manually break, you will get WRITE TIMEOUT and READ TIMEOUT errors.
  1993.         This is because the code which is handling breakpoints is modified
  1994.         to check if the contents of the specified address is within range.
  1995.         If this occurs YOU MUST ISSUE THE COMMAND "* RES EMUL" which 
  1996.         reloads the 8051 overlay code.
  1997.  
  1998. note 2. When you look back in the trace buffer after a break has occured 
  1999.         after using the GI command you will see the instruction:
  2000.  
  2001.                     JBC .IE+7(EA),addr 
  2002.  
  2003.                            or 
  2004.  
  2005.         if you use the TDF command a number of frames starting with the
  2006.         following data: 
  2007.  
  2008.                     10 AF 01 00
  2009.  
  2010.         This is because the trace will always sample the first instruction
  2011.         in the breakpoint handling routine (which is JBC .EA, addr) before
  2012.         it turns off. This is normally taken care of in software so you will
  2013.         not see it. In this case we decided to let it show for a number of
  2014.         reasons: You get an indication where "check breaks" were taken. It
  2015.         is also difficult to remove part of the trace without inadvertently
  2016.         removing "valid" trace frames.
  2017.  
  2018.         For the "bondout pods" the above would be something like:
  2019.  
  2020.  
  2021.      POD-C51B, POD-C552B, POD-C652B:
  2022.  
  2023.                     NOP              00, 00, F5, 9F       in TDF
  2024.                     MOV 9F,A          
  2025.  
  2026.      POD-C517, POD-515:
  2027.  
  2028.                     NOP              00, 00, F5, FF       in TDF
  2029.                     MOV FF,A          
  2030.  
  2031.      POD-C751:
  2032.                     NOP              00, 00, 10, DC, 01    in TDF
  2033.                     JBC .TIRUN,01
  2034.      
  2035.  
  2036.  
  2037. Examples:
  2038.  
  2039. BIC 30 40 50 0 200 DB   ;prepare breakpoints for all instructions 
  2040.                          between adress 0 and 200H which may
  2041.                          change the content of adress 30H. Break when 
  2042.                          contents of 30H is between (and including) 40H 
  2043.                          and 50H.
  2044.  
  2045. BIC .TJ F0 20 0 200 DB  ;as previous example. ".TJ" must be previously
  2046.                          defined via DEF or via symbol table.
  2047.                          Range is now F0, F1...FF, 00, 01...20
  2048.  
  2049. BIC .SP 23 23 0 200 RB  ;Break when SP (stackpointer 81H) becomes 23H if
  2050.                          between addresses 0 and 200H
  2051.  
  2052.    
  2053.  
  2054. @@BR
  2055.  
  2056.                 BREAKPOINT REGISTER commands
  2057.  
  2058. format:
  2059.       BRx  x is 0 to 9.
  2060.       BRx = address
  2061.             address1 TO address2
  2062.             address LENGTH number
  2063.             wild card expression
  2064.  
  2065. Breakpoints are activated in the GR (Go Register), or directly 
  2066. within the GO command. Breakpoints can also be set up directly 
  2067. within the GO command. (See GR and GO).
  2068.  
  2069. Examples:
  2070.  
  2071. BR                       ;displays all 10 breakpoint registers.
  2072.  
  2073. BR0                      ;displays breakpoint register 0.
  2074.  
  2075. BR9                      ;displays breakpoint register 9.
  2076.  
  2077. BR2 = 124A TO 125F       ;sets breakpoint register 2 to addresses 
  2078.                          between 124AH and 125FH
  2079.  
  2080. BR6 = 96E L 10           ;sets breakpoint register 6 to addresses 
  2081.                          starting  at 96EH and 16 addresses ahead 
  2082.                          to 97EH.
  2083.  
  2084. BR1  = XXX               ;X means don't care.  In this case  all 
  2085.                          addresses with the first 4 bits = 0000.
  2086.  
  2087. BR1  =  XXXY             ;Y denotes binary.  In this  case  all 
  2088.                          addresses starting with 0000 0000 0000 0
  2089.  
  2090. BR1 = 0101XXX010XXY      ;Any combination is allowed.
  2091.  
  2092.  
  2093. @@BRS
  2094.  
  2095.             BREAKPOINT REGISTERS FOR "SLOW" BREAKPOINTS.
  2096.  
  2097. format:
  2098.       BRS
  2099.       BRSx  x = 0 - 9
  2100.       BRSx = <partition> <type> [address]
  2101.  
  2102. Displays or sets BRSx registers. These breakpoints are "software 
  2103. breakpoints" so they only work when you use the GS (Go Slow) 
  2104. command.
  2105.  
  2106. <partition> is any range or wildcards, normally used only for              
  2107.             addresses. Here they stand for "memory contents" 
  2108.             unless <type> is ADDR.
  2109.  
  2110. <type>      specifies one of the following memory types or its 
  2111.             abbreviations:  CBYTE, DBYTE, PBYTE, RBYTE, XBYTE or 
  2112.             ADDR.
  2113.  
  2114. [address]   A unique address for which the "content" should be 
  2115.             tested for a match with <partition>. The address has 
  2116.             no meaning when <type> is ADDR, in which case 
  2117.             <partition> gives the address or range of addresses.
  2118.  
  2119. Examples:
  2120. BRS                    ;displays all BRS registers.
  2121. BRS0                   ;displays the BRS0 register.
  2122. BRS1 = 10 TO 20 DB 30  ;sets BRS1 to break when the contents of 
  2123.                         internal databyte at address 30H becomes 
  2124.                         a value between 10H and 20H.
  2125.  
  2126.  
  2127. @@BRM
  2128.  
  2129.                    BREAKPOINT MODE REGISTER commands
  2130.  
  2131. format:
  2132.       BRM
  2133.       BRM = [OP] [WR] [RD]     (any combination)
  2134.  
  2135.  
  2136. The breakpoint mode register triggers breakpoints on OP 
  2137. (opcode addresses), WR (external write addresses), RD (external 
  2138. read addresses) or any combination of these addresses.
  2139.  
  2140. Examples:
  2141.  
  2142. BRM                      ;displays current status of BRM
  2143.  
  2144. BRM = RD                 ;breaks only on external read addresses
  2145.  
  2146. BRM = WR                 ;breaks only on external write addresses
  2147.  
  2148. BRM = OP                 ;breaks only on opcode addresses. 
  2149.                           (default).
  2150.  
  2151. BRM = RD WR              ;breaks on external read or write 
  2152.                           addresses
  2153.  
  2154. BRM = OP RD WR           ;breaks on opcode, external read, or 
  2155.                           external write.
  2156.  
  2157.  
  2158. @@BUF
  2159.  
  2160.                 BUFFERSIZE command
  2161.  
  2162. abbreviation: BUF
  2163.  
  2164. Displays the size of the trace buffer, the location of the first 
  2165. frame, and the location of the last frame. Display will not work 
  2166. when the trace is running.
  2167.  
  2168. Example:
  2169.  
  2170. BUF
  2171. Stored frames:  9014
  2172. First frame:    -2045
  2173. Last frame:     -6969
  2174.  
  2175.  
  2176. @@BYB
  2177.                     Break on direct write to Byte address
  2178.  
  2179. format:
  2180.        BYB <byte address>
  2181.  
  2182. <byte address> is between 0 and FFH. This command will go through 
  2183. the entire code memory and look for the following instructions:
  2184.  
  2185. ANL dir,A
  2186. ANL dir,#data
  2187. DEC dir
  2188. DJNZ dir,rel
  2189. INC dir
  2190. MOV dir,A
  2191. MOV dir,R0
  2192. MOV dir,R1
  2193. MOV dir,R2
  2194. MOV dir,R3
  2195. MOV dir,R4
  2196. MOV dir,R5
  2197. MOV dir,R6
  2198. MOV dir,R7
  2199. MOV dir, dir
  2200. MOV dir,*R0     * means "at"
  2201. MOV dir,*R1     * means "at"
  2202. MOV dir,#data
  2203. ORL dir,A
  2204. ORL dir,#data
  2205. XCH A,dir
  2206. XRL dir,A
  2207. XRL dir,#data
  2208.  
  2209. When any of them is found a corresponding breakpoint is activated 
  2210. in the breakpoint RAM. Then when the GB command is used these 
  2211. breakpoints will break the program when a byte is written to the 
  2212. specified byte address. NOTE: only DIRECT byte writes. You can 
  2213. combine with the BB or IB commands. (See the BRK paragraph).
  2214.  
  2215. Examples:
  2216. BYB 4                    ;set up breakpoints on bit writes to bit 
  2217.                          address 4
  2218. BYB .IE                  ;set up breakpoints on byte writes to the 
  2219.                          IE register).
  2220.  
  2221.  
  2222. @@CAL
  2223.                   The CALC Command
  2224.  
  2225. format:
  2226.        CALC <start address> TO <stop address>
  2227.  
  2228. CALC calculates a 16 bit checksum by adding all bytes in code 
  2229. memory between and including <start address> and <stop address>. 
  2230. On a regular PC a calculation of 64K bytes takes approx. 1.5 min.
  2231.  
  2232. Example:
  2233.  
  2234. CALC 0 TO 1FFF               ;calculates checksum of all bytes 
  2235.                               between 0 and 1FFF
  2236.  
  2237.  
  2238. @@CB
  2239.  
  2240.                 MEMORY CONTENTS commands
  2241.  
  2242.     The following types of memory space can be displayed or 
  2243. changed via EMUL51-PC:
  2244.  
  2245. Type of memory             Command                Range
  2246. _______________________________________________________________
  2247. On-chip data memory:       DB, DBY, DBYT, DBYTE.  0 - 7FH
  2248. Register memory:           RB, RBY, RBYT, RBYTE.  80H - FFH
  2249. Bit addressable memory:    RBI, RBIT.             0 - FFH
  2250. External data memory:      XB, XBY, XBYT, XBYTE.  0 - FFFFH
  2251. (with read back check)
  2252. External data memory:      PB, PBY, PBYT, PBYTE.  0 - FFFFH
  2253. (without read back check)
  2254. Code memory:               CB, CBY, CBYT, CBYTE.  0 - FFFFH
  2255.  
  2256. Examples:
  2257.  
  2258.     You can use memory contents commands in many ways. The 
  2259. following are examples for each possibility. CB in the examples 
  2260. can be substituted with any of the above commands. The numbers 
  2261. can be substituted with any number within the valid range shown 
  2262. above. Symbols defined in the internal or external symbol table 
  2263. may also be used.
  2264.  
  2265. 1. CB 23                     Displays data byte on address 23.
  2266.  
  2267. 2. CB 23 TO 35               Displays data bytes on addresses 23 
  2268.                              through 35.
  2269.  
  2270. 3. CB  23 L 10               Displays data bytes on address 23 + 
  2271.                              another 10 bytes. L means length and 
  2272.                              can also be expressed as LEN or 
  2273.                              LENGTH.
  2274.  
  2275. 4. CB 23 = 10                Changes the contents of address 23 
  2276.                              to 10.
  2277.  
  2278. 5. CB  23 = 10,14,15         Same as 4. but the contents of the 
  2279.                              addresses following the first 
  2280.                              address are also changed to the data 
  2281.                              separated by commas.
  2282.  
  2283. 6. CB 23 TO 70 = 12          All  addresses  from 23 through 70 
  2284.                              are filled with 12.
  2285.  
  2286. 7. CB 23 L 10 = 12           Addresses from 23 + another  10 
  2287.                              addresses are filled with 12.
  2288.  
  2289. 8. CB 23 TO 45 = 12,13,14    Addresses from 23 through 45 are 
  2290.                              filled with a repeating pattern of
  2291.                              12,13,14
  2292.  
  2293. 9. CB 23 L 10 = 12,34,56     As 8.      
  2294.  
  2295. 10. CB 100 = XB 400 TO 40F   Specifies addresses from other
  2296.                              memory areas on the right side of =.
  2297.  
  2298. 11. Examples #9 and #10 can be combined in a number of ways: 
  2299.  
  2300.         CB .LOOP L 100 = 12,34,'ABC',XBYT 1000 TO 1010
  2301.  
  2302. 'ABC' will be evaluated as three bytes with the ASCII equivalents 
  2303. of A, B and C. (41H, 42H, 43H).
  2304.  
  2305.  
  2306. @@CLB
  2307.                      CLear Breakpoint RAM.
  2308.  
  2309. format:
  2310.        CLB
  2311.  
  2312. CLB clears the breakpoint RAM. The following commands can be used 
  2313. to set patterns of breakpoints to the breakpoint RAM: BB, BYB, 
  2314. BIC, and IB. These instructions will overlay patterns in the 
  2315. RAM without destroying earlier patterns. The GO command will also 
  2316. clear the breakpoint RAM before putting in active breakpoints as 
  2317. defined by the BR registers. After the GO command these 
  2318. breakpoints are still active and can thus be combined with more 
  2319. patterns created with the above mentioned commands. The CLB 
  2320. command will clear the breakpoint RAM.
  2321.  
  2322.  
  2323. @@COU
  2324.  
  2325.                          COUNT command
  2326.  
  2327. abbreviation: COU
  2328.  
  2329. format:
  2330.  
  2331.       COUNT decimal-expression<cr>
  2332.  
  2333.             [command<cr>]
  2334.             [WHILE boolean-expression<cr>]
  2335.             [UNTIL boolean-expression<cr>]
  2336.  
  2337.       ENDCOUNT
  2338.  
  2339. COUNT; 
  2340.      Begins a block of commands to be executed a specific number 
  2341. of times.
  2342.  
  2343. DECIMAL EXPRESSION;
  2344.      A decimal number or an expression in which the default radix 
  2345. is decimal.
  2346.  
  2347. <cr>;
  2348.      An intermediate carriage return.  In a block command such as 
  2349. Count,  all  carriage  returns are intermediate (terminating  the 
  2350. input  line  but  not terminating the command  entry)  until  the 
  2351. ENDCOUNT keyword is entered.
  2352.  
  2353. WHILE, UNTIL (see these keywords)
  2354.  
  2355. BOOLEAN EXPRESSION;
  2356.      Least significant bit in an expression. Condition is TRUE if 
  2357. the least significant bit is 1, otherwise it is FALSE.
  2358.  
  2359. ENDCOUNT;
  2360.      Terminates the block of commands.
  2361.  
  2362. To end a COUNT command before the full number of loops are done 
  2363. just press the ESC key. It may take a couple of loops before the 
  2364. break occurs.
  2365.  
  2366.  
  2367. @@DAS
  2368.  
  2369.                    THE DISASSEMBLER
  2370.  
  2371. abbreviation: D
  2372.  
  2373. format:
  2374.  
  2375.      DASM
  2376.      DASM partition
  2377.  
  2378.      Disassembles the contents of user program memory into 
  2379. assembler mnemonic and operands. 
  2380.  
  2381. If DASM without partition is used, 10H bytes starting from the 
  2382. address currently pointed to by the disassembly pointer are 
  2383. disassembled. The disassembly pointer will be automatically 
  2384. incremented so that if you issue the D command again disassembly 
  2385. will continue from where the previous disassembly command ended. 
  2386. The D command with a partition and the DP command will 
  2387. automatically change the disassembly pointer, so that it is 
  2388. available for the next D command.
  2389.  
  2390. PARTITION;
  2391.      A  single  address,  or a range of  addresses  expressed  as 
  2392. address TO address, or address LENGTH address. An instruction is 
  2393. displayed if its first byte is within the partition, even if 
  2394. subsequent bytes are outside.
  2395.  
  2396. Examples:
  2397.  
  2398. D .LOOP                 ;disassembles one instruction starting
  2399.                          on the label .LOOP
  2400.  
  2401. D 100 TO 200            ;disassembles from 100 and 200 
  2402.                          addresses
  2403.  
  2404. D .START L 20           ;disassembles from .START and 20H 
  2405.                          addresses
  2406.  
  2407. D .#120 L 10            ;disassemble from PL/M line 120.  (Domain 
  2408.                          must be set. See Domain command.)
  2409.  
  2410. D                       ;disassembles 10H bytes starting from the 
  2411.                          disassembly pointer.
  2412.  
  2413.  
  2414. @@DP
  2415.  
  2416.                          Disassemble from PC
  2417.  
  2418. format:
  2419.        DP
  2420.  
  2421. Disassembles 16 bytes starting from where PC (Program Counter) 
  2422. points. This command will change the disassembly pointer (see the 
  2423. DASM paragraph).
  2424.  
  2425.  
  2426. @@DEF
  2427.  
  2428.                           DEFINE MACRO. DEFINE SYMBOL.
  2429.  
  2430. DEFINE MACRO
  2431.  
  2432. abbreviation: DEF
  2433.  
  2434. format:
  2435.  
  2436.       DEFINE :macroname<cr>
  2437.           
  2438.            [command<cr>]    ....
  2439.  
  2440.       EM
  2441.  
  2442. DEFINE;
  2443.      Enters  user defined macro name and block of  commands  into 
  2444. the macro definition table.
  2445.  
  2446. :macroname; 
  2447.      Name of the macroblock preceded by a colon.
  2448.  
  2449. <cr>;
  2450.      Carriage Return
  2451.  
  2452. COMMAND;
  2453.      Any  emulator  command except DEFINE macro or REMOVE  macro. 
  2454. Calls  to  other macros are allowed,  but a macro  can  not  call 
  2455. itself.  Formal  parameters (%0 through %9) are substituted  with 
  2456. text at macro invocation.
  2457.  
  2458. EM;
  2459.      Terminates the macro definition.
  2460.  
  2461. Examples:
  2462.  
  2463. *DEF :G
  2464. .*GO FROM .START TILL .END
  2465. .*R
  2466. .*EM
  2467. *
  2468.  
  2469. DEFINE SYMBOL
  2470.  
  2471. format:
  2472.       DEFINE [..module-name].symbol-name = expression [type]
  2473.  
  2474. DEFINE;
  2475.      Enters user defined symbol and corresponding numeric value 
  2476. into the user symbol table.
  2477.  
  2478. ..module-name;
  2479.      The  name of an existing module to contain the symbol  being 
  2480. defined.  If no module name is specified, the symbol is placed in 
  2481. the  unnamed module.  Unnamed modules occurs before named modules 
  2482. in the symbols table.
  2483.  
  2484. .symbol-name;
  2485.      The name of the symbol preceded by a period. 
  2486.  
  2487. EXPRESSION;
  2488.      A number,  reference,  or formula that equates to the number 
  2489. expressed.
  2490.  
  2491. type;
  2492.      CODE, XDATA, DATA, IDATA, BIT, NUMB, LINE, UNDEF
  2493.  
  2494.  
  2495. Examples:
  2496.  
  2497. * DEFINE .MOTOR = 210T              ;add new symbol to unnamed 
  2498.                                     module.
  2499. * DEF .FLAG = 34 BIT                ;new symbol gets BIT type.
  2500.  
  2501.  
  2502. @@DIR
  2503.  
  2504.                       DIR command
  2505.  
  2506. format:
  2507.  
  2508.        DIR
  2509.  
  2510. DIR;
  2511.     Displays a directory of the names of all macros.  In the 
  2512. macro definition table, the names are listed in the order that 
  2513. they were entered.
  2514.  
  2515.  
  2516. @@DIS
  2517.  
  2518.                       DISABLE command
  2519.  
  2520. abbreviation: DIS
  2521.  
  2522. format:
  2523.  
  2524.       DISABLE [CASE]
  2525.               [CODE]
  2526.               [EXPANSION]
  2527.               [GLOBAL]
  2528.               [HELP]
  2529.               [LABEL]
  2530.               [LSYMB]
  2531.               [NSYMB]
  2532.               [NUMB]
  2533.               [PLUS]
  2534.               [REG]
  2535.               [SOURCE]
  2536.               [SYMBOLIC]
  2537.               [SYNTAX]
  2538.               [WATCH]
  2539.               [WINDOW]
  2540.               [XDATA]
  2541.  
  2542. DISABLE;
  2543.      Cancels the effect of its object on the EMUL51-PC.
  2544.  
  2545. CASE;
  2546.      By default the characters in symbols are not case sensitive. 
  2547.      ENA CASE will make them case sensitive while DIS CASE 
  2548.      makes them non-sensitive.
  2549.  
  2550. CODE;
  2551.      Disables the CODE window if it was active. By default it
  2552.      is not enabled.
  2553.  
  2554. EXPANSION;
  2555.      When disabled, macro expansion is not displayed. When 
  2556.      enabled, the macro expansion is displayed on the console before 
  2557.      execution. Disabled by default.
  2558.  
  2559. GLOBAL;
  2560.     When enabled ALL symbols will be searched. If disabled ONLY the
  2561.     current module will be searched. Disabling GLOBAL will speed up
  2562.     disassembly, trace disassembly and CODE WINDOW update. Disabled
  2563.     by default.
  2564.  
  2565. HELP;
  2566.     When enabled the small HELP window at the lower right of the 
  2567.     screen is visible. Can also be toggled on and off with Alt+F10.
  2568.     Enabled by default.
  2569.  
  2570. LABEL;
  2571.     By default labels are automatically shown during disassembly.
  2572.     DIS LABEL supresses labels in disassembly listings.
  2573.  
  2574. LSYMB;
  2575.     When disabled, no symbols are shown when listings generated 
  2576.     by DBYTE, CBYTE, XBYTE, PBYTE, RBYTE, or RBIT are used. Disabled 
  2577.     is default.
  2578.  
  2579. NSYMB;
  2580.      When enabled, symbols typed as NUMB will be used in place of 
  2581.      all other types. Useful only with Archimedes / IAR C-51, if you
  2582.      have used the XOBJ program to generate an OBJ file. Disabled by
  2583.      default.
  2584.  
  2585. NUMB;
  2586.     When enabled the symbol table will search through all variables
  2587.     defined as "NUMB". Normally "EQU's". Disabling NUMB may 
  2588.     significantly speed up disassembly, trace disassembly and 
  2589.     CODE WINDOW update. Enabled by default.
  2590.  
  2591. PLUS;
  2592.     See ENABLE command.
  2593.     
  2594. REG;
  2595.     Disables the REGS window.
  2596.     
  2597. SOURCE;
  2598.     Enables the Source only in the CODE window.
  2599.  
  2600. SYMBOLIC;
  2601.      When disabled, addresses are displayed in hexadecimal radix. 
  2602.      When enabled, addresses are displayed in symbolic format.  
  2603.      Symbols are initially enabled.
  2604.  
  2605. SYNTAX;
  2606.     When enabled context sensitive help line will be seen at the 
  2607.     bottom of the screen when typing new commands. Enabled by default.
  2608.  
  2609. WATCH;
  2610.     Disables the WATCH window if it was active. It is disabled by
  2611.     default.
  2612.  
  2613. WINDOW;
  2614.     When enabled the static windows reflecting different memory 
  2615.     locations are shown. Enabled by default.
  2616.  
  2617. XDATA;
  2618.     Disables the EXTERNAL DATA window. When the EXTERNAL DATA window
  2619.     is on READ signals (/RD) will be emitted from the chip to either
  2620.     the target or emulator depending on how the mapping is set. 
  2621.     That may create a problem in the target. By using DIS XDATA
  2622.     no /RD signals are emitted and the EXTERNAL DATA window will not
  2623.     be seen.
  2624.  
  2625. Examples:
  2626.  
  2627. DISABLE SYMBOLIC
  2628. DIS EXPANSION
  2629. DIS LSY
  2630. DIS NSY
  2631. DIS WI
  2632. DIS H
  2633. DIS SYN
  2634. DIS NUMB
  2635. DIS GLO
  2636. DIS SO
  2637. DIS PLUS
  2638. DIS XDATA
  2639.  
  2640. @@DOM
  2641.  
  2642.                         DOMAIN command
  2643.  
  2644. abbreviation: DOM
  2645.  
  2646. format:
  2647.  
  2648.       DOMAIN [..module-name]
  2649.  
  2650. DOMAIN;
  2651.      Displays  or  sets the default module-name.  The default  is 
  2652. used for all line number references not specified with a 
  2653. modulename. Symbol references are not affected by this command.
  2654.  
  2655. ..module-name;
  2656.      An  existing module-name that becomes the default module for 
  2657. referencing line numbers.
  2658.  
  2659. Example:
  2660.  
  2661. DOMAIN ..ETON1
  2662.  
  2663.  
  2664. @@DPT
  2665.  
  2666.                       DPTR command
  2667.  
  2668. abbreviation: DPT
  2669.  
  2670. format:
  2671.  
  2672.       DPTR = [expression]
  2673.       TM0 = [expression]
  2674.       TM1 = [expression]
  2675.  
  2676. DPTR;
  2677.      Displays or sets the 16-bit data pointer register.
  2678.  
  2679. TM0, TM1;
  2680.      Displays or sets the 16-bit value of Timer 0 or Timer 1.
  2681.  
  2682. EXPRESSION;
  2683.      A number,  reference,  or formula that equates to the number 
  2684. expressed;  16 bits are assumed. 
  2685.  
  2686. For DPTR the low 8 bits are stored in DPL (address 82H in 
  2687. Register memory). The high 8 bits are stored in DPH (address 83H
  2688. in Register memory).
  2689.  
  2690. For TM0 the low 8 bits are stored in TL0 (address 8AH in 
  2691. Register memory). The high 8 bits are stored in TH0 (address 8CH
  2692. in Register memory).
  2693.  
  2694. For TM1 the low 8 bits are stored in TL1 (address 8BH in 
  2695. Register memory). The high 8 bits are stored in TH1 (address 8DH
  2696. in Register memory).
  2697.  
  2698. Examples:
  2699.  
  2700. DPTR                             ;display data pointer
  2701. DPTR = .TABLE                    ;sets to 16-bit value.
  2702. TM0                              ;displays TM0
  2703. TM1 = 1A5D                       ;sets TM1 to 1A5DH
  2704.  
  2705.  
  2706.  
  2707. @@ENA
  2708.                           ENABLE command
  2709.  
  2710. abbreviation: ENA
  2711.  
  2712. format:
  2713.  
  2714.       ENABLE  [CASE]
  2715.               [CODE]
  2716.               [EXPANSION]
  2717.               [GLOBAL]
  2718.               [HELP]
  2719.               [LABEL]
  2720.               [LSYMB]
  2721.               [NSYMB]
  2722.               [NUMB]
  2723.               [PLUS]
  2724.               [REG]
  2725.               [SOURCE]
  2726.               [SYMBOLIC]
  2727.               [SYNTAX]
  2728.               [WATCH]
  2729.               [WINDOW]
  2730.               [XDATA]
  2731.  
  2732. ENABLE;
  2733.      Causes its object to affect the EMUL51-PC.
  2734.  
  2735. CASE;
  2736.      By default the characters in symbols are not case sensitive. 
  2737.      ENA CASE will make them case sensitive.
  2738.  
  2739. CODE;
  2740.      Enables the CODE window. By default it is not enabled.
  2741.  
  2742. EXPANSION;
  2743.      When enabled, the macro expansion is displayed on the 
  2744.      console before execution.
  2745.  
  2746. GLOBAL;
  2747.     When enabled ALL symbols will be searched. If disabled ONLY the
  2748.     current module will be searched. Disabling GLOBAL will speed up
  2749.     disassembly, trace disassembly and CODE WINDOW update. Disabled
  2750.     by default.
  2751.  
  2752. HELP;
  2753.     When enabled the small HELP window at the lower right of the screen 
  2754.     is visible. Can also be toggled on and off with Alt+F10.
  2755.  
  2756. LABEL;
  2757.     By default labels are automatically shown during disassembly.
  2758.     DIS LABEL supresses labels in disassembly listings. ENA LABEL
  2759.     makes labels appear.
  2760.  
  2761. LSYMB;
  2762.      When enabled, appropriate symbols will interleave listings 
  2763.      generated with CBYTE, DBYTE, XBYTE, PBYTE, RBYTE, or RBIT 
  2764.      commands. Default is disabled.
  2765.  
  2766. NSYMB;
  2767.      When enabled, symbols typed as NUMB will be used in place of 
  2768.      all other types. Useful only with Archimedes / IAR C-51, if you
  2769.      have used the XOBJ program to generate an OBJ file.
  2770.  
  2771. NUMB;
  2772.     When enabled the symbol table will search through all variables
  2773.     defined as "NUMB". Normally "EQU's". Disabling NUMB may 
  2774.     significantly speed up disassembly, trace disassembly and 
  2775.     CODE WINDOW update. Enabled by default.
  2776.  
  2777. PLUS;
  2778.     Enables the disassembler to display numbers as symbols followed by
  2779.     " + hex number " if a number not exactly matching a symbol was found.
  2780.     Default is disabled. For example MOV DPTR, #4005   could be 
  2781.     MOV DPTR, #LOOP+5 if PLUS was enabled.
  2782.  
  2783. REG;
  2784.     Enables the REGS window.
  2785.     
  2786. SOURCE;
  2787.     Enables the Source only in the CODE window.
  2788.  
  2789. SYMBOLIC;
  2790.      When  enabled,  it  causes display of addresses in  symbolic 
  2791.      format. Symbols are initially enabled.
  2792.  
  2793. SYNTAX;
  2794.     When enabled context sensitive help line will be seen at the 
  2795.     bottom of the screen when typing new commands.
  2796.  
  2797. WATCH;
  2798.     Enables the WATCH window. It is disabled by default.
  2799.  
  2800. WINDOW;
  2801.     When enabled the static windows reflecting different memory 
  2802.     locations is shown.
  2803.  
  2804. XDATA;
  2805.     Enables the EXTERNAL DATA window. Normally the XDATA WINDOW is on
  2806.     by default except when "bondout" pods or some of the "hooks pods"
  2807.     are used. When the EXTERNAL DATA window is on READ signals (/RD) 
  2808.     will be emitted from the chip to either the target or emulator 
  2809.     depending on how the mapping is set. That may create a problem in 
  2810.     the target. By using DIS XDATA no /RD signals are emitted and 
  2811.     the EXTERNAL DATA window will not be seen.
  2812.  
  2813. Examples:
  2814.  
  2815. ENABLE SYMBOLIC
  2816. EN SYM
  2817. EN EXP
  2818. EN LSY
  2819. EN WI
  2820. EN H
  2821. EN SYN
  2822. EN NUMB
  2823. EN GLO
  2824. EN REG
  2825. EN SO
  2826. EN PLUS
  2827. EN XDATA
  2828.  
  2829. @@END
  2830.                     END command.
  2831.  
  2832. The END command is used to end a REPEAT or COUNT loop.  Please
  2833. see these commands for further information.
  2834.  
  2835.  
  2836. @@EVA
  2837.  
  2838.                        EVALUATE command
  2839.  
  2840. abbreviation: E, EVA, EVAL
  2841.  
  2842. format:
  2843.  
  2844.       EVALUATE expression
  2845.  
  2846. EVALUATE;
  2847.      Performs the specified mathematical operations to convert 
  2848. the expression to a 16-bit numeric result. The result is 
  2849. displayed in binary, octal, decimal, and hexadecimal, as a pair 
  2850. of ASCII characters (if value is between 20H and 7EH), and as an 
  2851. address. The address displayed is the name of the user symbol or 
  2852. a line number.
  2853.  
  2854. EXPRESSION;
  2855.      A number, reference, or a formula that can be equated to a 
  2856. numeric result.
  2857.  
  2858. Examples:
  2859.  
  2860. EVAL 100Q + 13T
  2861.  
  2862. E CBYTE .VAL + 100
  2863.  
  2864. @@EVENT
  2865.  
  2866. EVENT               Specify a simulation event.
  2867.  
  2868.     abbreviation    EVE
  2869.  
  2870. format: 
  2871.  
  2872. EVENT {R,W,*} <addr[range]> {CB,XB,DB,RBY,RBI,PC} [lo hi value]] [:mac]
  2873.  
  2874. description:   
  2875.  
  2876. This command specifies events to be intercepted. The 
  2877. default action is 'break'. However, the user can attach a MACRO 
  2878. that will be executed automatically without stopping.
  2879.  
  2880. { R,W,*}            Read/Write access or both
  2881. <addr[range]>       address
  2882. address LEN count
  2883. address TO address
  2884.  
  2885. {CB,XB,DB,RBY,RBI,PC}  memory type or program counter
  2886.  
  2887. [lo  [hi value]]  optional contents of address is included in the 
  2888.                   event specification. A single value or a range.   
  2889.  
  2890. [:mac]     an optional macro
  2891. It will be called with 3 operands:
  2892.  
  2893.  
  2894. :MACRONAME   ADDRESS  COUNT  CYCLES
  2895.  
  2896. where  ADDRESS is the trapped address,
  2897. COUNT   is an individual event count,
  2898. CYCLES  is a machine cycle counter, all modulo 64K.
  2899.  
  2900. Note:  events are only sensitive to instruction
  2901. execution, NOT to memory accesses from
  2902. the command line (to avoid the risk of infinite nesting).
  2903. However, macros can install or remove events!
  2904.  
  2905. EVENT
  2906. without arguments will list the installed
  2907. events, showing their ID numbers and counts.
  2908.  
  2909. see also    REMOVE EVENT number
  2910.             REMOVE EVENTS
  2911.             RESET  EVENTCOUNT  number
  2912.             RESET  EVENTCOUNTS
  2913.  
  2914. examples    EVENT W .p0 RBY :setP0
  2915.             EVENT * 8000 TO FFFF PC
  2916.             EVENT R 0 TO FFFF XB
  2917.  
  2918.  
  2919. MACDELAY            Execution of a macro after a time delay.
  2920.  
  2921. abbreviation   MACD
  2922.  
  2923. format   MACDELAY  count [msec | sec]  :macro [operand ..]
  2924.  
  2925. Description:   
  2926.  
  2927.     This command is intended to be combined with a
  2928.     macro in order to implement time delays. The specified
  2929.     macro will be executed after the specified time or cycles
  2930.  
  2931.  
  2932.     Arguments:     
  2933.  
  2934. count  [msec | sec]
  2935.  
  2936. Time delay.
  2937. The default time unit is 'machine cycles',
  2938. but can be altered to milliseconds or
  2939. seconds.
  2940.  
  2941. :macro  [operand ..]   
  2942.  
  2943. The macro to be scheduled for
  2944. later execution. The optional
  2945. arguments are frozen at the time
  2946. of the 'MACDELAY' command.
  2947.  
  2948. examples
  2949. MACDELAY  100 msec  :startmotor
  2950.  
  2951.  
  2952. define :event_P1
  2953. macdelay  850  :printer_ready %0 %1 %2   ; inherit operands
  2954. em
  2955.  
  2956. @@EXI
  2957.  
  2958.                        EXIT and QUIT Commands.
  2959.  
  2960. abbreviation: EX  QUI
  2961.  
  2962. format:
  2963.       EXIT
  2964.       QUIT
  2965.  
  2966. EXIT;
  2967.      Terminates EMUL51-PC and returns to DOS.
  2968.  
  2969. QUIT;
  2970.      Returns to DOS without terminating the emulator if it was running.
  2971.  
  2972.  
  2973. @@FIL
  2974.  
  2975.                     The FILL command.
  2976.  
  2977. abbreviation: F
  2978.  
  2979. format:
  2980.        FILL <range> <value> <type>
  2981.  
  2982. FILL writes a specified value to a range of addresses of a 
  2983. specified type. You can do the same using CB, DB, XB etc. but the 
  2984. FILL command is much faster.
  2985.  
  2986. Examples:
  2987. F 0 TO FFFF 55 XB          ;writes 55H to the external memory.
  2988. F 30 L 20 0 DB             ;clears internal data memory from 
  2989.                             address 30H and the following 20H 
  2990.                             bytes.
  2991.  
  2992. @@FORM
  2993.  
  2994.                FORMAT Commands (In support of C-Compilers)
  2995.  
  2996. abbreviations: DI, DU, DF, DS, XI, XU, XF, XS, CI, CU, CF, CS
  2997.  
  2998. format:
  2999.        DINT     address [range]
  3000.        DUINT    address [range]
  3001.        DFLOAT   address [range]
  3002.        DSTRING  address [range]
  3003.  
  3004.        XINT     address [range]
  3005.        XUINT    address [range]
  3006.        XFLOAT   address [range]
  3007.        XSTRING  address [range]
  3008.  
  3009.        CINT     address [range]
  3010.        CUINT    address [range]
  3011.        CFLOAT   address [range]
  3012.        CSTRING  address [range]
  3013.  
  3014. [range] is either of the form 
  3015. [<address> TO <address>] or
  3016. [<address L <number>]
  3017.  
  3018. x in the explanations below is either D, X, or C
  3019.  
  3020. xINT will display the contents of <address> and <address+1> as a 
  3021. signed integer. If a range is specified, signed integers will be
  3022. displayed until the range is exhausted.
  3023.  
  3024. xUINT will display the contents of <address> and <address+1> as an 
  3025. unsigned integer. If a range is specified, unsigned integers will be
  3026. displayed until the range is exhausted.
  3027.  
  3028. xFLOAT will display the contents of <address>, <address+1>, 
  3029. <address+2> and <address+3> as a float. If a range is specified,
  3030. floats will be displayed until the range is exhausted. NAN and -NAN 
  3031. (Non Applicable Number) means that the four bytes could not be 
  3032. translated to a float.
  3033.  
  3034. xSTRING will display the contents of <address> as an ASCII character 
  3035. or a ".", if the byte was not translatable as a printable ASCII
  3036. number. If a range is specified, ASCII characters will be
  3037. displayed until the range is exhausted or a 0 is encountered. If
  3038. no range is specified ASCII characters will be displayed till
  3039. a 0 is encountered or maximum 16 characters have been printed.
  3040. The ASCII string will be surrounded by quotes ("). The ending
  3041. quote will only be seen if the ending 0 was found within the
  3042. range (or 16 bytes if no range was specified).
  3043.  
  3044. Examples:
  3045.  
  3046. CI 0                 ;Display CODE memory address 0 and address 1 
  3047.                      ;as a signed integer
  3048. DI 30 L 10           ;Display DATA memory from address 30H to address 
  3049.                      ;40H as signed integers
  3050. XU 3000 TO 3020      ;Display XDATA memory from address 3000H to 
  3051.                      ;address 3020H as unsigned integers
  3052. XF 4000 L 40         ;Display XDATA memory from address 4000H to
  3053.                      ;address 4040H as floats
  3054. DS 0                 ;Display DATA memory adress 0 as an ASCII 
  3055.                      ;character. Up to 16 ASCII characters will 
  3056.                      ;be displayed unless a 0 is encountered
  3057. XS 1000 L 100        ;Display XDATA memory starting from address 1000H
  3058.                      ;as ASCII characters. Display will stop if a 0 is
  3059.                      ;encountered or when the range is exhausted
  3060.  
  3061.  
  3062. @@GB
  3063.  
  3064.                      The Go until Break command.
  3065.                      
  3066. format:                     
  3067.        GB [FROM <address>]
  3068.  
  3069. Starts execution without first erasing the breakpoint RAM. Useful
  3070. after breakpoint RAM has been initiated by BB, BYB, IB, SLM or/and
  3071. BIC.
  3072.  
  3073.  
  3074.  
  3075. @@GI
  3076.                     GI. Go till Internal contents match.
  3077.  
  3078. format:
  3079.        GI [SY0]
  3080.        GI [FROM addr] [SY0]
  3081.  
  3082. Description:
  3083.  
  3084. Used together with the BIC command which presets breakpoints for the desired
  3085. address, and also specifies which range of contents to break on. (See BIC 
  3086. for all details).
  3087.  
  3088. note 1. If, when you use GI, a breakpoint is not reached and you use ESC to
  3089.         manually break, you will get WRITE TIMEOUT and READ TIMEOUT errors.
  3090.         This is because the code which is handling breakpoints is modified
  3091.         to check if the contents of the specified address is within range.
  3092.         If this occurs YOU MUST ISSUE THE COMMAND "* RES EMUL" which reloads
  3093.         the 8051 overlay code.
  3094.  
  3095. note 2. When you look back in the trace buffer after a break has occured 
  3096.         after using the GI command you will see the instruction:
  3097.  
  3098.                     JBC .IE+7(EA),addr 
  3099.  
  3100.                            or 
  3101.  
  3102.         if you use the TDF command a number of frames starting with the
  3103.         following data: 
  3104.  
  3105.                     10 AF 01 00
  3106.  
  3107.         This is because the trace will always sample the first instruction
  3108.         in the breakpoint handling routine (which is JBC .EA, addr) before
  3109.         it turns off. This is normally taken care of in software so you will
  3110.         not see it. In this case we decided to let it show for a number of
  3111.         reasons: You get an indication where "check breaks" were taken. It
  3112.         is also difficult to remove part of the trace without inadvertently
  3113.         removing "valid" trace frames.
  3114.  
  3115. THIS COMMAND SHOULD ONLY BE USED AFTER "BIC" HAS FIRST SET UP BREAKPOINTS
  3116. AND SPECIFIED ADDRESS AND RANGE OF CONTENTS!
  3117.  
  3118. Examples:
  3119.  
  3120. GI                ;Go from present PC (Program Counter)
  3121.  
  3122. GI SY0            ;As example above but qualified with SY0
  3123.  
  3124. GI FROM 0         ;Go from address 0
  3125.  
  3126. GI F 100          ;Go from address 100H
  3127.  
  3128. GI F 100 SY0      ;As example above but qualified with SY0
  3129.  
  3130.  
  3131.  
  3132. @@GO
  3133.  
  3134.                       GO command
  3135.  
  3136. format:
  3137.       GO [FROM address] [FOREVER]
  3138.                         [TILL SY0]
  3139.                         [TILL BR0]
  3140.                         [TILL BR0 WITH SY0]
  3141.                         [TILL BR0 OR SY0]
  3142.                         [TILL BR1]
  3143.                         [TILL BR1 WITH SY0]
  3144.                         [TILL BR1 OR SY0]
  3145.                         [TILL BR]
  3146.                         [TILL BR WITH SY0]
  3147.                         [TILL BR OR SY0]
  3148.                         [TILL address [OR address]
  3149.                         [TILL address [OR address] WITH SY0]
  3150.                         [TILL address [OR address] OR SY0]
  3151.  
  3152. GO;
  3153.      Begins real time emulation.
  3154.  
  3155. FROM;
  3156.      Specifies the start address for emulation.  FROM changes the 
  3157. program counter before the start of emulation. It also resets the 
  3158. emulation  timer  (cycle  counter).  If the FROM is  omitted  the 
  3159. current PC is used.
  3160.  
  3161. FOREVER;
  3162.      Disables all breakpoints except the ESC key and TBR = ON.
  3163.  
  3164. TILL SY0;
  3165.      Halts  emulation when the external signal SY0 goes  low  (or 
  3166. high, depending on the SY0A register).
  3167.  
  3168. TILL BR0;
  3169. TILL BR1;
  3170. TILL BR;
  3171.      Halts  real time emulation when an address matches BR0,  BR1 
  3172. or BR (BR0 or BR1).
  3173.  
  3174.      Breakpoint  registers BR2 - BR9 may also be set up to  break 
  3175. emulation. They can not be set up in the GO command. They must be 
  3176. set up separately with the BR command.
  3177.  
  3178. WITH SY0;
  3179.      Halts emulation when a breakpoint condition and SY0 are 
  3180. simultaneously true. (SY0 true can be high or low depending on 
  3181. the SY0A register).
  3182.  
  3183. OR SY0;
  3184.      Halts emulation when either a breakpoint condition is true 
  3185. or SY0 is true (high or low depending on the SY0A register).
  3186.  
  3187. Examples:
  3188.  
  3189. G                        ;starts emulation at present PC value. 
  3190.                           All breakpoint factors remain unchanged
  3191.  
  3192. G F .START               ;starts emulation at .START. All 
  3193.                           breakpoints factors remain unchanged.
  3194.  
  3195. G F .START T .LOOP       ;starts emulation at .START. BR0 is set 
  3196.                           to .LOOP. Other breakpoints remain 
  3197.                           unchanged.
  3198.  
  3199. G F .START T .LOOP OR .STOP  ;starts emulation at .START. BR0 is 
  3200.                           set to .LOOP and BR1 is set to .STOP. 
  3201.                           Other breakpoints remain unchanged.
  3202.  
  3203. G F .START TILL BR       ;starts emulation at .START and will end 
  3204.                           when BR0 or BR1 is encountered. (Or any 
  3205.                           of BR2 - BR9 if they are active).
  3206.  
  3207. G F 0 T BR W SY0         ;SY0 is part of the break condition.
  3208.  
  3209. G F 0 T BR0 OR SY0       ;BR0 or SY0 true breaks emulation.
  3210.  
  3211. G T SY0                  ;SY0 true breaks emulation.
  3212.  
  3213.  
  3214.  
  3215. @@GR
  3216.  
  3217.                       GO REGISTER command
  3218.  
  3219. format:
  3220.     GR  
  3221.  
  3222.     GR =  [FOREVER]
  3223.             [TILL SY0]
  3224.             [TILL BR0]
  3225.             [TILL BR0 WITH SY0]
  3226.             [TILL BR0 OR SY0]
  3227.             [TILL BR1]
  3228.             [TILL BR1 WITH SY0]
  3229.             [TILL BR1 OR SY0]
  3230.             [TILL BR]
  3231.             [TILL BR WITH SY0]
  3232.             [TILL BR OR SY0]
  3233.             [TILL address [OR address]
  3234.             [TILL address [OR address] WITH SY0]
  3235.             [TILL address [OR address] OR SY0]
  3236.  
  3237. GR;
  3238.      Displays  or  sets halt conditions for real  time  emulation 
  3239. without starting emulation.
  3240.  
  3241. See GO for other details.
  3242.  
  3243.  
  3244. @@GS
  3245.                     Go Slow Command
  3246.  
  3247. format:
  3248.       GS [FROM <address>]
  3249.  
  3250. This command will make the emulator single step (without showing 
  3251. anything on the screen). Between each step the BRS conditions 
  3252. will be checked for matches. When a match occurs single stepping 
  3253. will break and registers will be shown on the screen. This break 
  3254. check is edge sensitive, which means that it will NOT break 
  3255. continuously  on a constant match of memory contents.  Only 
  3256. if a match first fails will it break on the next match.
  3257.  
  3258. Example:
  3259. GS                    ;Go Slow from current PC address
  3260. GS F 10A8             ;Go Slow from 10A8H
  3261.  
  3262.  
  3263. @@HEAP
  3264.  
  3265.                     HEAP command
  3266.  
  3267. abbreviation: HEA
  3268.  
  3269. format:
  3270.         HEAP 
  3271.         HEAP = [STD] [EXT] [EMS] [DISK]
  3272.  
  3273. The HEAP command is used to "expand the heap" to memory located 
  3274. outside the standard 640K of the PC. This is useful if you have 
  3275. a very large symbol table that does not fit in the standard memory.
  3276. The symbol table will be loaded to the specified memory location
  3277. instead of to the standard memory. Up to 64K of the standard memory
  3278. will be allocated in some cases to handle the "outside memory".
  3279. Use the MEM command to see how much memory is left after the
  3280. emulator software has been loaded, after your file has been loaded 
  3281. etc.
  3282.  
  3283. STD = standard memory (640K)
  3284. EXT = extended memory
  3285. EMS = expanded memory (LIM)
  3286. DISK = file in current directory
  3287.  
  3288. The HEAP command can only be used once and only BEFORE any file 
  3289. has been loaded into the EMUL51. Observe that symbol handling 
  3290. when doing disassembly and updating the CODE window will be 
  3291. much slower when this option is used. It is possible to disable
  3292. searching for specific symbols to speed up the search:
  3293.  
  3294. DIS LABEL disables search for CODE symbols.
  3295. DIS SYMBOL disables search all symbols.
  3296. ENA LABEL enables search for LABELS only.
  3297.  
  3298. Examples:
  3299.  
  3300. HEA              ;display which "HEAP" memory is being used
  3301. HEA = DISK       ;use a diskfile to store symbols
  3302. HEA = EXT        ;use extended memory to store symbols
  3303. HEA = EMS        ;use expanded memory to store symbols
  3304.  
  3305.  
  3306. @@HELP
  3307.                     The HELP command.
  3308.  
  3309. This command takes you back up to the top menu and "pulls down"
  3310. the HELP menu. Choose any item and press RETURN.
  3311.  
  3312.  
  3313. @@IB
  3314.                     Internal Break on pattern.
  3315.  
  3316. format:
  3317.       IB <byte1>, <byte2 or x>, <byte3 or x>
  3318.  
  3319. <byte1> should normally be an instruction code.
  3320. "x"  means don't care
  3321.  
  3322. This command will look for the specified pattern throughout the entire
  3323. code memory and progam a breakpoint whereever a match is found. Breakpoints
  3324. will only be executed if the corresponding address is executed as the first
  3325. byte in the instruction. (The emulator generated Valid Fetch signal takes
  3326. care of this). Please also see the "CLB", "BB", and "BYB" commands. More
  3327. details are also available in the "BRK" paragraph. (Help via F1 from 
  3328. "top menu line").
  3329.  
  3330.  
  3331. @@IF
  3332.  
  3333.                        IF command
  3334.  
  3335. format:
  3336.  
  3337.       IF boolean-expression [THEN] <cr>
  3338.             [command <cr>]
  3339.       [ORIF boolean-expression <cr>]
  3340.             [command <cr>]
  3341.       [ELSE <cr>]
  3342.             [command <cr>]
  3343.  
  3344. IF;
  3345.      Begins a block of commands to be executed when the IF 
  3346. condition is TRUE.
  3347.  
  3348. BOOLEAN EXPRESSION;
  3349.      Any of the forms of expression.  When the boolean expression 
  3350. after IF or ORIF is TRUE, the commands in that block are executed 
  3351. to the exclusion of all other blocks in that IF command
  3352.  
  3353. THEN;
  3354.      Optional addition to the IF command.
  3355.  
  3356. <cr>;
  3357.      Intermediate carriage return. Ends each input line of the IF 
  3358. command. It does not terminate the entry of the command.
  3359.  
  3360. COMMAND;
  3361.      Any EMUL51-PC command except DEFINE Macro and REMOVE Macro.
  3362.  
  3363. ORIF;
  3364.      Introduces a secondary block of commands. When the condition 
  3365. after the IF is FALSE,  the first ORIF condition found to be TRUE 
  3366. executes  the  ORIF block to the exclusion of all  other  command 
  3367. blocks.
  3368.  
  3369. ELSE;
  3370.      Introduces a block of commands to be executed when no IF  or 
  3371. ORIF condition is TRUE.
  3372.  
  3373. ENDIF;
  3374.      Terminates the entire IF command.
  3375.  
  3376. Examples:
  3377.  
  3378. *IF .VAL EQ 200H
  3379. *.GO FROM .ST TILL .END
  3380. *ORIF .VAL EQ 100H
  3381. *.GO FORE
  3382. *ELSE
  3383. *.WRITE 'DONE'
  3384. *ENDIF
  3385.  
  3386.  
  3387. @@INC
  3388.  
  3389.                         INCLUDE command
  3390.  
  3391. abbreviation INC
  3392.  
  3393. format:
  3394.       INCLUDE [drive] filename
  3395.  
  3396. INCLUDE
  3397.      Reads a sequence of emulator commands from the specified 
  3398. drive and file. 
  3399. INCLUDE is used to load macro definitions from disk.
  3400.  
  3401. Examples:
  3402.  
  3403. INCLUDE GO.MAC                ;load the macro GO.MAC from the 
  3404.                                default drive.
  3405.  
  3406.  
  3407. @@INT
  3408.  
  3409.                         INTERRUPT command
  3410.  
  3411. abbreviation: INT
  3412.  
  3413. format:
  3414.       INTERRUPT
  3415.  
  3416. INTERRUPT;
  3417.  
  3418. (Except Siemens 80535)
  3419.  
  3420.      Displays the Interrupt level 0 (IIP0), Interrupt level 1 
  3421. (IIP1), Interrupt Enable register (IE), and Interrupt Priority 
  3422. register (IP). IIP0 and IIP1 are displayed as YES or NO to 
  3423. indicate whether an interrupt on that level is active or not. To 
  3424. obtain information on the cause of interrupt, compare the program 
  3425. counter (PC) with the code listing. If an emulation session is 
  3426. started and the PC was changed since the last session without 
  3427. resetting all interrupts, a warning will be issued: "WARNING 
  3428. ACTIVE INTERRUPTS". To reset the interrupt in progress registers 
  3429. internal to the microprocessor, take one of the following 
  3430. actions:
  3431.  
  3432. 1. A RETI is executed.
  3433. 2. A RESET CHIP command is issued.
  3434. 3. The Reset push button on the pod is pressed.
  3435. 4. A reset from the target.
  3436.  
  3437. Siemens 80535:
  3438.  
  3439.     Works essentially as above, but IEN0, IEN1, IP0, and IP1 are 
  3440. displayed. Four levels of Interrupt In Progress, indicated as YES 
  3441. or NO.
  3442.  
  3443.  
  3444.  
  3445. @@LIN
  3446.                      Linestep Command
  3447.  
  3448. format:
  3449.        L [FROM <address>]
  3450.  
  3451. This command goes through the symbol table and locates all symbols with
  3452. the type LINE and sets a breakpoint on the corresponding addresses. 
  3453. Then the code will be executed until a breakpoint is encountered.  ESC
  3454. will also break execution.  This is usable only when working with C51
  3455. (Archimedes / IAR) and PL/M-51 (Intel).  Using the GO or SN commands
  3456. will erase all LINE number breakpoints, but the STEP command will not. 
  3457. The L command erases all previously activated breakpoints in the
  3458. breakpoint RAM before it is executed.
  3459.  
  3460.  
  3461.  
  3462. @@LC
  3463.  
  3464.                    LOOP COUNTER command.
  3465.  
  3466. format: LC
  3467.         LC = decimal value
  3468.  
  3469. LOOP COUNTER;
  3470.      Displays or sets the Loop Counter.  LC is used in some trace 
  3471. conditions. (See TR command).
  3472.  
  3473. Examples:
  3474. LC                       ;display the loop counter value.
  3475. LC=2000                  ;sets the loop counter to 2000 decimal.
  3476.  
  3477.  
  3478. @@LIST
  3479.  
  3480.                        LIST command
  3481.  
  3482. format:
  3483.       LIST filename
  3484.            [STOP]
  3485.  
  3486. LIST
  3487. Outputs a copy of everything printed on the screen to the 
  3488. specified file. The word STOP instead of a file name will close 
  3489. the file. By choosing a new file name the old file will be closed 
  3490. and the new file will be opened.
  3491.  
  3492. Examples:
  3493. LIST LPT1                         ;list on parallel printer
  3494. LIST EMSESS.EMU                   ;save on file
  3495. LIST A:EMUDATA.DAT                ;save on file
  3496. LIST STOP                         ;close existing file
  3497.  
  3498.  
  3499. @@LOA
  3500.  
  3501.                        LOAD command
  3502.  
  3503. abbreviation: LOA
  3504. Format:
  3505.  
  3506.       LOAD [d:] filename [NOCODE]
  3507.                          [NOSYMBOLS]
  3508.                          [RELMS]
  3509.                          [?M <modulname>]
  3510.                          [MOTO]
  3511. LOAD;
  3512.      Loads the user program and symbol table from the specified 
  3513. drive and file name into code memory on the emulator. If the file 
  3514. contains a symbol table it will be loaded without a check for 
  3515. duplicate symbols. This means that multiple loads of the same 
  3516. file will result in multiple versions of the same user symbols. 
  3517. If the symbol table contains references to system symbols, they 
  3518. will not be loaded.
  3519.  
  3520. NOCODE;
  3521.      suppress  loading of the code from the file.  It will load 
  3522. the symbol table if present.
  3523.  
  3524. NOSYMBOLS;
  3525.     suppress loading of the symbol table from the file. It will 
  3526. load the code if present.
  3527.  
  3528. RELMS
  3529.     Loads a RELMS obj file. (8080 object format).
  3530.  
  3531. ?M <modulname>
  3532.     Loads symbols only from the specified module. May be used if
  3533.     you run out of memory with big symbol files. This command may
  3534.     be repeated any number of times for different modules to load
  3535.     only the modules currently needed for debugging. If you need
  3536.     to load many modules but not all, you should set up a macro
  3537.     for loading. This works only for INTEL OBJ (OMF) formats.
  3538.     (See example below).
  3539.  
  3540. MOTO
  3541.     Used when loading Motorola "S1" files with extended "SA" symbol 
  3542.     records
  3543.  
  3544. The following file formats are supported:
  3545.  
  3546. 1.  INTEL HEX             ;Only code
  3547. 2.  INTEL OBJ (OMF, AOMF) ;Code, modules, typed symbols
  3548. 3.  AVOCET SYM            ;Code is same as Intel HEX. Separate 
  3549.                            symbol file, typed symbols
  3550. 4.  IAR SYMBOLIC          ;Code and untyped symbols
  3551. 5.  HMI SYM               ;Intel HEX. Separate symbol file. 
  3552.                            Untyped symbols.
  3553. 6.  INTEL SYM             ;Can appear together with INTEL HEX
  3554. 7.  RELMS OBJ             ;Equivalent with Intel's 8080 obj format 
  3555.                            Untyped symbols
  3556. 8.  AMERICAN AUTOMATION   ;Separate symbol file, untyped symbols
  3557. 9.  2500 AD               ;Separate symbol file, untyped symbols.
  3558.                            Microtek symbols supported.
  3559. 10. MOTOROLA S1           ;Used by American Automation. 
  3560. 11. IAR UBROFF            ;IAR/Archimedes format for source level 
  3561.                            debugging
  3562. 12. KEIL EXTENDED         ;Keil / Franklin OBJ EXTENDED format for 
  3563.                            source level debugging
  3564. 13. COSMIC                ;Intermetrics / Whitesmiths / Cosmic
  3565.                            format for source level debugging
  3566. 14. IEEE 695              ;BSO / Tasking source level debugging
  3567.  
  3568. Examples:
  3569.  
  3570. LOAD TEST.A03            ;load an Archimedes file
  3571. LOA COUNT.OBJ NOCODE     ;load only symbols from COUNT.OBJ
  3572. LOA TME NOSYMBOLS        ;load only code from TME
  3573. LOA SDER.OBJ ?M VIR      ;load code and symbols from SDER.OBJ, but 
  3574.                           symbols only from the module VIR
  3575. DEF :LOAD                ;macro to load symbols from three modules out
  3576.  LOA PLM.OBJ ?M MAIN      of PLM.OBJ
  3577.  LOA PLM.OBJ ?M TINT
  3578.  LOA PLM.OBJ ?M FINISH
  3579. EM
  3580.  
  3581.  
  3582.  
  3583. @@LOB
  3584.  
  3585.                        LOB command
  3586.  
  3587. Format:
  3588.  
  3589.       LOB <[d:]filename> <start address in hex>
  3590.  
  3591. LOB;
  3592.      Loads the user program given in raw binary form from the specified 
  3593. drive and file name into code memory on the emulator.
  3594.  
  3595. Examples:
  3596.  
  3597. LOB CHK.BIN 1000           ;Load the binary file CHK.BIN to the emulator
  3598.                             code memory. Load to address 1000H and up.
  3599.  
  3600.  
  3601. @@LOP
  3602.                         LOad Ppa setup command
  3603.  
  3604. Format:
  3605.        LOP <[d:]filename>
  3606.  
  3607. Load PPA setup data previously saved using the SAP command.
  3608.  
  3609. Example:
  3610. LOP PPA.SAV               ;Load data from PPA.SAV to PPA setup window.
  3611.  
  3612.  
  3613. @@LOW
  3614.                         LOAD WINDOW SETUP command
  3615.  
  3616. format:
  3617.       LOW [d:] filename
  3618.  
  3619. Loads a window setup file which was previously saved using the 
  3620. SAW command.
  3621.  
  3622. Example:
  3623.  
  3624. LOW WIN.SUP               ;loads win.sup from current directory.
  3625. LOW A:XDAT.SUP            ;loads XDAT.SUP from the a: drive.
  3626.  
  3627.  
  3628. @@MAC
  3629.                         MACRO command
  3630.  
  3631. abbreviation: MAC
  3632.  
  3633. format:
  3634.       MACRO [:macroname]
  3635.  
  3636. MACRO;
  3637.      Displays the definition of a macro defined by :macroname. If 
  3638. MACRO is used without a name specification, all macros will be 
  3639. displayed.
  3640.  
  3641. :macroname;
  3642.      Must be defined previously.
  3643.  
  3644. Examples:
  3645.  
  3646. MACRO                    ;display all macros
  3647. MAC :EXEC                ;display the macro :EXEC
  3648.     
  3649.  
  3650. @@MAP
  3651.  
  3652.                     MAP commands
  3653.  
  3654. format:
  3655.       MAPX
  3656.       MAPC
  3657.       MAPX = E [T] E [T] .....
  3658.       MAPC = E [T] E [T] .....
  3659.       MAPC = USER
  3660.       MAPX = USER
  3661.       MAPC = EMUL
  3662.       MAPX = EMUL
  3663.  
  3664.  
  3665. MAPX, MAPC;
  3666.      Displays mapping of external memory (X) and code memory (C). 
  3667. The  maps  are set in 16 4K portions.  Each 4K  byte  segment  of 
  3668. memory  may be mapped either to the emulator (E) (default) or  to 
  3669. the target system (T).  Start with the lowest 4K (0000H to 0FFFH) 
  3670. section and end with the highest 4k (F000H - FFFFH section).
  3671. MAPC = USER maps all code memory to the target.
  3672. MAPX = USER maps all external data memory to the target.
  3673. MAPC = EMUL maps all code memory to the emulator.
  3674. MAPX = EMUL maps all external data memory to the target.
  3675.  
  3676. Examples:
  3677.  
  3678. MAPX                          ;displays mapping of external 
  3679.                                memory
  3680.  
  3681. MAPC = E E T T T T T T T T T T T T T T  ;maps the first 8K of 
  3682.                                          code memory to the 
  3683.                                          emulator and the 
  3684.                                          remaining 56K to the 
  3685.                                          target system.
  3686.  
  3687. MAPX = USER                              ;maps all xdata memory 
  3688.                                           to the target.
  3689.  
  3690. MAPC = EMUL                              ;maps all code memory
  3691.                                           to the emulator.
  3692.  
  3693. @@MEM
  3694.                    MEM command.
  3695.  
  3696. Will report how much memory is available for symbols, SYSTEM, SHELL
  3697. etc.  If you seem to have too little memory left you may be able to
  3698. use the HEAP command to take advantage of EXT or EMS memory. You may
  3699. also be able to remove resident programs or reduce "buffers" in
  3700. CONFIG.SYS.
  3701.  
  3702.  
  3703. @@MOD
  3704.                   MODULE command.
  3705.  
  3706. This command shows the current module.
  3707.  
  3708.  
  3709. @@NOHIT
  3710.                          NOHIT command.
  3711.  
  3712. format:
  3713.        NOHIT [0] [1]
  3714.  
  3715. This command is used in connection with the SYSTEM command.  
  3716. NOHIT 1   will supress the "Hit any key to continue.." 
  3717. message when returning to the emulator after a SYSTEM command.
  3718. NOHIT 0   will return to normal operation where you must
  3719. press a key before returning to the emulator.
  3720.  
  3721.  
  3722. @@NOS
  3723.  
  3724.                          NOSNOW command.
  3725.  
  3726. format:
  3727.       NOSNOW
  3728.  
  3729.       This command is used if you get "snow" on the screen when 
  3730. the static window is active. The window update will then be 
  3731. slightly slower because the output is only done when the video is 
  3732. "retracing". There is no command to go back to "snow". 
  3733.  
  3734. Example:
  3735.  
  3736. NOSNOW                   ;prevents snow on screen
  3737.  
  3738.  
  3739. @@OST
  3740.                 Open (Close) Step Trace file Command.
  3741.  
  3742. format:
  3743.       OST
  3744.       CST
  3745.  
  3746. This command will open a file, "STEPTRAC.TRC" in the current 
  3747. directory where it will store trace data from each single step. 
  3748. Data from STEP will be stored in this file in a circular fashion. 
  3749. Maximum 1000 instructions will be stored in this file. Then the 
  3750. oldest frame will be overwritten. While this file is open the TDS 
  3751. and TDFS commands can be used to view the contents of the trace 
  3752. file. The CST command is used to close the file. After the CST 
  3753. command is used the file is lost and can not be viewed.
  3754.  
  3755.  
  3756. @@PC
  3757.  
  3758.                          PC command
  3759.  
  3760. format:
  3761.       PC = [expression]
  3762.  
  3763. PC;
  3764.      Displays or sets the 16-bit program counter.
  3765.  
  3766. EXPRESSION;
  3767.      A number,  reference,  or formula that equates to the number 
  3768. expressed.
  3769.  
  3770. Examples:
  3771. PC                             ;Display program counter
  3772.  
  3773. PC = .BEGIN + 7                ;Set PC to new address
  3774.  
  3775.  
  3776. @@PPA
  3777.  
  3778.                 Program Performance Analysis command.
  3779.  
  3780. format:
  3781.       PPA
  3782.  
  3783. This command works only if you have the trace board.
  3784.  
  3785. This command takes you into the PPA window where it is possible 
  3786. to monitor where the program spends its time. This is done by 
  3787. using the trace board to sample where the program is. The PPA 
  3788. program updates one counter for each programmed "bin". The result 
  3789. can then be displayed dynamically either in numbers and 
  3790. percentages or with bargraphs. The usage is self explanatory but 
  3791. here follows a short description of the commands:
  3792.  
  3793. The commands are activated by typing the upper case letter 
  3794. associated with each command. You can also move the cursor to the 
  3795. desired command and then press the return key.
  3796.  
  3797. Edit
  3798.  
  3799. Takes you into the edit mode. Use the arrow keys to move to       
  3800. the desired positions to enable or disable any of the       
  3801. "bins" or ranges. Then program the "bin" itself by putting       
  3802. in either a single address or a range of addresses.
  3803. Examples:
  3804.       1000
  3805.       320 TO 330
  3806.       200 L 10
  3807.  
  3808. Run/Hold 
  3809.  
  3810.  If Run is visible and activated the program and the PPA           
  3811. will begin from where the PC is. If Hold is visible and           
  3812. activated the PPA will stop until Run is activated           
  3813. again. (The program will not stop however).
  3814.  
  3815. _________________________________________________________________
  3816. Bargraph On / Bargraph off
  3817.  
  3818. Toggles between showing numbers and bargraphs
  3819. _________________________________________________________________
  3820. Clear count.
  3821.  
  3822. Resets all "bin" counters and immediately starts counting again.
  3823. _________________________________________________________________
  3824. eXit          
  3825.  
  3826. Breaks program execution if it was not active when PPA was 
  3827. entered.
  3828.  
  3829.  
  3830. @@PUT
  3831.  
  3832.                        PUT command
  3833.  
  3834. format:
  3835.       PUT [drive:]filename :macro-name, :macro-name ......
  3836.                          MACRO
  3837.  
  3838. PUT;
  3839.      Stores macro definitions in a DOS file.
  3840.  
  3841. drive:filename;
  3842.      The  drive  and filename of the file that will  receive  the 
  3843. macro definitions.  If the file already exists on that drive, the 
  3844. old  file will be overwritten.  If drive:  is omitted the default 
  3845. drive is assumed.
  3846.  
  3847. MACRO;
  3848.      Stores all macro definitions currently in the macro table.
  3849.  
  3850. :macro-name;
  3851.      The name of a macro preceded by a colon.
  3852.  
  3853. Examples:
  3854.  
  3855. *PUT C:SAVMAC :TSTLOOP :G
  3856. *PUT MACRO
  3857.  
  3858.  
  3859.  
  3860. @@QRA
  3861.  
  3862.                 TRACE QUALIFIER register commands
  3863.  
  3864. (The new TS command is recommended)
  3865.  
  3866. format:
  3867.       QRAx
  3868.       QRBx
  3869.       QRAx = [ADR spec1] & [DAT spec2] & [P1 spec3] & [P3 spec3]
  3870.       QRBx = [ADR spec1] & [DAT spec2] & [P1 spec3] & [P3 spec3]
  3871.  
  3872. x      is 0 - 9
  3873.  
  3874. spec1  is address
  3875.           address TO address
  3876.           address LENGTH number
  3877.           wildcard (hex)
  3878.           wildcard (binary)
  3879. spec2 is  VF + WR + RD + SY1 + SY0 + I2 + I1 + I0 + 8 bit DATA
  3880.           can be specified as in spec1 above. Normally only wild 
  3881.           cards would be used.
  3882. spec3 is  Port 1. 8 bits can be specified as in spec1 above but 
  3883.           normally only wild cards would be used.
  3884.  
  3885. VF = Valid Fetch                   ;active high
  3886. WR = WRite to external memory      ;active high (not low!!!)
  3887. RD = ReaD from external memory     ;active high (not low!!!)
  3888. SY0 = external signal from pod
  3889. SY1 = external signal from pod
  3890. I2, I1, I0  indicates interrupt
  3891. level from 0 to 7.                 ;I2 most significant
  3892.  
  3893.  
  3894.      The QRA and QRB registers are used to set up trig conditions 
  3895. together  with  the TR register.  It can also be  used  as  trace 
  3896. conditions with the TR register.
  3897.  
  3898.      The A and B in QRAx and QRBx stand for A-condition and B-
  3899. condition respectively.
  3900.  
  3901.     The four fields that make up a condition (ADR, DAT, P1, and 
  3902. P3) are ANDed together, meaning that all four fields have to 
  3903. match to produce a true condition. The fields are, however, 
  3904. independent of each other. If you for example set up QRA0 to 
  3905. trace all WRITEs to address 4000H and QRA1 to trace all READs 
  3906. from address 2000H, you will also trace all WRITEs to 2000H and 
  3907. all READs from address 4000H.
  3908.  
  3909.      If any of the four components of the QR register are left 
  3910. out when QRAx (QRBx) is set up, it will default to all wild 
  3911. cards.
  3912.  
  3913.     For an overview of how the trace works see the TRA paragraph.
  3914.  
  3915. Examples:
  3916.  
  3917. QRA0                          ;display QRA0
  3918.  
  3919. QRA1 = A 0 TO 7FF & D xx80    ;set up QRA1 so that it will match
  3920.                                frames only with addresses between
  3921.                                0H and 7FFH when data is 80H. VF,
  3922.                                WR, RD, SY1, SY0, I2, I1, I0, Port
  3923.                                1 and Port 3 will all be set to 
  3924.                                wild cards (don't cares).
  3925.  
  3926. QRB9 = P1 12                  ;set up QRB9 to match frames only 
  3927.                                when Port 1 is 12H
  3928.  
  3929. QRB7  = D 00XXXXXX10000000Y   ;matches only when 80H is read from 
  3930.                                external memory.  Observe the "Y" 
  3931.                                indicating binary.
  3932.  
  3933.  
  3934. @@QUIET
  3935.                       QUIET command.
  3936.  
  3937. format:
  3938.        QUIET
  3939.  
  3940. This command is used to supress printing registers etc. to the
  3941. screen after breakpoints or single steps. Instead of printing
  3942. several lines only a dot, '.', is printed. Normally used to
  3943. speed up executions of MACROs. For this to make a difference the
  3944. CODE WINDOW should be off. Each time the command is used 
  3945. it toggles supression ON or OFF.
  3946.  
  3947.  
  3948. @@RBI
  3949.  
  3950.                            RBIT command
  3951.  
  3952. abbreviation: RBI
  3953.  
  3954. format:
  3955.       RBIT partition [ = boolean expr., boolean expr.], ..
  3956.  
  3957. RBIT;
  3958.      Displays or sets the contents of one or more addresses in 
  3959. the bit addressable memory.
  3960.  
  3961. PARTITION;
  3962.      A single address, or arrange of addresses expressed as 
  3963. "address TO address" or "address LENGTH address". 
  3964.  
  3965. BOOLEAN EXPRESSION;
  3966.      A number,  reference, or expression. The result is truncated 
  3967. to its least significant bit.
  3968.  
  3969. Examples:
  3970. RBIT .CY                 ;display carry bit
  3971.  
  3972. RBI .ACC+4               ;displays bit 4 in the accumulator
  3973.  
  3974. RBI .P1+2                ;displays bit 2 in Port 1
  3975.  
  3976. RBI 0 to 7F = 1          ;set all bit locations in RAM to 1
  3977.  
  3978.  
  3979.  
  3980. @@RBS
  3981.  
  3982.                         RBS command
  3983.  
  3984. format:
  3985.       RBS [= expression]
  3986.  
  3987. RBS;
  3988.      Displays or sets the register bank select (bits 3 and 4 of 
  3989. PSW). RBS governs the location of working registers R0 through R7 
  3990. in internal data memory.
  3991.  
  3992. EXPRESSION;
  3993.      A number,  reference,  or formula that equates to the number 
  3994. expressed.  For RBS,  the result must be 0, 1, 2, or 3. Otherwise 
  3995. an error results.
  3996.  
  3997. Examples:
  3998.  
  3999. RBS                            ;displays current bank number
  4000.  
  4001. RBS=3                          ;Set RBS to 3
  4002.  
  4003.  
  4004. @@RCS
  4005.                        RCS command. Relative Computer Speed.
  4006.  
  4007. RCS will print a number indicating the speed of your computer.
  4008. Here are some numbers:
  4009.  
  4010. 4.7 MHz XT     268
  4011. 10  MHz XT     531
  4012. 20  MHZ '286  2302
  4013.  
  4014. If you run a fast machine and your crystal frequency is low you
  4015. may want to use the -d option when you invoke the emulator.
  4016. (See the INSTALLATION Chapter in the manual.)
  4017.  
  4018.  
  4019. @@REG
  4020.  
  4021.                        REGISTERS command
  4022.  
  4023. abbreviation: R, REG
  4024.  
  4025. format:
  4026.       REGISTERS
  4027.  
  4028. REGISTERS;
  4029.      Displays the contents of program counter  (PC),  accumulator 
  4030. (ACC),  multiplication  register (B),  stack pointer  (SP),  data 
  4031. pointer (DPTR), working registers R0 and R1 in the bank currently 
  4032. selected,  and program status register (PSW). PSW is displayed in 
  4033. binary radix. 
  4034.  
  4035. Instead of "PSW" the register names are displayed. 
  4036. The abbreviations have the following meaning:
  4037.  
  4038. C = Carry flag (CY)
  4039. A = Auxiliary carry flag (AC)
  4040. F = Flag 0 (F0)
  4041. RS = Register bank select control bits (RS1, RS0)
  4042. O = Overflow flag (OV)
  4043. - = reserved
  4044. P = Parity flag (P)
  4045.  
  4046. The other registers are displayed in hexadecimal.
  4047.  
  4048. After the registers, the next instruction is displayed in 
  4049. disassembled form.
  4050.  
  4051.  
  4052. @@REM
  4053.  
  4054.                          REMOVE command
  4055.  
  4056. abbreviation: REM
  4057.  
  4058. format:
  4059.       REMOVE SYMBOLS
  4060.              ..module-name.symbol-name
  4061.              MACROS
  4062.              :macro-name
  4063.  
  4064. REMOVE;
  4065.      Deletes user defined symbols or macros from the symbol table 
  4066. or macro definition table.
  4067.  
  4068. SYMBOLS;
  4069.      Removes all user defined symbols. See the SYM paragraph.
  4070.  
  4071. ..module-name;
  4072.      The name of the module containing the symbol to be removed.
  4073.  
  4074. .symbol-name;
  4075.      The name of a user defined symbol preceded by a period. If 
  4076. two or more symbols exist with the same name, only the first one 
  4077. is removed.
  4078.  
  4079. MACROS;
  4080.      Removes all macro definitions.
  4081.  
  4082. :macro-name;
  4083.      The name of a macro preceded by a colon (:).
  4084.  
  4085. Examples:
  4086.  
  4087. REMOVE SYMBOLS               ;remove all modules, user symbols,
  4088.                               and line numbers.
  4089.  
  4090. REMOVE .VALUE                ;remove the first occurrence of the
  4091.                               user symbol .VALUE.
  4092.  
  4093. REM ..ETON4.LOOP             ;remove the user symbol from one
  4094.                               module.
  4095.  
  4096. REM MACROS                   ;remove macros.
  4097.  
  4098. REM :REPCYC                  ;remove a macro.
  4099.  
  4100.  
  4101.  
  4102. @@REP
  4103.  
  4104.                         REPEAT command
  4105.  
  4106. abbreviation: REP
  4107.  
  4108. format:
  4109.       REPEAT <cr>
  4110.             [command <cr>]
  4111.             [WHILE boolean-expression] <cr>]
  4112.             [UNTIL boolean expression <cr>]
  4113.       ENDREPEAT
  4114.  
  4115. REPEAT;
  4116.      Introduces a block of commands to be repeated.
  4117.  
  4118. <cr>;
  4119.      Intermediate carriage return. It ends each input line but 
  4120. does not terminate the command entry. The carriage return after 
  4121. the END keyword is the termination of the command.
  4122.  
  4123. COMMAND;
  4124.      Any EMUL51-PC command except DEFINE macro and REMOVE macro.
  4125.  
  4126. WHILE;
  4127.      Introduces a halt condition for the command block.  The loop 
  4128. halts when the WHILE condition is tested and found to be FALSE.
  4129.  
  4130. UNTIL;
  4131.      Introduces a halt condition for the command block. The loop 
  4132. halts when the UNTIL condition is tested and found to be TRUE.
  4133.  
  4134. BOOLEAN EXPRESSION;
  4135.      Any number, reference, or expression. The result is TRUE 
  4136. when the least significant bit of the result is 1.  It is FALSE 
  4137. otherwise.
  4138.  
  4139. ENDREPEAT;
  4140.      Terminates entry of the command block. It may be abbreviated 
  4141. to END.
  4142.  
  4143. To end a REPEAT command before a condition ends it, just press 
  4144. the ESC key. It may take a couple of loops before the break 
  4145. occurs.
  4146.  
  4147.  
  4148. Example:
  4149. *REP
  4150. .*STEP
  4151. .*REG
  4152. .*UNTIL PC EQ .DONE
  4153. .*ENDR
  4154.  
  4155.  
  4156.  
  4157. @@RES
  4158.  
  4159.                         RESET commands
  4160.  
  4161. abbreviation: RES
  4162.  
  4163. format:
  4164.       RESET BRx
  4165.             BR
  4166.             QRAx
  4167.             QRBx
  4168.             QRA
  4169.             QRB
  4170.             EM
  4171.             CHIP
  4172.  
  4173. RESET;
  4174.      Restores its object to the initial status of EMUL51-PC.
  4175.  
  4176. BRx  x is 0 - 9;
  4177.      Resets breakpoint register x to no breakpoints.
  4178.  
  4179. BR;
  4180.      Resets breakpoint registers 0 and 1 to no breakpoints.
  4181.  
  4182. QRAx QRBx;
  4183.      Resets the QRAx or QRBx to their inactive state.
  4184.  
  4185. QRA, QRB;
  4186.      Resets all QRA0 - QRA9, or QRB0 - QRB9 to their inactive 
  4187.      states.
  4188.  
  4189. EM;
  4190.      Resets the microprocessor and all registers to their initial 
  4191.      state. This is like restarting the EMUL51-PC.
  4192.  
  4193. CHIP;
  4194.      Resets the microprocessor to its initial state. The same 
  4195.      effect is obtained if the reset push button is pressed. (If 
  4196.      jumper JB1 is closed).
  4197.  
  4198.  
  4199. Examples:
  4200.  
  4201. RES EM                   ;resets hardware and all registers
  4202. RES CHI                  ;resets only hardware
  4203.  
  4204.  
  4205.  
  4206. @@R0
  4207.  
  4208.                   R0 - R7 commands
  4209.  
  4210. format:
  4211.       Rn = [expression]       ;n = 0, 1, 2, 3, 4 ,5 ,6, or 7
  4212.  
  4213. R0 - R7;
  4214.      Display or set contents of working registers in the 
  4215. currently selected register bank. (See the RBS command).
  4216.  
  4217. EXPRESSION;
  4218.      A number,  reference,  or formula that equates to the number 
  4219. expressed. For R0 - R7, the result is truncated to the low byte.
  4220.  
  4221. Examples:
  4222.  
  4223. R0
  4224.  
  4225. R4=20H
  4226.  
  4227. @@SAP
  4228.                     SAve Ppa setup command.
  4229.  
  4230. Format:
  4231.        SAP <[d:]filename>
  4232.  
  4233. Save PPA setup window to a file. Use LOP command to reload.
  4234.  
  4235. Example:
  4236. SAP PPA.SAV              ;Save the PPA window setup to PPA.SAV
  4237.  
  4238.  
  4239. @@SAV
  4240.  
  4241.                         SAVE command
  4242.  
  4243. abbreviation: SAV
  4244.  
  4245. format:
  4246.  
  4247.       SAVE [d:] filename [NOCODE]
  4248.                          [NOSYMBOLS]
  4249.                          [HEXCODE] [partition]
  4250.                          [partition]
  4251.  
  4252. SAVE;
  4253.      Copies  the user program and symbol table to  the  specified 
  4254. drive  and  filename.  If NOCODE or "partition" are NOT used  the 
  4255. partition of code affected by the most recent LOAD or SAVE 
  4256. command will be saved. At start up the default partition is set 
  4257. to 0.  This means that no code will be saved if a SAVE (without 
  4258. partition) is used before LOAD.
  4259.  
  4260. NOCODE;
  4261.      No  code  will be saved.  The symbol table will be saved  if 
  4262. present.
  4263.  
  4264. NOSYMBOLS;
  4265.      No symbols will be saved. Code from the default partition 
  4266. will be saved.
  4267.  
  4268. HEXCODE;
  4269.     The code will be saved in "INTEL HEX" format. This format is 
  4270. used by many PROM programmers. Partition may be used. No symbol 
  4271. table is saved.
  4272.  
  4273. Examples:
  4274. SAV A:MYPROG                   ;save current program to a: drive.
  4275. SAV A:MYPROG NOCODE            ;save only symbols.
  4276. SAV MYPROG NOSYMBOLS           ;save only code.
  4277. SAV MYPROG 0 TO FFF0           ;save code from 0 to FFF0H.
  4278. SAV MYPROG HEXCODE 0 TO 1000   ;save code from 0 to 1000H in
  4279.                                 Intel hex format.
  4280.  
  4281. @@SAW
  4282.                    SAVE WINDOW SETUP command
  4283.  
  4284. format:
  4285.       SAW [d:] filename
  4286.  
  4287. Saves current window setup to the specified file. Use LOW to read 
  4288. file back into the emulator. This makes it possible to store any 
  4289. number of setups and switch between them using the LOW command. 
  4290. For more details on the windows please see the WIN paragraph.
  4291.  
  4292. Examples:
  4293.  
  4294. SAW WIN.SUP                     ;save window setup to WIN.SUP
  4295.                                  in the current directory
  4296. SAW A:XDAT.SUP                  ;save window setup to XDAT.SUP
  4297.                                  on drive a:
  4298.  
  4299. @@SEB
  4300.  
  4301.                     SEt Breakpoints.
  4302.  
  4303. format:
  4304.        SEB
  4305.  
  4306. Description
  4307.  
  4308. The SEB command is used to set the complete 64K bit breakpoint RAM.
  4309. This is useful in conjunction with the ABR command.
  4310. (Automatic Breakpoint Remove). Please see the ABR paragraph for 
  4311. details). For regular breakpoints see the Breakpoint paragraph.
  4312. (F1 at the Breakp. item at the top menu line if you are in the emulator.
  4313. In the manual: see the "Breakpoints. How they work" paragraph).
  4314.  
  4315. Example:
  4316.  
  4317. SEB                   ;set the 64K bit breakpoint RAM to all 1's.
  4318.  
  4319.  
  4320. @@SEC
  4321.  
  4322.                     SECONDS. (EXECUTION TIME COUNTER) command
  4323.  
  4324. abbreviation: SEC
  4325.  
  4326. format:
  4327.       SECONDS
  4328.  
  4329. SECONDS;
  4330.      Displays the number of cycles (in the case of 12MHz crystal 
  4331. equal to microseconds) that elapsed during emulation. The timer 
  4332. is reset when the PC is changed either with a PC command or when 
  4333. the FROM is used in the GO command. RESET EM also resets it.
  4334.  
  4335. @@SERIAL
  4336.  
  4337.  
  4338.     SERIAL SIMULATOR   Map serial port to data source/destination.
  4339.  
  4340.     abbreviation    SER
  4341.  
  4342.       format    SERIAL In   {COM1|COM2} baudrate
  4343.                 KEY  [hotkey (hex)]
  4344.                 FILE filename1
  4345.                 MACRO :macroname1
  4346.                 STR  string
  4347.                Out  {COM1|COM2} baudrate
  4348.                 WIN  upper row  lower row
  4349.                 FILE filename2
  4350.                 MACRO :macroname2
  4351.             SERIAL  OFF
  4352.             SERIAL
  4353.  
  4354. description     When the program under simulation accesses SBUF,
  4355.                 the simulator will intercept the processing and
  4356.                 take an 'action'. The following options are
  4357.                 available:
  4358.  
  4359.                          COM1
  4360.                          COM2   use the COM-port of PC. Its
  4361.                                 baudrate should be set to match
  4362.                                 the external hardware device and
  4363.                                 does not need to correspond to 
  4364.                                 that of the simulated CPU.
  4365.  
  4366.                          KEY    read input from the PC's 
  4367.                                 keyboard. An optional 'hotkey', 
  4368.                                 given in hex, will stop the 
  4369.                                 simulation (default Esc).
  4370.  
  4371.                          WIN    Direct output to a window on the 
  4372.                                 screen.
  4373.  
  4374.                          FILE   read/write data to the specified 
  4375.                                 file, one byte at a time.
  4376.  
  4377.                          MACRO  execute a MACRO.
  4378.  
  4379.                          STR    a string is used as input. The string
  4380.                                 which follows the STR cannot contain
  4381.                                 any blanks. STR and "string" should
  4382.                                 be separated by a blank. The string
  4383.                                 will be used over again after it has
  4384.                                 been exhausted. See example below.
  4385.  
  4386. The timing of RI and TI is determined by the simulated baudrate. 
  4387. The "input device" is only polled at intervals corresponding to a 
  4388. "character time". Then, if a character is available, RI will be 
  4389. set. The RI and TI status bits will be simulated according
  4390. to the following rules:
  4391.                 RI:     if more data is available, the 'RI' bit
  4392.                         will be set. Conditions:
  4393.                 COM     character in buffer
  4394.                 KEY     keyboard hit
  4395.                 FILE    not end-of-file
  4396.                 MACRO   RI set by macro
  4397.                 TI:     set after a delay corresponding to
  4398.                         the baudrate and number of bits.
  4399.  
  4400.  
  4401. Examples:
  4402.  
  4403. SER I KEY O WIN 15    ;input is keyboard, output is screen window 
  4404.                        at starting at row 15 of the screen.
  4405.  
  4406. SER I FILE A:SERDATA O FILE C:SEROUT  ;input is file a:serdata 
  4407.                                        and output is c:serout.
  4408.  
  4409. SER I STR HELLO_THERE O WIN 15   ;input is the string HELLO_THERE
  4410.                                   (the string input cannot have                                    
  4411.                                   any blanks). The string will be                                    
  4412.                                   used over again when it has 
  4413.                                   been exhausted.
  4414.  
  4415. SER I COM1 300 O FILE SAVE        ;COM1 300 baud is used as input.
  4416.  
  4417.  
  4418. @@SL
  4419.  
  4420.                     SL Command
  4421.  
  4422. format:
  4423.        SL [module name]
  4424.  
  4425. This command is used to specify that you want to linestep only in
  4426. a certain module. No breakpoints will be placed in other modules.
  4427. See the L command for detailes on how linestep works.
  4428.  
  4429. Examples:
  4430.  
  4431. L                 ;Linestep in all modules (SL not previously used)
  4432. SL EXEC           ;Enter Line Breakpoints only in module EXEC
  4433. L                 ;Linestep only in module EXEC
  4434. SL                ;Enter Line Breakpoints to Linestep in all modules
  4435. L                 ;Linestep in all modules
  4436.  
  4437.  
  4438. @@SO
  4439.  
  4440.                     SO Command
  4441.  
  4442. format SO [=<type>,<path>,<extension>]
  4443.  
  4444. SO;
  4445. Displays or sets parameters used by the source level debugger.
  4446.  
  4447. <type> Type of source file. 
  4448.        S      stands for a regular source file where line numbers in the 
  4449.               corresponding object file refer to the actual line numbers
  4450.               in the source file. (Unlike Intel's PL/M-51).
  4451.        P      stands for an Intel PL/M-51 file where line numbers in the
  4452.               object file correspond to information not in the source file,
  4453.               but in the list file.
  4454.  
  4455. <path>        By default the debugger will look for the source file (or list
  4456.               file) in the current directory. Setting <path> to point
  4457.               to any other directory will cause the debugger to look there
  4458.               for the file.
  4459.  
  4460.  
  4461. <extension>   By default the extension the debugger looks for is .C.
  4462.  
  4463. Examples:
  4464. SO                          ;display current parameters
  4465. SO=S,\PROJ\FILES\,SRC       ;regular source, source files are in \PROJ\FILES\
  4466.                              extension is .SRC
  4467. SO=P,,LST                   ;Intel PL/M-51, current directory, extension .LST
  4468.  
  4469.  
  4470. @@SL
  4471.                      SL command.
  4472.  
  4473. This command will set breakpoints on all line numbers. Can then be used
  4474. with the GB command. Normally you would simply use the L command which
  4475. automatically sets breakpoints on all line numbers and starts emulation.
  4476.  
  4477.  
  4478. @@SPECIAL
  4479.  
  4480. This command was developed for a specific customer application
  4481. and has no general interest.
  4482.  
  4483. @@SST
  4484.  
  4485.                       SST Single Step Trace
  4486.  
  4487. format:
  4488.        SST ON     (default)
  4489.        SST OFF
  4490.  
  4491. When emulation starts (GO, STEP, GB etc.) the trace buffer is reset and
  4492. all old information is lost. If SST OFF is used a STEP will not affect
  4493. the trace buffer. Instead the trace buffer is left intact. Only the STEP
  4494. command is affected. GO, GB etc. will still reset the old trace buffer.
  4495. The instructions executed by the STEP will NOT be appended to the trace
  4496. buffer.
  4497.  
  4498.  
  4499.  
  4500. @@STA
  4501.  
  4502.                       STACK command
  4503.  
  4504. abbreviation: STA
  4505.  
  4506. format:
  4507.       STACK [expression]
  4508.  
  4509. STACK;
  4510.      Displays  the contents of the EMUL51-PC processor stack area 
  4511. and stack pointer value.
  4512.  
  4513. EXPRESSION;
  4514.      Indicates the number of bytes at the top of the stack to  be 
  4515. displayed.  If  the result exceeds the value of the stack pointer 
  4516. plus one (SP + 1),  the display terminates at data location 0. If 
  4517. the  expression  is omitted,  the display starts at  the  current 
  4518. stack top and stops at data location 0.
  4519.  
  4520. examples:
  4521.  
  4522. *STACK 6                      ;displays 6 bytes of the stack.
  4523.  
  4524. *STA                          ;displays the stack pointer 
  4525.                                value  and the contents of the 
  4526.                                stack area.
  4527.  
  4528.  
  4529.  
  4530. @@STE
  4531.  
  4532.                            STEP command
  4533.  
  4534. abbreviation: S
  4535.  
  4536. format:
  4537.       STEP [FROM address]
  4538.       STEP <number>
  4539.  
  4540. STEP;
  4541.      Executes one instruction, then stops and displays registers, 
  4542. and shows the next instruction in disassembled form.
  4543.  
  4544. FROM;
  4545.      Sets the PC to "address". If the FROM is omitted, the 
  4546. current PC is used.
  4547.  
  4548. <number>
  4549.      Will single step specified number of times. ESC will abort stepping.
  4550.  
  4551. Examples:
  4552.  
  4553. STEP                          ;step one step from current PC.
  4554. S F .LOOP                     ;steps one step starting at .LOOP.
  4555. S 10                          ;make 10 single steps.
  4556.  
  4557.  
  4558. @@NEXT
  4559.                      Step Next Commands. SN, N and J
  4560.  
  4561. format:
  4562.       SN [FROM <address>]
  4563.       J
  4564.       N
  4565.  
  4566. The SN command is "single straight step". The regular Step will 
  4567. always execute the next instruction, which means that it will go 
  4568. through all subroutine calls and interrupt service routines. The 
  4569. SN command on the contrary, will skip over CALLs, and 
  4570. interrupts. This means, of course, that if you don't come back 
  4571. after a subroutine or an interrupt the program will continue to execute 
  4572. forever or until you hit the ESC key or encounter another breakpoint.
  4573.  
  4574. The SN command uses it own "disassembly pointer" to calculate where 
  4575. the next instruction is located. This means that in order for this 
  4576. "disassembly pointer" to be initialized you must first use 
  4577. SN FROM <address>. SN F PC will make it start from the present 
  4578. location. Thereafter SN with no parameters should be used.
  4579. SN will follow JUMP instructions and branch instructions. It will
  4580. also step out of subroutines and interrupt service routines, but
  4581. will not go into subroutines or interrupt service routines.
  4582. After breakpoints and regular single steps the next instruction
  4583. in line to be executed will be shown together with some register
  4584. values. In the "SN mode", however, the next instruction in
  4585. "straight line" will be shown. Observe that this instruction may
  4586. or may not be the next instruction in turn to be executed. An 
  4587. indefinite number of instructions in a subroutine or in an interrupt
  4588. service routine may be executed before it. It will, however, be the
  4589. last instruction to be executed before a break is taken. Also note
  4590. that SN uses the BR0 breakpoint register.
  4591. Any previous breakpoints held in this register will be destroyed.
  4592.  
  4593. N and J is used only to skip over LCALLs and ACALLs. With these two
  4594. commands no "disassembly pointer" is used. Instead the PC (Program 
  4595. Counter) is used. If PC points to a LCALL or a ACALL a breakpoint 
  4596. will be generated on the instruction following the CALL. Then with
  4597. the "N" command a GO SLOW (GS) will be executed. The break will then
  4598. be taken on the instruction following the CALL. The "J" command will
  4599. instead execute a "GO" and consequently run through the subroutine at 
  4600. full speed. "J" will work as regular breakpoints, which means that the
  4601. instruction following the CALL will be executed before the break is 
  4602. taken.
  4603.  
  4604. It is important to realize that J will execute the 
  4605. instruction following the CALL before the break is taken. If for
  4606. example you had two LCALLs following each other the first one could
  4607. be skipped over using J. But the next LCALL instruction would
  4608. be executed resulting in that you would wind up in the second sub-
  4609. routine without being able to step over it. This would not happen
  4610. with the SN and N commands.
  4611.  
  4612. The SN command should NOT be used with the CODE window even though
  4613. it works fine. The update information on the next "straight line"
  4614. instruction will not be shown so it would be difficult to make any
  4615. sense out of it.
  4616.  
  4617. Examples:
  4618.  
  4619. SN F 1000                 ;Set "disassembly pointer" at 1000 and step
  4620.                            straight to the next instruction.
  4621.  
  4622. SN                        ;Step straight to the next instruction starting
  4623.                            from the "disassembly pointer".
  4624.  
  4625. J                         ;Step straight starting from the "PC" at 
  4626.                            full speed.
  4627.  
  4628. N                         ;Step straight starting from the "PC" at
  4629.                            GO SLOW speed.
  4630.  
  4631.  
  4632. @@SNAP
  4633.  
  4634.                         SNAP command
  4635.  
  4636. format:
  4637.       SNAP <mode>, [<type>, <address>]
  4638.  
  4639. <mode>
  4640.        0 Disable SNAP
  4641.        1 Enable SNAP
  4642.        2 Enable "one shot SNAP"
  4643.        3 Enable "show one address only SNAP"
  4644.        4 Enable "show one address only one shot SNAP".
  4645.  
  4646. <type> (only used in modes 3 and 4 above)
  4647.  
  4648.        D (internal data)
  4649.        R (Special Function Register SFR)
  4650.        X (External Data)
  4651.  
  4652. <address> address of desired "SNAP address". 
  4653.           (only used in modes 3 and 4 above)
  4654.  
  4655.  
  4656. Description:
  4657.  
  4658. The SNAP command changes the use of breakpoints. Rather than actually
  4659. breaking it uses the break only to update the windows (mode 1 and 2) or
  4660. displaying the specified address (mode 3 and 4) before execution is 
  4661. resumed. Once SNAP is activated (mode 1 and 3) the only way to stop
  4662. execution is to do: "SNAP 0". Otherwise each attempt to break only will
  4663. result in updating windows or specified address. Mode 2 and 4 will
  4664. automatically return to mode 0 after the first breakpoint was 
  4665. encountered and used to update.
  4666.  
  4667. Examples:
  4668.  
  4669. SNAP 1              ;Use breakpoints to update windows
  4670. SNAP 2              ;One shot update
  4671. SNAP 3 D 20         ;Display data address 20 at each breakpoint
  4672. SNAP 3 X 3000       ;Display external data address at each breakpoint
  4673. SNAP 4 R 80         ;Display SFR at address 80 one time
  4674. SNAP 4 R .SBUF      ;Display SBUF one shot.
  4675.  
  4676.  
  4677. @@SUF
  4678.  
  4679.                         SUFFIX command
  4680.  
  4681. abbreviation: SUF
  4682.  
  4683. format:
  4684.       SUFFIX = [Y]
  4685.                [Q]
  4686.                [T]
  4687.                [H]
  4688.  
  4689. SUFFIX;
  4690.      Displays or sets the default radix for numbers entered at 
  4691. the console.
  4692.  
  4693. Y;
  4694.      Binary radix.
  4695.  
  4696. Q;
  4697.      Octal radix.
  4698.  
  4699. T;
  4700.      Decimal radix.
  4701.  
  4702. H;
  4703.      Hexadecimal radix. Hexadecimal is the initial default radix.
  4704.  
  4705. Examples:
  4706.  
  4707. *SUFFIX                       ;displays current radix.
  4708.  
  4709. *SUF = Y                      ;sets to binary radix.
  4710.  
  4711. *SUF = H                      ;sets to hexadecimal.
  4712.  
  4713.  
  4714. @@SWD
  4715.                    SETUP WINDOW DATA ADDRESS
  4716.  
  4717. format:
  4718.       SWD <data address>       (0 < data address < E7H)
  4719.  
  4720.  
  4721. Sets up the first address to be displayed in the DATA window. 
  4722. The contents of this address and the contents of the next 23 
  4723. addresses will be automatically displayed in the DATA window. 
  4724. Please refer to the WIN paragraph for an overview on the 
  4725. windows.
  4726.  
  4727. Examples:
  4728.  
  4729. SWD 40               ;first address to be displayed will be 40H
  4730. SWD 80               ;only relevant in 8052 type CPU's.
  4731.  
  4732.  
  4733. @@SWR
  4734.                  SETUP REGISTER WINDOW command
  4735.  
  4736. format:
  4737.       SWR
  4738.       SWR <position> <type> <symbol> <address>
  4739.  
  4740.       1 <= position <= 18
  4741.  
  4742.       type = DB, RB, RBI, XB, CB or PB.  (or any equivalent 
  4743.                                           notation.)
  4744.       symbol = any ASCII string max 8 characters.
  4745.  
  4746.       0 <= address <= FFFFH
  4747.  
  4748. The 18 positions have the following physical placement on the 
  4749. screen:
  4750.  
  4751. 1.         4.        7.        10.        13.        16.
  4752. 2.         5.        8.        11.        14.        17.
  4753. 3.         6.        9.        12.        15.        18.
  4754.  
  4755.  
  4756.  
  4757.  
  4758. The SWR command makes it possible to set up any of the 18 
  4759. positions in the REGISTER window to reflect any address in any 
  4760. of the different address spaces of the microprocessor. Using 
  4761. the SWR command without any parameters will show the setup. 
  4762. Please see the WIN paragraph for an overview on the windows.
  4763.  
  4764. Examples:
  4765.  
  4766. SWR                        ;display current setup
  4767.  
  4768. SWR 10 XB X4000 4000       ;make position 10 on the screen 
  4769.                             reflect the contents of external 
  4770.                             address 4000H. The symbol X4000 is
  4771.                             chosen to indicate eXternal memory 
  4772.                             4000H, but the symbol may be any
  4773.                             ASCII string with less than 9 
  4774.                             characters.
  4775.  
  4776. SWR 2 RB IRCON C0          ;Interrupt Request Control Register
  4777.                             (used in Siemens 80535). Displayed in 
  4778.                             position 2. RB indicates Register 
  4779.                             Byte.
  4780.  
  4781.  
  4782. @@SWX
  4783.                    SETUP WINDOW EXTERNAL DATA ADDRESS
  4784.  
  4785. format:
  4786.       SWX <external data address>       (0 < address < FFE7H)
  4787.       
  4788.    
  4789.  
  4790. Sets up the first external address to be displayed in the XDATA 
  4791. window. The contents of this address and the contents of the next 
  4792. 23 addresses will be automatically displayed in the XDATA window. 
  4793. Please refer to the WIN paragraph for an overview on the windows.
  4794.  
  4795. Examples:
  4796.  
  4797. SWX 40               ;first address to be displayed will be 40H
  4798. SWX 1000             ;first address to be displayed is 1000H
  4799.  
  4800.  
  4801.  
  4802. @@SY0
  4803.  
  4804.                        The SY0A command.
  4805.  
  4806.  
  4807. format:
  4808.       SY0A
  4809.       SY0A = H [L]
  4810.  
  4811. SY0A;
  4812.      Displays or sets the SY0A register.  This command determines 
  4813. if SY0 shall be active high (default) or active low.
  4814.  
  4815. Examples:
  4816. SY0A                          ;displays SY0A
  4817. SY0A = L                      ;sets SY0A to active low
  4818. SY0A = H                      ;sets SY0A to active high.
  4819.        
  4820.  
  4821.  
  4822. @@SYM
  4823.  
  4824.                         SYMBOLS command
  4825.  
  4826. abbreviation: SYM
  4827.  
  4828. format:
  4829.       SYMBOLS [module name | ?] [symbol name | ?] [data type | ?]
  4830.                                              [address] [| more]
  4831.  
  4832. "|" means "or"  except [| more] where | should be typed
  4833.  
  4834. SYMBOLS;
  4835.      Displays  user defined symbols and  their  corresponding 
  4836. values. Or as specified.
  4837.  
  4838. Example:
  4839.  
  4840. SYM                      ;display all symbols.
  4841.  
  4842. SYM ESIN ? ?             ;display all symbols in module ESIN
  4843.  
  4844. SYM ? SEW BIT            ;display all BIT symbols with the name SEW
  4845.  
  4846. SYM ? ? DATA             ;display all DATA symbols
  4847.  
  4848. SYM ? ? MOD_BEG          ;displays all module names
  4849.  
  4850. SYM ? ? MOD              ;displays all MOD_BEG and MOD_END. Useful to
  4851.                           see where modules begin and end!
  4852.  
  4853. SYM ? ? ? 2014           ;display all symbols with value 2014 (hex)
  4854.  
  4855. SYM | more               ;stop listing after 5 lines. Resume with 
  4856.                           keystroke. Line numbers (LINE) will not 
  4857.                           count in the "5 lines".
  4858.  
  4859. @@SYML
  4860.  
  4861.                        SYMLOAD command
  4862.  
  4863. abbreviation: SYML
  4864.  
  4865. format:
  4866.       SYMLOAD <filename>
  4867.  
  4868. <filename> is a file created by a utility program that extracts
  4869. line number information from a list file created by an 8051 cross-
  4870. assembler. The format of the contents of this file should be:
  4871.  
  4872. <filename.ext> <linenumber in decimal> <address in hex>
  4873.  
  4874. example:
  4875.  
  4876. 51demo.lst 43 0000
  4877. 51demo.lst 46 000B
  4878. 51demo.lst 47 000E
  4879. 51demo.lst 48 0010
  4880.  
  4881. SYMLOAD should be used in conjunction with the loadable file created
  4882. by the crossassembler.
  4883.  
  4884. Nohau provides a utility, CONVERT.EXE which works on some assembly
  4885. list files. There is no guarantee that it will work on your assembly
  4886. list file. Therefore we provide CONVERT.C which is the source file
  4887. of CONVERT.EXE so that you can modify this to work on you list file.
  4888. Below is a description of how CONVERT works:
  4889.  
  4890.     CONVERT <list file name> <output line number file name>
  4891.  
  4892.     e.g. CONVERT 51DEMO.LST 51DEMO.LSY
  4893.  
  4894. Restrictions are that the list files must have absolute addresses
  4895. (linking not necessary to resolve absolute addresses).  Also 'org ' 
  4896. is a keyword that must be followed by hex address.
  4897.  
  4898. This was tried on two assembler list files.  They both had
  4899. format: <hexaddress>  <opcode>  <linenumber>  <source statement>.
  4900. Changes will need to be made for other assemblers.
  4901.  
  4902. This is a typical sequence of commands that would be used in the
  4903. emulator to debug in "assembly source":
  4904.  
  4905. SO = S,\FILES\ASSY\,ASM     ;see SO command for details
  4906. LOAD PROG.OBJ               ;Load object file created by the assembler
  4907. SYML PROG.LSY               ;PROG.LSY contains line symbols as 
  4908.                              described above
  4909. CW                          ;Turn on the CODE WINDOW
  4910.  
  4911. Now you should see a mix of the source code from PROG.ASM and 
  4912. disassembly of the code from the emulator. To view only source
  4913. press function key F2. F2 toggles between mixed mode and source 
  4914. mode. You may use the L or the S commands to step in your code.
  4915. Use CTRL+R to see registers. Also see Source Level Debugging for 
  4916. more details.
  4917.  
  4918.  
  4919.  
  4920. @@SYS
  4921.  
  4922.                        SYSTEM command
  4923.  
  4924. abbreviation: SYS
  4925.  
  4926. format:
  4927.       SYSTEM <DOS command>
  4928.  
  4929. SYSTEM
  4930.      Executes the specified DOS command and returns to the 
  4931. emulator. Enough memory must be available for this to work. Also 
  4932. COMMAND.COM must be available on the drive from which you loaded 
  4933. DOS.
  4934.  
  4935. Examples:
  4936. SYS AEDIT MYPROG.SRC          ;executes AEDIT to edit the 
  4937.                                file MYPROG.SRC When you exit from 
  4938.                                AEDIT you return to EMUL51-PC
  4939.  
  4940. SYS DIR \BIN\*.OBJ            ;Makes a directory of all files 
  4941.                                with the extension OBJ in 
  4942.                                subdirectory BIN, then returns to 
  4943.                                EMUL51-PC
  4944.  
  4945.  
  4946. @@TABS
  4947.                        TAB command.
  4948.  
  4949. format:
  4950.        TAB
  4951.        TAB <number>
  4952.  
  4953. This command displays or changes the number of blanks that replaces
  4954. TABs from a source file. Useful when the CODE WINDOW is used with
  4955. source level debugging. Default number is 8.
  4956.  
  4957.  
  4958. Examples:
  4959.  
  4960. TAB 4        ;use 4 blanks for TAB expansion
  4961. TAB          ;display TAB expansion
  4962.  
  4963.  
  4964. @@TB
  4965.  
  4966.                        TRACE BEGIN command.
  4967.  
  4968. format:
  4969.        TB
  4970.  
  4971. TRACE BEGIN;
  4972.      Begins a new trace. TB can only be used when the EMUL51-PC 
  4973. is in emulation mode.
  4974.  
  4975.  
  4976.  
  4977. @@TBR
  4978.                       TRACE BREAKPOINT command.
  4979.  
  4980. format:
  4981.       TBR = [ON]
  4982.             [OFF]
  4983.  
  4984. The TBR command displays, sets or resets the TBR register. 
  4985. If TBR = ON a trig condition on the trace will unconditionally 
  4986. break emulation. Observe that this command together with 
  4987. appropriate setting of the QR's can be used to set new 
  4988. breakpoints even after the emulation has begun. (See the 
  4989. TRA paragraph for details on how to set up trace 
  4990. conditions. See BRK paragraph for details on how the TBR 
  4991. breakpoint works).
  4992.  
  4993. Examples:
  4994.  
  4995. TBR                      ;display status of the TBR register
  4996. TBR = ON                 ;activate TBR
  4997. TBR = OFF                ;reset TBR
  4998.  
  4999.  
  5000. @@TC
  5001.  
  5002.                        TRIG COUNTER command
  5003.  
  5004. format:
  5005.       TC [= decimal number]
  5006.  
  5007. TC
  5008. Displays or sets the trig counter. By default the trig counter is 
  5009. set in the middle of the trace buffer. The TC register is used to 
  5010. count the number of frames to be traced after the trace 
  5011. encountered a trig condition. A low number gives you more 
  5012. information of what happened before the trig point, while a 
  5013. larger number gives you more information what happened after the 
  5014. trig condition. (Usually done in the TS screen instead of from the 
  5015. command line).
  5016.  
  5017. Examples:
  5018.  
  5019. TC                       ;Display current setting of TC
  5020. TC = 0                   ;trace stops immediately after the trig
  5021.                           condition was encountered.
  5022. TC = 2000                ;2000 frames after trig will be 
  5023.                           collected. With the 4K deep trace
  5024.                           buffer you will also have about 2000 
  5025.                           frames collected before trig
  5026. TC = 4000                ;You will get about 90 frames before 
  5027.                           trig and 4000 frames after the trig.
  5028.                           (With the 4K deep trace buffer).
  5029.  
  5030.  
  5031.  
  5032. @@TD
  5033.  
  5034.                         TRACE DISPLAY command.
  5035.  
  5036. format:
  5037.       TD [frame]
  5038.       TDS [frame]
  5039.       TDP [frame]
  5040.       TDD [frame]
  5041.  
  5042. TD
  5043. Displays frames collected in the trace buffer, in disassembled 
  5044. form. Special text lines like *** PROCESSING INTERRUPT ***, or
  5045. *** MAIN *** clarifies what has been collected. If TD is used 
  5046. without a frame number, frames around the trig point will be 
  5047. displayed. If trace was interrupted, either by a break condition 
  5048. or a TE command, the last frames in the trace buffer will be 
  5049. displayed. The trig frame is always number 0. All frames before 
  5050. the trig frame are minus frames. (see example below). 
  5051.  
  5052. If you have used the trace filter function you must be careful 
  5053. when you use the TD command, as the disassembler will not recognize
  5054. if some frames are missing.
  5055.  
  5056. The TDP command is the same as TD, but displays ports and external 
  5057. data addresses in addition to the regular TD display.
  5058.  
  5059. The TDD command is the same as TD, but displays DMA info ('152 and '452),
  5060. external data addresses and data in addition to the regular TD display.
  5061.  
  5062. For more details see the TRA paragraph.
  5063.  
  5064. TDS
  5065. As TD but displays from "file buffer". See OST command for 
  5066. details.
  5067.  
  5068. Examples:
  5069. TD                       ;display frames around the trig point
  5070. TD -4000                 ;display starting with frame number 
  5071.                           -4000. (4000 frames before the trig)
  5072. TD 319                   ;display starting with frame number
  5073.                           319 after the trig point.
  5074.                               
  5075.  
  5076.  
  5077. @@TDF
  5078.  
  5079.                         TRACE DISPLAY FRAMES command.
  5080.  
  5081. format:
  5082.       TDF [frame]
  5083.       TDFL start [TO stop] [-filename]
  5084.            start [LEN number] [-filename]
  5085.       TDFS [frame]
  5086.  
  5087. TDF
  5088. Displays frames collected in the trace buffer, in frame 
  5089. form. If TDF is used without a frame number, frames around the 
  5090. trig point will be displayed. If trace was interrupted, either by 
  5091. a break condition or a TE command, the last frames in the trace 
  5092. buffer will be displayed. The trig frame is always number 0. All 
  5093. frames before the trig frame are minus frames. (see example 
  5094. below). For more details see the TRA paragraph.
  5095.  
  5096. TDFL
  5097. Works  as TDF but outputs continuous data without  stopping 
  5098. after  each page.  If the optional -filename is  used,  the 
  5099. output is written to the specified file only and not to the 
  5100. screen. In this case LIST should not be active.
  5101.  
  5102. TDFS
  5103. As TDF but displays from "file buffer". See OST commands for 
  5104. details.
  5105.  
  5106. Examples:
  5107. TDFS                       ;display frames around the trig point
  5108. TDFS -4000                 ;display starting with frame number 
  5109.                            -4000. (4000 frames before the trig)
  5110. TDF 319                   ;display starting with frame number
  5111.                            319 after the trig point.
  5112.  
  5113. TDFL -1000                ;displays all frames starting at -1000
  5114.  
  5115. TDFL -500 TO -400         ;displays all frames between -500 and 
  5116.                            -400
  5117.  
  5118. TDFL -100 -FRAME.SAV      ;saves all frames from -100 to the file 
  5119.                            FRAME.SAV in the current directory.
  5120.  
  5121. TDFL -1000 TO 1000 -\TRACE\SAMPLE1    ;saves all frames between
  5122.                                        -1000 and 1000 to the file 
  5123.                                        SAMPLE1 in the sub 
  5124.                                        directory  \TRACE
  5125.  
  5126.  
  5127. @@TDL
  5128.                        TRACE DISPLAY LIST Command.
  5129.  
  5130. format:
  5131.        TDL  frame [TO frame] [-filename]
  5132.                  [LEN number] [-filename]
  5133.  
  5134.        TDSL frame [TO frame] [-filename]
  5135.                  [LEN number] [-filename]
  5136.  
  5137.        TDPL  frame [TO frame] [-filename]
  5138.                  [LEN number] [-filename]
  5139.  
  5140.        TDDL  frame [TO frame] [-filename]
  5141.                  [LEN number] [-filename]
  5142.  
  5143. Works  as TD but outputs continuous data  without  stopping 
  5144. after  each page.  If the optional -filename is  used,  the 
  5145. output is written to the specified file only and not to the 
  5146. screen. In this case LIST should not be active.
  5147.  
  5148. TDSL works as TDL but from the "trace file".
  5149.  
  5150. TDPL shows information with ports and External Data Addresses.
  5151.  
  5152. TDDL shows information with DMA cycles (for '152 and '452), 
  5153. External Data Addresses and data.
  5154.  
  5155. Examples:
  5156.  
  5157. TDL -4000                 ;display starting with frame number 
  5158.                            -4000. (4000 frames before the trig)
  5159. TDL 319                   ;display starting with frame number
  5160.                            319 after the trig point.
  5161.  
  5162. TDL -1000                ;displays all frames starting at -1000
  5163.  
  5164. TDL -500 TO -400         ;displays all frames between -500 and 
  5165.                            -400
  5166.  
  5167. TDL -100 -FRAME.SAV      ;saves all frames from -100 to the file 
  5168.                            FRAME.SAV in the current directory.
  5169.  
  5170. TDL -1000 TO 1000 -\TRACE\SAMPLE1    ;saves all frames between
  5171.                                        -1000 and 1000 to the file 
  5172.                                        SAMPLE1 in the sub
  5173.                                        directory  \TRACE   
  5174.  
  5175.  
  5176. @@TE
  5177.  
  5178.                         TRACE END command.
  5179.  
  5180. format:
  5181.       TE
  5182.  
  5183. TRACE END;
  5184.      Ends trace.  TE can only be used when EMUL51-PC is in 
  5185. emulation mode.
  5186.  
  5187.  
  5188.  
  5189. @@TR
  5190.  
  5191.                    TRACE REGISTER command.
  5192.  
  5193. (the new TS command is recommended)
  5194.  
  5195. format:
  5196.       TR
  5197.       TR = TRACE ALL    & TRIG NOTRIG    & ITRAC ALL
  5198.                  ACOND         ACOND             INT
  5199.                  BCOND         BCOND             MAIN
  5200.                  A & B         ACOND THEN BCOND
  5201.                                A LOOP
  5202.                                A LOOP THEN B
  5203.  
  5204. TRACE REGISTER;
  5205.      Displays or sets the Trace Register.  Any combination of the 
  5206. TRACE,  TRIG and ITRIG conditions may be set.  The examples below 
  5207. provide a number of possibilities.
  5208.  
  5209. Examples:
  5210.  
  5211. TR                            ;displays Trace Register.
  5212.  
  5213. TR = TRA A & B                ;sets trace condition to ACOND 
  5214.                                and BCOND. Both A and B must 
  5215.                                be true to trace.
  5216.  
  5217. TR  = TRI A LOOP              ;sets the trace to trig when the  A 
  5218.                                condition(s)  has  appeared   the 
  5219.                                number  of times set in LC  (Loop 
  5220.                                Counter).
  5221.  
  5222. TR  =  ITR MAIN               ;traces only instructions in the 
  5223.                                main program. It does not trace 
  5224.                                instructions executed within 
  5225.                                interrupts.
  5226.  
  5227. TR  = TRA ALL & TRI A          ;traces all.  Trigger on A 
  5228.                                 condition(s).
  5229.  
  5230.      Any TRACE,  TRIG and ITRAC not mentioned in a setup, remains 
  5231. untouched.   
  5232.  
  5233.  
  5234. @@TS
  5235.  
  5236.                    Trace Set Command.
  5237.  
  5238. format:
  5239.       TS
  5240.  
  5241. This command takes you to a "static screen" where all trace 
  5242. functions can be programmed and altered. This replaces the 
  5243. following commands: TR, TC, LC, QRAx, QRBx, RES QRAx, RES QRBx. 
  5244. The use of the TS screen is explained in detail under the TRA 
  5245. paragraph. Accessible from the TRACE item at the top menu line.
  5246. (Via the F1 key).
  5247.  
  5248.  
  5249. @@TSG
  5250.  
  5251.         EMUL51       TSGET. Trace Status GET.
  5252.  
  5253.  
  5254. abbreviation: TSG
  5255.  
  5256. format:
  5257.        TSGET [drive]<filename>
  5258.  
  5259. Description:
  5260.  
  5261. Loads a previously saved trace set up window. (Saved with TSPUT).
  5262.  
  5263. Example:
  5264.  
  5265. TSG COPTRIG              ;loads COPTRIG to the TS window
  5266.  
  5267.  
  5268. @@TSP
  5269.  
  5270.                      TSPUT. Trace Status PUT.
  5271.  
  5272.  
  5273. abbreviation: TSP
  5274.  
  5275. format:
  5276.        TSPUT [drive]<filename>
  5277.  
  5278. Description:
  5279.  
  5280. Saves the TS window (Trace Set). (Loads back with TSGET).
  5281.  
  5282. Example:
  5283.  
  5284. TSP COPTRIG              ;saves contents of the TS window to the file
  5285.                           COPTRIG.
  5286.  
  5287.  
  5288.  
  5289. @@VER
  5290.  
  5291.                          VERSION command
  5292.  
  5293.  
  5294. format:
  5295.       VER
  5296.  
  5297. VER
  5298.    Displays software version number. Also displayed when EMUL51 
  5299. is invoked.
  5300.  
  5301.  
  5302.  
  5303. @@WAI
  5304.  
  5305.                     WAIT command.
  5306.  
  5307. format:
  5308.       WAIT
  5309.       WAIT <number>
  5310.  
  5311. The WAIT command outputs the text "Press any key to continue" to 
  5312. the screen. It then waits for a key stroke before it continues. 
  5313. This could be useful to halt execution of REPEAT commands to be 
  5314. able to read results of emulation.
  5315.  
  5316. WAIT <number>  forces a delay of <number> seconds before returning
  5317. to the prompt.
  5318.  
  5319. Examples:
  5320.  
  5321. WAIT
  5322. WAIT 10    ;wait 10 seconds before continuing
  5323.  
  5324.  
  5325. @@WRI
  5326.  
  5327.                            WRITE command
  5328.  
  5329. abbreviation: WRI
  5330.  
  5331. format:
  5332.       WRITE  [expression]
  5333.              [string]
  5334.  
  5335. WRITE;
  5336.      Displays an (evaluated) expression or a string of characters 
  5337. for a sequence of such elements on your monitor.
  5338.  
  5339. EXPRESSION;
  5340.      A number, reference, or formula that equates to the number 
  5341. expressed.  For WRITE, the expression is 
  5342. evaluated and the result is displayed in hex.
  5343.  
  5344. STRING;
  5345.      A sequence of characters enclosed in apostrophes (').
  5346.  
  5347. Examples:
  5348.  
  5349. WRI 'START PUMP 1'                 ;displays message.
  5350.  
  5351. WRITE .SEC, 'SECONDS PASSED'       ;expression and text.
  5352.  
  5353. (See the MRO paragraph (MACROS) for more information).
  5354.  
  5355.  
  5356. @@25
  5357.  
  5358.                 25, 43, 50 Commands.
  5359.  
  5360. format:
  5361.        25
  5362.        43
  5363.        50
  5364.  
  5365. Used to switch to 25, 43 or 50 lines on the display. These 
  5366. commands will only work if your hardware is set up to handle
  5367. 43 or 50 lines. (EGA for 43 lines and VGA for 50 lines).
  5368.  
  5369. @@WATCH
  5370.            ? and W[x]? Commands. To display C variables.
  5371.  
  5372. format: 
  5373.        ?[*..]name[,[#][x | s | d]] [=value]
  5374.        w[z]?[*..]name[,[#][x|s]] [=value]       (Descriptions and 
  5375.                                                  example at the 
  5376.                                                  end of this 
  5377.                                                  paragraph)
  5378.  
  5379.     Details for the '?' command explained as follows:
  5380.  
  5381.     -   no <space> between the '?' and the variable name!
  5382.     -   pointers can be preceeded by an appropriate number of
  5383.         indirections ('*'). Only last component of the 'name'
  5384.         need be a pointer.
  5385.     -   'name' is a simple C-expression for a variable with the
  5386.         following features:
  5387.         -   nesting of pointers, arrays and structures.
  5388.         -   a single element in an array to be given
  5389.             by a decimal number in brackets.
  5390.         -   no parenthesis permitted.
  5391.         -   the default format can be changed by a trailing:
  5392.             ,#          a repeat counter
  5393.             ,x          hex format
  5394.             ,#x         combination of above
  5395.             ,s          string format
  5396.             ,d          decimal format
  5397.  
  5398.             otherwise 'floats' are printed as 'floats',
  5399.                   'ints' as decimal 'ints',  etc.
  5400.  
  5401.         -   new values can be assigned to simple variables
  5402.             (using the same format for input and output).
  5403.  
  5404.        Example:
  5405.  
  5406.         C-declarations:
  5407.  
  5408.         struct { int number; char name[8]; } list[3] = {
  5409.              1,  "ADAM",
  5410.              4,  "DAVID",
  5411.             15,  "ROBERT" };
  5412.  
  5413.         struct tag {
  5414.             struct tag *next;
  5415.             char   symbol[20];
  5416.             } head,*p=head;
  5417.  
  5418.         int     i = 0x1000;
  5419.         int     tbl[6] = { 10,11,12,13,14,15 };
  5420.         int     *ptbl  = tbl;
  5421.         int     *pptbl = ptbl;
  5422.  
  5423.  
  5424.         Command             Output
  5425.  
  5426.         ?i                  4096
  5427.         ?i,x                0x1000
  5428.         ?tbl[4]             14
  5429.         ?*ptbl              10
  5430.         ?*ptbl,3            10,11,12
  5431.         ?**pptbl            10
  5432.         ?ptbl               D:ADDR:
  5433.                      where    'D' is memory type
  5434.                      and   'ADDR' is hex-value of pointer
  5435.  
  5436.         ?list               {{1,"ADAM",4},{"DAVID"},{15,"ROBERT"}}
  5437.         ?list[2].name       "ROBERT"
  5438.         ?list[0].name[3]    'M'
  5439.         ?head.next->symbol  "nextsymb"
  5440.         ?p->next->symbol    "nextsymb"
  5441.         ?*p                 {X:1234,"headsymbol"}
  5442.  
  5443.  
  5444.          Only simple items can be assigned to new values,
  5445.          but it works in complex expressions.
  5446.  
  5447.          e.g.      ?list[3].name[2] = 'A'
  5448.                   ( or  = 0x41 )
  5449.  
  5450.             sets a single character in the string 'name[]'
  5451.             which is a member of a struct. 'list' is an
  5452.             array of structs.
  5453.  
  5454.             Note. The input format is always the same as
  5455.             the output format, but can always be overridden
  5456.             by '0x' for input of HEX code.
  5457.  
  5458.             int *tbl;
  5459.  
  5460.             ?*tbl = 100
  5461.  
  5462.           but   ?*tbl,4 = 1024
  5463.             *tbl: {100,2,3,4}
  5464.             assignment ignored
  5465.  
  5466.                  prints 4 elements and ignores the
  5467.                  assignment since only single simple
  5468.                  item can be assigned.
  5469.  
  5470.  
  5471.     If a symbol is multiply defined, the local variable is taken
  5472.     before a global variable.
  5473.  
  5474.     When the watch window is enabled (visible) you may define new
  5475.     watchpoints by typing  'w[x]' before the expression described above.
  5476.     The Watch window is enabled with ENA WAT or Ctrl+W.
  5477. -------------------------------------------------------------------------
  5478. The w[z]? Command:
  5479.  
  5480.     Syntax:     w[z]?[*..]name[,[#][x|s]] [=value]
  5481.  
  5482.         where [z] is an optional number to specify in which location 
  5483.         in the Watch window the variable is to appear. If the [z] is 
  5484.         omitted the current contents in the Watch window will scroll up.
  5485.  
  5486.         Definition of locations:
  5487.  
  5488.         1.
  5489.         2.
  5490.         3.
  5491.         4.
  5492.  
  5493.  
  5494.     Example:   w2?tbl
  5495.  
  5496.  
  5497. @@COPYRIGHT
  5498.  
  5499.                            COPYRIGHT
  5500.  
  5501. Copyright (C) 1986 - 1991 by NOHAU Corporation. All rights 
  5502. reserved worldwide.
  5503.  
  5504.                      D I S C L A I M E R
  5505.  
  5506. Nohau Corporation's EMUL51-PC is sold with a one-year warranty on 
  5507. the hardware. The software is sold with no warranty, but upgrades 
  5508. will be distributed to all customers up to one year from the date 
  5509. of purchase.
  5510.  
  5511. Nohau Corporation makes no warranties, expressed or implied, 
  5512. including, but not limited to, the implied warranties of 
  5513. merchantability and fitness for a particular purpose. In no event 
  5514. will Nohau Corporation be liable for consequential damages.