home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / MATH / C25SIM.ZIP / c25sim.doc < prev    next >
Text File  |  1994-01-02  |  25KB  |  589 lines

  1. ########################################################################
  2.  
  3. THIS IS A FREE DEMO VERSION OF A SIMULATOR FOR THE TI TMS320C25. YOU MAY
  4. USE, COPY, AND DISTRIBUTE IT. PLEASE DO NOT ALTER OR DELETE ANY OF THE
  5. INCLUDED FILES, OR ADD NEW ONES.
  6.  
  7. ########################################################################
  8.  
  9. The following C25 instructions have been disabled in this version of the
  10. simulator:
  11.  
  12. APAC LTA LTD LTP LTS MAC MACD MPYA MPYS MPYU SPAC SQRA SQRS
  13.  
  14. You may use this freeware version all you want. You may use, copy and
  15. distribute it as much as you like, provided that you do not add files to it,
  16. delete files from it, or change its files.
  17.  
  18. Other than these instructions being disabled, and the prompt in C25SIM.EXE
  19. being "DEMO>" instead of "READY>", this software is identical to the
  20. full-featured C25SIM package. The reasoning behind this approach is to allow
  21. you to make a fully informed decision about purchasing this software. The
  22. C25SIM software includes an OBJ file for the simulator engine so that you
  23. can write a customized simulator specific to your application. You may want
  24. to explore this before making your purchasing decision.
  25.  
  26. To order the full-featured C25SIM package, send a check or money order for
  27. $120.00 to
  28.  
  29.     Will Ware
  30.     26 Beacon St., Apt. 34B
  31.     Burlington, MA  01803
  32.  
  33. Your package will include software that executes all the C25 instructions, a
  34. printed manual, periodic software updates as they occur, and technical
  35. support via electronic mail. My email address is:
  36.  
  37.     72143,315            for Compuserve
  38.  
  39.     72143.315@compuserve.com    for Internet
  40.  
  41. ############################################################################
  42.  
  43.                     C25SIM
  44.  
  45.             An Affordable TMS320C25 Simulator
  46.  
  47. ############################################################################
  48.  
  49. GETTING STARTED
  50.  
  51. C25SIM.EXE is a menu-based C25 simulator. To use it, type
  52.  
  53.     c25sim foo
  54.  
  55. and it will load the files FOO.HI, FOO.LO, FOO.MAP, and FOO.LST. You will
  56. see a "READY>" prompt (the prompt will be "DEMO>" if you're using the demo
  57. version). You can then press F1 to see the help screen, of F2 to see the
  58. source listing. In both the help screen and the source listing, you can
  59. navigate with the Home, End, PageUp, PageDown, and up and down arrow keys.
  60. Any other key will return you to the simulator.
  61.  
  62. Notice that the C25's registers and flags all appear on the right side of
  63. your screen. Whenever the simulator executes code, these are updated.
  64.  
  65. Type "symbols" (and press Enter) to see the symbol table. This is extracted
  66. from FOO.MAP. The simulator commands that require numerical arguments will
  67. also accept symbol names, and will look up the value of the symbol.
  68.  
  69. Type "bp _interrupt_handler" to set a breakpoint at the beginning of the
  70. interrupt handler. FOO.ASM sets up a timed interrupt, which saves the C25's
  71. registers on a stack, increments the _L variable, restores the registers,
  72. and returns to the main program. You will see interrupts occuring about
  73. every 500 processor cycles.
  74.  
  75. Type "go". This command will cause the simulator to execute code until a
  76. breakpoint is hit, or until you press a key on your keyboard. When the
  77. simulator stops, it will notify you that it reached a breakpoint, tell you
  78. the address, and print the names of any symbols whose values match that
  79. address. You will see:
  80.  
  81.     READY> go
  82.     Hit a breakpoint at 0053
  83.     _interrupt_handler
  84.     READY>
  85.  
  86. Type "go" again. The simulator will continue executing until it hits the
  87. same breakpoint again. Type "rd _L" to read the data memory value at the
  88. address for the _L variable. Type "go" and "rd _L" a few more times to see
  89. that the interrupt handler is indeed incrementing _L.
  90.  
  91. The timer is displayed on the right side of the screen, by the name TIM. The
  92. PRD register, or period register, is used to reload the timer after it
  93. counts down to zero. At this point, TIM will have a value close to 0x1F4,
  94. since it was recently reloaded when the interrupt occured. Type "cycles 100"
  95. to run the simulator for 100 processor cycles. The value of TIM will be
  96. around 0x190 at this point, indicating that it will time out in about 400
  97. processor cycles.
  98.  
  99. ############################################################################
  100.  
  101. THE HELP SCREEN
  102.  
  103. The following two pages are the help screen, which is the file C25SIM.HLP,
  104. displayed in C25SIM.EXE when you press the F1 key. This is always available
  105. while you are using the simulator. For your convenience, a copy of the help
  106. screen follows.
  107.  
  108.  
  109. QUICK COMMAND REFERENCE
  110. load        Load hex and map files
  111. listing        Load listing file (default extension: LST)
  112. wp        Write program memory
  113. rp        Read program memory
  114. wd        Write data memory
  115. rd        Read data memory
  116. mr        Modify a C25 register
  117. pwait        Program memory wait state
  118. dwait        Data memory wait state
  119. bp        Set a breakpoint
  120. clrbps        Clear all breakpoint
  121. go        Run N steps or until next breakpoint
  122. cycles        Run for N processor cycles
  123. reset        Reset the C25
  124. bkgnd        Run C25 continuously as background process (or stop)
  125. int        Manually trigger an interrupt
  126. symbols        Show symbol table
  127. match?        Find all global labels matching current PC
  128. quit        Quit this program
  129.  
  130. Use Home, End, PageUp, PageDown, and up and down arrows to navigate, any
  131. other key returns to the simulator.
  132.  
  133. Function keys:    F1 => view this help file
  134.         F2 => view source listing file
  135.         F3 => view symbol table
  136.         F4 => execute one instruction (active only in simulator)
  137.         F5 => string search (active only in viewer)
  138.         F6 => repeat string search (active only in viewer)
  139.  
  140. MORE DETAILS ON COMMANDS
  141.  
  142. Commands are case-insensitive. "WP", "Wp", "wP", and "wp" are all valid.
  143.  
  144. Many commands take numerical arguments. Numbers are interpreted as decimal
  145. by default, and are interpreted as hexadecimal if they have the prefix "0x",
  146. as in C. Numerical arguments can be decimal numbers (29), hexadecimal
  147. numbers (0x1234), or global symbols defined in the MAP file. Assuming there
  148. is a global symbol "_interrupt_handler", these would all be acceptable ways
  149. to set a breakpoint.
  150.  
  151.     bp 0x53
  152.     bp 83
  153.     bp _interrupt_handler
  154.  
  155. "Go" takes an optional numerical argument. If no argument is used, "go" will
  156. execute code until either a breakpoint is hit, or a key is pressed on the
  157. keyboard. If an argument is given, "go" will stop on either of those
  158. conditions, or when that number of instructions have been executed.
  159.  
  160. "steps" and "cycles" each take a number, respectively specifying how many
  161. instructions or processor cycles to execute.
  162.  
  163. "wp" and "wd" take two numerical arguments, an address followed by data.
  164.  
  165. "bp" takes on numerical argument, an address, and sets a breakpoint there.
  166.  
  167. "rp" and "rd" take an address, and optionally a second address. If two
  168. addresses are specified, then a range of memory values is displayed, up to
  169. but not including the second address, for example:
  170.  
  171.     READY> rd 0x1C00 0x1C10
  172.     Data memory
  173.     1C00 - 1234 5678 0246 1357 1234 5678 0246 1357
  174.     1C08 - 1234 5678 0246 1357 1234 5678 0246 1357
  175.  
  176. "load" takes a filename, and loads Intel hex files for C25 code, and a Texas
  177. Instruments map file, if one exists. For more details, see the description
  178. below of the functions load_hex_files() and load_map_file().
  179.  
  180. "listing" takes a filename, and loads a new source listing file. This can be
  181. viewed by pressing the F2 key. While in the listing view screen, you can
  182. navigate with Home, End, PageUp, PageDown, and the up and down arrow keys.
  183. Press any other key to return to the simulator. If the simulator is invoked
  184. with a filename argument, it will try to load a listing file automatically.
  185. If the argument is "FOO", the simulator will look for "FOO.LST". If an
  186. extension is specified, it will use that.
  187.  
  188. "symbols" prints the symbol table (extracted from the MAP file), showing the
  189. names of globally defined symbols and their hexadecimal values.
  190.  
  191. "match?" prints the names of all globally defined symbols whose values match
  192. the current PC.
  193.  
  194. "mr" takes the name of a register, followed by a new value to assign that
  195. register. The valid register names are: arp ov ovm intm dp arb cnf tc sxm c
  196. hm fsm xf fo txm pm pc t sp ar0 ar1 ar2 ar3 ar4 ar5 ar6 ar7 bio acc p drr
  197. dxr tim prd imr greg.
  198.  
  199. "pwait" and "dwait" set up wait states for ranges of program and data
  200. memory. To specify a range of program memory with two wait states from
  201. address 0x800 to 0xFFF, type "pwait 0x800 0xFFF 2". "dwait" works the same
  202. way for data memory. Up to twenty ranges can be specified for program
  203. memory, and another twenty for data memory.
  204.  
  205. "int" takes an interrupt type name, and manually triggers an interrupt of
  206. that type. The valid C25 interrupts are: RS, INT0, INT1, INT2, TINT, RINT,
  207. XINT, TRAP.
  208.  
  209. MORE DETAILS ON THE FILE VIEWER
  210.  
  211. The file viewer lets you conveniently view text files from the simulator.
  212. At any time while simulating, you may press the F1 key to view this help
  213. file, the F2 key to view the source listing, or the F3 key to view the
  214. symbol table. When in the file viewer, you can navigate using the Home,
  215. End, PageUp, PageDown, and up and down arrow keys.
  216.  
  217. Within the file viewer you can search for a string of text. Press F5 and
  218. you will be prompted for the string to be searched for. The first line, at
  219. or after your current position, that contains that string will be moved to
  220. the top of the screen. When you press the F6 key, the next line containing
  221. that string will be moved to the top of the screen. If the string is not
  222. found, a warning to that effect will appear.
  223.  
  224.  
  225. ############################################################################
  226.  
  227. HOW TO ASSEMBLE AND LINK FOO.ASM
  228.  
  229. Files with the prefix FOO are some sample C25 code, which were assembled and
  230. linked with TI's C25 assembly language tools. The procedure for assembling
  231. FOO.ASM is illustrated below. On the distribution disk, you will find
  232. FOO.ASM, FOO.LST, FOO.CMD, FOO.HI, and FOO.LO. FOO.HI and FOO.LO are Intel
  233. hex files that can be used to program high-byte and low-byte EPROMs.
  234.  
  235.     dspa foo.asm foo.obj foo.lst
  236.     dsplnk foo.cmd foo.obj -m foo.map
  237.     dsprom -intel a.out foo
  238.     del a.out
  239.  
  240. ############################################################################
  241.  
  242. WHAT DOES FOO.ASM DO?
  243.  
  244. FOO.ASM exercises the C25's timer, interrupts, bit-reversed addressing mode,
  245. and idle mode. The results of all this appear in two address registers, AR4
  246. and AR5, and in three data memory locations labelled "_i", "_k" and "_L".
  247. There is also an array of data memory locations called "rstring" used for
  248. the recieve interrupt.
  249.  
  250. First FOO establishes AR1 as a stack pointer, and sets up a timed interrupt
  251. to occur every 500 processor cycles. rstring is initialized to zeros. AR4,
  252. AR5, _k, and _L are then initialized to zero. FOO then enters a loop (L1),
  253. where it respectively increments and decrements AR4 and AR5 using
  254. four-bit-wide bit reversal, and goes on to call a do-nothing subroutine.
  255. After the subroutine call, FOO sets _i to zero and enters an inner loop (L2)
  256. which will run ten times using AR0 as a loop counter. Inside the L2 loop, _k
  257. is set to 17 times _i, and then _i is incremented. After the L2 loop runs
  258. ten times, FOO calls a subroutine which checks the value of _L, and executes
  259. an IDLE instruction if _L has reached 15. _L is incremented periodically by
  260. the timed interrupt.
  261.  
  262. There is also a receive interrupt which fills rstring with incoming data.
  263. When a data word of zero is received, rstring is refilled with zeroes and
  264. the receive interrupt starts at the beginning again.
  265.  
  266. ############################################################################
  267.  
  268. WHAT DOES SAMPLE.C DO?
  269.  
  270. SAMPLE.C is an example of how to use the simulator library functions to
  271. write a special-purpose simulator. SAMPLE looks specifically for changes in
  272. _k, _L, AR4, and AR5, and reports the changes, and how many processor cycles
  273. have passed when they occur. SAMPLE reports when interrupts occur, and when
  274. the C25 hits an IDLE instruction.
  275.  
  276. SAMPLE also simulates the operation of the C25's serial port by writing the
  277. DRR register and triggering periodic receive interrupts.
  278.  
  279. As SAMPLE is running, you may:
  280.     Press the 'Q' key to quit and return to DOS,
  281.     Press 'R' to get a full report of the C25's registers, flags,
  282.         and status
  283.     Press 'M' to toggle a mode bit which is initialized to zero.
  284.         When the mode bit is one, changes in _k, _L, AR4, and AR5
  285.         are displayed on your screen.
  286.     Press 'S' to print the current contents of rstring, which is filled
  287.         by the receive interrupt with characters from the string
  288.         "Supercalifragilistic".
  289.     Press any other key to pause SAMPLE and get a shorter report
  290.         of C25 status
  291.  
  292.  
  293. ############################################################################
  294.  
  295. WRITING A CUSTOMIZED SIMULATOR
  296.  
  297. C25LIB.OBJ is a library of routines for creating your own simulator very
  298. easily. The effort of doing a small amount of C programming will be vastly
  299. offset by the flexibility of being able to design a simulator specifically
  300. to address your own application.
  301.  
  302. SAMPLE.C is an example C program that illustrates how to use the routines in
  303. C25LIB.OBJ. SAMPLE.C was written specifically in conjunction with FOO.ASM.
  304. The variables and routines available in C25LIB.OBJ are spelled out in the
  305. header file C25LIB.H.
  306.  
  307. C25LIB.OBJ was compiled using the Microsoft C Compiler version 6.00A. You
  308. can link it to your own Microsoft C program by typing:
  309.  
  310.     cl yourcode.c c25lib.obj
  311.  
  312. C25LIBT.OBJ was compiled with Borland Turbo C version 2.01. You can link it
  313. to your Turbo C program by typing:
  314.  
  315.     tcc yourcode.c c25libt.obj
  316.  
  317. ############################################################################
  318.  
  319. IMPORTANT THINGS
  320.  
  321. A.    Your code must call the routine initialize_simulator() before
  322.     attempting to execute any C25 code. This routine initializes the
  323.     table that allows the simulator to disassemble and execute C25
  324.     instructions.
  325.  
  326. B.    To accomodate the windowing done in C25SIM, all the simulator
  327.     library functions route their printed output thru the routine
  328.         void __write(char *);   /* two underscores */
  329.     which you must provide. For many applications, you can simply
  330.     use the following definition, taken from SAMPLE.C:
  331.         void __write(char *s) { printf("%s", s); }
  332.  
  333. ############################################################################
  334.  
  335. 1. Registers and Flags
  336.  
  337. The C25 flags and registers are as follows, and are available to be inquired
  338. or altered in your C program.
  339.  
  340. extern int arp, ov, ovm, intm, dp;
  341. extern int arb, cnf, tc, sxm, c, hm, fsm, xf, fo, txm, pm;
  342. extern long int accumulator, p_register;
  343. extern unsigned int pc;
  344. extern int t_register, _stack[8], _sp, ar[8];
  345. extern int mp_mc_mode;
  346. extern int ports[16], bio;
  347. extern int drr, dxr, tim, prd, imr, greg;
  348.  
  349. All the C25's registers and flags are available as variables in C. Most of
  350. these variables are 16 bits (int). The accumulator and the P register are 32
  351. bits (long int). The following registers are odd lengths: ARP (3 bits), DP
  352. (9 bits), ARB (3 bits), and PM (2 bits). The upper bits of these registers
  353. are ignored by the simulator. The following flags are only one bit, and the
  354. upper 15 bits are ignored: ov, ovm, intm, dp, cnf, tc, sxm, c, hm, fsm, xf,
  355. fo, txm, mp_mc_mode, bio. xf and bio are external pins on the C25.
  356. mp_mc_mode is also an external pin, which determines whether code is fetched
  357. from the C25's internal ROM (microcontroller mode) or from external ROM
  358. (microprocessor mode). By default it is set to 1, indicating that the C25 is
  359. in microprocessor mode.
  360.  
  361. ############################################################################
  362.  
  363. 2. Steps and Cycles
  364.  
  365. extern unsigned long int steps_taken, cycles;
  366.  
  367. There are two long integers that mark time in the simulator. "steps_taken"
  368. measures how many instructions have been executed. Repeated instructions
  369. (controlled by the RPT or RPTK instruction) will not count: only the repeat
  370. instruction itself will be recorded. "cycles" measures the actual execution
  371. time for your code, in processor cycles. If you clock your C25 at 40 MHz,
  372. each clock cycle is 100 nanoseconds.
  373.  
  374. ############################################################################
  375.  
  376. 3. Wait States
  377.  
  378. typedef int (*iufunc) (unsigned int);
  379. iufunc pwaitf, dwaitf, iwaitf;
  380.  
  381. C25SIM normally assumes that all memory is zero-wait-state. This assumption
  382. can be easily changed to match your hardware. This affects the "cycles"
  383. variable. There are three pointers to functions: pwaitf, dwaitf, iwaitf,
  384. respectively regarding program memory, data memory, and I/O ports. These 
  385. pointers are initialized to NULL. To simulate non-zero-wait-state memory,
  386. write a C routine that accepts an unsigned integer (a memory address) and
  387. returns an integer (the number of wait states for writing or reading that
  388. address), and assign the appropriate pointer to point at that function.
  389. Here is a sample usage.
  390.  
  391. /* convenient way to specify memory address ranges */
  392. #define ui(x)  ((unsigned int) (x))
  393. #define range(x,lo,hi)  ((ui(x) >= ui(lo)) && (ui(x) <= ui(hi)))
  394.  
  395. int program_wait_states(unsigned int addr)
  396.     {
  397.     /* a small block of REALLY slow memory */
  398.     if (range(addr, 0x100, 0x1FF)) return 10;
  399.     /* everything else is zero-wait-state */
  400.     return 0;
  401.     }
  402.  
  403. void main(void)
  404.     {
  405.     initialize_simulator();
  406.     ....
  407.     pwaitf = program_wait_states;
  408.     ....
  409.     /* run simulation */
  410.     }
  411.  
  412. ############################################################################
  413.  
  414. 4. Accessing Program and Data Memory from C
  415.  
  416. extern int warn_progmem_writes;
  417.  
  418. extern int *program_memory_address(int a);
  419. extern void write_program_memory(int a, int d);
  420. extern int read_program_memory(int a);
  421.  
  422. extern int *data_memory_address(int a);
  423. extern void write_data_memory(int a, int d);
  424. extern int read_data_memory(int a);
  425.  
  426. As you load code into the simulator, C25SIM allocates blocks of your PC's
  427. memory to function as blocks of virtual C25 program memory. Likewise, when
  428. your code starts using data memory, C25SIM allocates PC memory for virtual
  429. data memory. If you want to write or read C25 memory directly, you can use
  430. program_memory_address() and data_memory_address() to convert C25 addresses
  431. to PC addresses (pointers to integers).
  432.  
  433. Alternatively, you can use write_program_memory() and read_program_memory()
  434. to access program memory, and write_data_memory() and read_data_memory() to
  435. access data memory. The only difference in using these functions is that
  436. they will warn you if you are reading uninitialized memory, or writing
  437. program memory (a potential bozo no-no in the C25's Harvard architecture).
  438.  
  439. If you want to use write_program_memory() to write to program memory without
  440. getting warnings, set warn_progmem_writes to zero. By default it is set to
  441. one, and is only cleared temporarily when hex files are loaded.
  442.  
  443. ############################################################################
  444.  
  445. 5. Starting the simulator, stepping the simulator
  446.  
  447. extern void initialize_simulator(void);
  448. extern void advance(void);
  449.  
  450. initialize_simulator() sets all the simulator's registers, flags and
  451. variables to zero, except for mp_mc_mode and warn_progmem_writes which are
  452. set to one. It also sets up the table which the simulator uses to
  453. disassemble code as it executes.
  454.  
  455.      ! ! ! ! ! ! ! !
  456.      NOTE: You *must* run initialize_simulator() before stepping the
  457.      simulator. Otherwise the simulator will not recognize any C25
  458.      instructions.
  459.      ! ! ! ! ! ! ! !
  460.  
  461. advance() causes the simulator to execute one instruction.
  462.  
  463. When executing any repeated instruction, the "steps_taken" variable will
  464. only be incremented once. The "cycles" variable will be incremented thru the
  465. correct number of processor cycles that would physically occur.
  466.  
  467. ############################################################################
  468.  
  469. 6. Loading files, using global symbols
  470.  
  471. extern void load_hex_files(char *word);
  472.  
  473. extern void load_map_file(char *word);
  474. extern int lookup_symbol(char *name);
  475. extern void print_matching_symbols(int d);
  476.  
  477. load_hex_files() loads executable C25 code into the simulator.
  478.  
  479. If your code is in high and low Intel hex files (e.g. for programming 8-bit
  480. eproms), with the filename extensions "HI" and "LO" respectively, then you
  481. can load both files by calling load_hex_files() and passing it the prefix of
  482. the filename (everything up to, but not including, the period).
  483.  
  484. If your code is a single Intel hex file with 16-bit data, with highbytes
  485. followed by lowbytes, you can load it by specifying an entire filename, with
  486. the only restriction that the filename extension must be "HEX".
  487.  
  488. If your code was linked with TI's C25 linker, and you produced a map file,
  489. you can load the names and values of all globally defined symbols (routines,
  490. labels, and variables) using the function load_map_file(). Pass the filename
  491. as an argument; if no filename extension is given, the function will assume
  492. it is "MAP".
  493.  
  494. Once the symbols are loaded, you can look up the value of a symbol with the
  495. function lookup_symbol(), which takes the symbol's name as a string and
  496. returns the value as an integer. Another handy function is
  497. print_matching_symbols(), which accepts an integer and prints the names of
  498. all symbols with that value. This can be handy for identifying your location
  499. in some code.
  500.  
  501. ############################################################################
  502.  
  503. 7. Breakpoints
  504.  
  505. The current version of C25SIM supports 100 breakpoints.
  506.  
  507. extern void add_breakpoint(int d);
  508. extern void delete_breakpoint(int i);
  509. extern void clear_all_breakpoints(void);
  510. extern int go_til_breakpoint(long int n);
  511.  
  512. add_breakpoint() will set up a breakpoint at an address in program memory,
  513. and delete_breakpoint() will delete a breakpoint at an address, if one
  514. exists. clear_all_breakpoints() will delete all existing breakpoints.
  515.  
  516. The function go_til_breakpoint() accepts a numerical argument n. If n = -1,
  517. then go_til_breakpoint runs C25 code until either of two conditions:
  518.     1. the simulator hits a breakpoint,
  519.         in which case go_til_breakpoint returns -1,
  520.     2. or a key is pressed on the PC's keyboard,
  521.         in which case go_til_breakpoint returns the ASCII
  522.         value for the key that was pressed.
  523. If n is not -1, then go_til_breakpoint will also terminate on a third
  524. condition:
  525.     3. n instructions have been executed,
  526.         in which case go_til_breakpoint returns -2.
  527.  
  528. ############################################################################
  529.  
  530. 8. Resets and Interrupts
  531.  
  532. extern void c25_reset(void);
  533. extern void c25_interrupt(int n);
  534.  
  535. These functions are used to reset or interrupt the simulated C25. The C25
  536. has eight kinds of interrupts:
  537.  
  538. /* Interrupt types */
  539. enum int_type { RS, INT0, INT1, INT2, TINT, RINT, XINT, TRAP };
  540.  
  541. The RS interrupt is simply a processor reset. The TRAP interrupt is normally
  542. invoked by a software instruction. RS and TRAP are non-maskable interrupts.
  543. The timer can be configured in the C25 code to provide timed interrupts
  544. (TINT).
  545.  
  546. The simulator does not attempt to model the C25's on-chip serial ports. You
  547. can model a receive-buffer-full event by loading a value into the "drr"
  548. variable and then performing a RINT interrupt. Likewise you can simulate a
  549. transmit-buffer-empty event by triggering a TINT interrupt. If you are using
  550. the serial ports, your code will probably want to respond by loading the
  551. "dxr" variable with data to be shifted out.
  552.  
  553. If an interrupt is not enabled when c25_interrupt() is invoked, a flag is
  554. set to record the fact that the interrupt is pending, and the interrupt is
  555. triggered as soon as it is enabled.
  556.  
  557. ############################################################################
  558.  
  559. 9. Reporting processor status
  560.  
  561. void short_report(void);
  562. void long_report(void);
  563.  
  564. These functions respectively print out short and long reports of processor
  565. status. A short report shows the program counter and the instruction
  566. currently being executed, both in hexadecimal, and the number of
  567. instructions executed and processor cycles both in decimal.
  568.  
  569.     PC:0096   Instructions executed: 622   Processor cycles: 1000
  570.     Instruction: 70A0    SAR
  571.  
  572. A long report shows the same information from the short report, plus the
  573. values of the C25's registers and flags. All registers are shown in
  574. hexadecimal, except for ARP, DP, ARB and PM, which are shown in binary, with
  575. a decimal value in parentheses. Single-bit flags are shown as 0 or 1.
  576. Sixteen-bit registers are shown as four digits of hex, and 32-bit registers
  577. are shown as eight digits of hex.
  578.  
  579.     PC:0041   Instructions executed: 154   Processor cycles: 300
  580.     Instruction: FE80    CALL
  581.     ACC:00000000 ARP:000(0) 
  582.     ARs: 000A 0403 0000 0000 0004 0007 0000 0000 
  583.     Hardware stack: empty
  584.     OV:0 OVM:0 INTM:0 DP:000001000(8) 
  585.     ARB:101(5) CNF:0 TC:0 SXM:0 C:0 HM:0 FSM:0 XF:0 FO:0 TXM:0 PM:00(0) 
  586.     T:0000 P:00000000 
  587.     DRR:0000 DXR:0000 TIM:00D0 PRD:01F4 IMR:0008 GREG:0000 
  588.  
  589.