SECTION 7

BUILT-IN DIAGNOSTIC FUNCTIONS

7-1Group A: Memory Tests
7-2Group B: Oscilloscope Loops
7-3Group C: Memory Load and Dump
7-4Group D: Miscellaneous
7-5Group E: Change Default Parameters
7-6Group F: Internal Operations


The Diagnostic Emulator contains Built-In test functions and utility routines designed to be convienent and useful for testing systems and verifying their proper operation. These test and utility routines have been named Code Functions because they are accessed by depressing the CODE keyswitch, followed by hexadecimal digits designating the routine desired. Table 7-1 lists all of the Code Functions programmed into the Diagnostic Emulator.

7-1 GROUP A: MEMORY TESTS

CODE A1—00/FF DATA TEST

The code function A1 memory test routine quickly determines whether all locations within a specified range can be set to 0016 and FF16. The range tested is from the address specified by the BEG (begin) register through the address specified by the END register. The routine operates by setting the first location of the range to 0016 and reading the location to see if a 0016 is returned. Then the routine stores an FF16 to this location and reads the location to see if an FF16 is returned. Finally, the routine increments the address and tests the next location in the range. During the execution of this test, the address and data activity are visible on the displays and stored in the Trace Memory.

If a memory error is encountered, the routine emits 3 beeps and displays the address of the failure and the erroneous data read. At this time the operator has three options:

1. Depress EXAM to display the data the routine expected to read from the memory. Release the keyswitch to again display the bad data.

2. Depress INC to continue testing at the next address in the range. If additional problems are found, the program will stop again and any of the options listed may be taken.

3. Exit the test routine by using any of the mode keys (MEM, I/O, REG, RUN, etc.) or RESET.

After testing all locations in the specified range, the EM-180 emits one short beep and repeats the test. The RESET keyswitch is used to terminate the test at any time.


EM-180 Optional Firmware for XON/XOFF, Part #340-11167-00

This PROM allows for an additonal Code Function in the EM-180 that expands the current capabilities of the emulator. To use this function, first insert the PROM in the diagnostic PROM socket of your EM-180.

To utilize XON/XOFF, enter "CODE 0" (not CODE C4)

This allows you to upload a program from the emulator target/system to a host computer, line printer, or other device that generates a "transmit ready" or "not ready" signal in the XON/XOFF form. The firmware will monitor the XON/XOFF signals from the host computer or other device and will respond to its control information. (CODE C4 also uploads, but does not recognize XON/XOFF.)


Table 7-1. Code Functions

GROUP A: MEMORY TESTS

A1RAM TEST(00/FF)⎫\
A2RAM TEST(Rotating 1s)⎪|
A3RAM TEST(Addresses)⎬ > Repeating Tests
A4ALL RAM TESTS⎭/
A5ALL RAM TESTS⎫\
A6RAM TEST(00/FF)⎪|
A7RAM TEST(Rotating 1s)⎬ > One Pass and Stop
A8RAM TEST(Addresses)⎭/

GROUP B: OSCILLOSCOPE LOOPS

B1Repetitive Memory Read
B2Repetitive Memory Write
B3Repetitive I/O Read
B4Repetitive I/O Write
B5Continuous Adress Increment, 64K Range
B6Repetitive Memory Write (Data/Panel PROM)
B7Repetitive I/O Write (Data/Data)
B9Continuous Address Increment with Adjustable Range
BCRepetitive Store/Examine Memory
BDRepetitive Store/Examine I/O Port
BEStore Rotating 1-Bit to Memory
BFStore Rotating 1-Bit to I/O Port

GROUP C: MEMORY LOAD AND DUMP

C0Line Assembly Mode (See Section 6.3)
C1Load Target from Front Panel PROM
C2Verify Target with Front Panel PROM
C3Load Target from Serial Link (DOWNLOAD)
C4Dump Target to Serial Link (UPLOAD) (See also Code 0, p. 7-2a)
C5Load RAM Overlay from Target
C6Verify RAM Overlay with Target
C7Verify Target Against Serial Link
C8Fill Target with Specified Data
C9Verify Target with Specified Data
CBBlock Move Target System Data
CCDump Target to Serial Link in User Viewable Format
CERepeat Segment of Data Over an Entire Block
CADisassemble Memory (See Section 6.4)


GROUP D: MISCELLANEOUS

D0Clear Interrupt Enable Flip-Flop
D1Set Interrupt Enable Flip-Flop
D2Display Clock Frequency
D3Display PROM/ROM Signature
D4Output 50 Nulls from Serial Link
D5Call User Routine in Internal RAM at 300016
D6Call User Routine in Internal RAM at 300316
D7Clear Trace Memory
D8Dump Entire Content of Trace Memory
D9Halt CPU (for changing Front Panel PROM)
DADisplay Revision Number for Control PROM
DBDisplay Revision Number for Disassembly PROM
DCCalculate Branch Offset and Display
DDDo Self-Test of Control PROM and Disassembly PROM
DEOutput (CR)(LF)(NUL)(NUL) from Serial Link
DFCount Hours, Minutes and Seconds on Display

GROUP E: CHANGE DEFAULT PARAMETERS

E0Disable Disassembly (Default at Power On)
E1Enable Disassembly, 80 Character Line, One Line of Registers
E2Enable Disassembly, 72 Character Line, One Line of Registers
E3Enable Disassembly, 72 Character Lines, Two Lines of Registers
(IX, IY, SP and Prime registers on Line 2)
EFCall Remote Control Software

GROUP F: INTROSPECTION MODE

FSet Basic "Introspection" Mode
F0
through
F9
Set Introspection Mode and Initialize Emulator for Debug of User Code Function Program

CODE A2—ROTATE 1's

Code Function A2 memory test routine performs a test on all data bits in the range specified. The range tested is from the address contained in the BEG register through the address contained in the END register. The routine starts with the first location in the range and tests the location by writing and checking a bit, one bit at a time, in all of the positions of the word under test. The routine writes and checks by writing and reading the following data patterns:

Binary PatternHexadecimal
0 0 0 0 0 0 0 10116
0 0 0 0 0 0 1 00216
0 0 0 0 0 1 0 00416
0 0 0 0 1 0 0 00816
0 0 0 1 0 0 0 01016
0 0 1 0 0 0 0 02016
0 1 0 0 0 0 0 04016
1 0 0 0 0 0 0 08016


After a location has been tested it is known that all bit positions in the location may be set and cleared independently of each other. The program than increments to the next sequential address in the range and proceeds to test in the same manner. If an error is detected, the test stops, the EM-180 emits the three beeps that signify an error, and the Display Panel shows the defective memory address and the bad data. At this point the operator has three options:

1. Depress EXAM to display the data the diagnostic routine expected to read (good data). Release EXAM to return the bad data to the display.

2. Depress INC to continue testing. If additional problems are found, the test stops and any of the options listed may be taken again.

3. To terminate the test, depress RESET, RUN, or any of the mode select keyswitches.

After testing all locations in the specified range, the EM-180 emits one short beep and repeats the test. The RESET keyswitch is used to terminate the test at any time.

CODE A3—ADDRESS TEST

Code Function A3 memory test determines whether an address decoding failure exists in the memory system under test. It tests the memory range from the address contained in the BEG register to the address contained in the END register. The routine prepares for operation by clearing all locations in the range to 0016. Next, the first location is set to FF16 and then a check is made of all address-related locations in the range to determine if any of them have been altered by the writing of the FF16. After all locations in the range that are address-related to the first location have been checked, the program resets the first location to 0016. The the next sequential location in the range is set to FF16, and the address-related locaitons checked. The test proceeds until all locations in the specified range have been set to FF16, and the respective address-related locations checked.

For the purposes of this test, an address is said to be related to a second address if it differs from it by only one bit (in any bit position). The test checks all possible address-related combinations as long as a generated address does not fall outside the specified range.

If an addressing error is found the test stops, the EM-180 emits three beeps signifying an error, and the display shows the erroneous data and its address. At this point the operator has three options:

1. Depress EXAM to display the data the diagnostic routine expected to read. Release EXAM to return the erroneous data to the display.


2. Depress INC to continue testing. If additional problems are found, the test will stop and any of the options listed may be taken again.

3. To terminate the test, depress RESET, or RUN, or any of the mode selection keyswitches.

After all locations in the specified range have been tested, the EM-180 emits one short beep and repeats the test. To exit this code function at any time, depress RESET.

CODE A4—ALL TESTS AND REPEAT

Code Function A4 executes the A1, A2, and A3 diagnostic functions in sequence, then a emits a short beep and repeats. The test may be terminated by depressing RESET. In the event that an error is found, the operator may respond in any of the ways described for the individual diagnostic functions.

CODE A5—ALL TESTS AND STOP

Code Function A5 executes the A1, A2, and A3 diagnostic functions in sequence, emits a short beep and stops. In the event an error is found, the operator may respond in any of the ways described for the individual diagnostic functions. When the test is complete, the displays will read CODE A5 and the Trace Memory will contain a record of the last 252 bus transfers.

CODE A6—00 FF DATA TEST

Code Function A6 is identical to the Code Function A1 except the function stops after a single pass through the test. When the test is complete, the displays will read CODE A6 and the Trace Memory will contain a record of the last 252 bus transfers.

CODE A7—ROTATE 1's

Code Function A7 is identical to the Code Function A2 except that the function stops after a single pass through the test. When the test is complete, the displays will read CODE A7 and the Trace Memory will contain a record of the last 252 bus transfers.

CODE A8—ADDRESS TEST

Code Function A8 is identical to the Code Function A3 except the function stops after a single pass through the test. When the test is complete, the displays will read CODE A8 and the Trace Memory will contain a record of the last 252 bus transfers.


7-2 GROUP B: OSCILLOSCOPE LOOPS

The Oscilloscope Loop Functions are a group of functions that provide several types of repetitive stimuli to a target stystem. They provide repetitive waveforms in the target system hardware that may easily be examined at various circuit points with an oscilloscope or other test equipment. Many of the functions are also useful as stimulus routines for Signature Analysis testing.
NOTE: ADDR register referred to below is "Hex Keyswitch - #6."

CODE B1—REPETITIVE MEMORY READ

This function repetitively reads the single memory location addressed by the ADDR register. These address, data and RD signals are all shown on the Display. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the memory location is read. Depress RESET to exit this function.

CODE B2—REPETITIVE MEMORY WRITE

This function repetitively writes the data contained in the DATA register to the single memory location addresed by the ADDR register. These address, data and WR signals are all shown on the Display. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the memory location is writte. Depress RESET to exit this function.

CODE B3—REPETITIVE I/O READ

This function repetitively reads the single I/O port location addressed by the ADDR register. The address, data and RD signals are all shown on the display. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the I/O port is read. Depress RESET to exit this function.

CODE B4—REPETITIVE I/O WRITE

This function repetitively writes the data contained in the DATA register to the I/O locaiton addressed by the ADDR register. These address, data and WR signals are all shown on the Display. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the I/O port is written. Depress RESET to exit this function.

CODE B5—CONTINUOUS ADDRESS INCREMENT

This function places the EM-180 in a special mode in which it outputs successive addresses from 000016 to FFFF16 at a very high rate. Internal to the EM-180 this is accomplished by forcing a NOP instruction to the processor on every fetch cycle. Externally the EM-180 appears to be doing a fetch cycle at each address at the full speed of the processor (as determined by the clock frequency). In this mode, the processor does not respond to target system WAIT commands.


The Continuous Address Increment function is used to check out address decoding networks in hardware systems and as a stimulus for signature analysis trouble-shooting.

It is possible to obtain a sync pulse for triggering an oscilloscope or a signature analyzer from either the Breakpoint A or Breakpoint B output at the back Panel Auxiliary Connector; the output pulse occurs each time the processor reads from the breakpoint address. (The processor does not stop.)

Depress RESET to terminate the Continuous Address Increment mode.

CODE B6—REPETITIVE MEMORY WRITE (DATA/¬DATA)

This function repetitively writes data to the address designated by the ADDR register. The data written is that contained in the DATA register except it is complemented every other time data is written. The address, data and WR signals are all displayed. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the address is accessed. Depress RESET to exit this function.

CODE B7—REPETITIVE I/O WRITE (DATA/¬DATA)

This function repetitively writes data to the I/O port designated by the ADDR register. The data written is that contained in the DATA register except it is complemented every other time data is written. The address, data, I/O and WR signals are all displayed. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the I/O port is written. Depress RESET to exit this function.

CODE B9—CONTINUOUS ADDRESS INCREMENT OVER ADJUSTABLE RANGE

This function places the EM-180 in a special mode in which it outputs successive addresses from a user-selected Begin Address to a user-selected End Address at a very high rate. The address increment range is from the address contained in the BEG register through the address contained in the END register. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the first address of the range is output; a high-going pulse is output from the BKPT B pin (pin 13) of the Auxiliary Connector each time the last address of the range is output.

The output pulses are useful for oscilloscope or signature analyzer triggering. Derpress RESET to terminate the Continuous Address Increment mode.


CODE BC—REPETITIVE MEMORY WRITE/READ

This Code Function writes the data contained in the DATA register to the address specified by the ADDR register, then reads the same address; this process is repeated at a high rate. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the memory address is accessed for either the write cycle or the read cycle. Depress RESET to exit this function.

CODE BD—REPETITIVE I/O WRITE/READ

This function writes the data contained in the DATA register to the I/O port specified in the ADDR register, then reads the same port address; this process is repeated at a high rate. A high-going pulse is output form the BKPT A pin (pin 12) of the Auxiliary Connector each time the I/O port is accessed for either the write cycle or the read cycle. Depress RESET to exit this function.

CODE BE—WRITE ROTATING BITS TO MEMORY

THis function repetitively writes a rotating bit pattern to the memory location specified by the ADDR register. The data contained in the DATA register is written to the memory location. Then each bit in the DATA register is shifted left one bit position each time the memory location is written to. When the bit shifts out of the high-order position, it is re-entered in the low-order position. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the memory address is written. Depress RESET to exit this function.

CODE BF—WRITING ROTATING BITS TO I/O PORT

This function repetitively writes a rotating bit pattern to the I/O port selected by the ADDR register. The data contained in the DATA register is written to the I/O port. Then each bit in the DATA register is shifted left one bit position each time the port is written to. When the bit shifts out of the high-order position, it is re-entered in the low-order position. A high-going pulse is output from the BKPT A pin (pin 12) of the Auxiliary Connector each time the I/O port is written. Depress RESET to exit this function.

7-3 GROUP C: MEMORY LOAD AND DUMP

CODE C1—LOAD TARGET FROM FRONT PANEL PROM

The Code Function C1 transfers data from the Front Panel Diagnostic PROM to the target system. This routine requires the user to specify the destination address range in the target system by entering the first address of the range in register BEG and the last address of the range in register END. To use this Code Function, first enter the appropriate address values in the BEG and END registers, then start the routine. The routine will transfer bytes from the Front Panel PROM into the target address space with the first location in the PROM transferred to the first address of the specified range. After the transfer is complete, the Trace Memory contains a record of the last 252 cycles of the transfer.


CODE C2—VERIFY TARGET WITH FRONT PANEL PROM

The Code Function C2 compares the Front Panel PROM with the address range specified by the user. The address range should be specified using the BEG and END registers in the same manner as described for C1.

CODE C3—LOAD TARGET FROM SERIAL LINK (DOWNLOAD)

The Code Function C3 transfers hex data from the serial RS-232C input to the target system. The data to be entered must first be converted into the Intel MDS* format, which is an ASCII-hexadecimal format.

The destination address range is specified by the incoming data and need not be specified in the BEG and END registers. Furthermore, if the data is properly received, the BEG and END registers contain the low and high limits of the loaded data, regardless of the initial register settings. In addition, the limits will always be correct even if non-contiguous data is loaded.

To use this Code Function, connect the RS-232C input to the source of information, start this routine and then enable the source to "download" the appropriate dazta. During the transfer, note the displays showing the data being loaded. If there are no errors, the end-of-file record completes the transfer and the displays contain CODE C3. The Trace Memory contains a record of the last 252 cycles of the transfer.

Error Codes–During the transfer process, various types of errors can occur. If an error occurs, the Diagnostic Emulator emits three beeps and displays the appropriate error code. The Trace Memory will contain a record of the address and erroneous data. Once an error is detected the transfer process is aborted and may not be resumed. The C3 Code Function Error Codes are listed in Table 7-3.1


Table 7-3.1 C3 and C7 Code Function Error Codes

CODEDESCRIPTION
01Framing Error. The serial data character is not properly framed by start and stop bits. This error may be caused by an incorrect setting of the baud rate selector or by noice on the transmission link.
02Overrun Error. This error may occur if the processor is operated with an extremely low clock frequency while receiving data at high baud rates.
11Non-Hexadecimal Character Received. This error indidates that a hex character was expected at some point, but a non-hex character was received.
12Sum-Check Error. In the Intel MDS format each record contains an eight-bit checksum to ensure data integrity. If this sum is incorrect, this error code is given.
16Non-Zero Record Type. If the record type is other than a zero (except for the end of file record), this error is signaled.
21Target Memory Write Error. If an attempt is made to load data to an area of memory containing no RAM or faulty RAM, this error occurs. This error is detected by doing a read-back-check of each location as it is storead, and recording both the write cycle and the read cycle in Trace Memory. After the error occurs regsiter ADDR will contain the address of the faulty locaiton while regsiter DATA will contain the data the EM-180 attempted to store.

CODE C4—DUMP TARGET TO SERIAL LINK *

This Code Function C4 transfers data from a selected area of Traget Memory to the serial RS-232C output. The data being output is ASCII-Hexadecimal and is compatible with the Intel MDS format. The use of this function requires the user to specify the address range. The BEG register contains the starting address while the END register contains the address of the last location to be output. To use this Code Function, first specify the address limits, next prepare the receiving device to accept data, then start the transfer by executing CODE C4. During the transfer the display shows the address and data currently being transmitted. When transmission is completed, the displays show CODE C4 and the Trace Memory contains a record of the last 252 cycles. The rate of transfer can be controlled by the receiving device. If enabled by the Option-Switch (with position 3 open), the CTS line (Clear-to-Send) can prevent output if held in the marking (negative) condition. In the spacing (positive) condition, output speed is determined by the baud rate selected. Each record is followed by a carriage return, line feed, and two null characters.

* See also CODE 0 (p. 7-2a), which allows XON/XOFF capability.


CODE C5—LOAD OVERLAY RAM FROM TARGET MEMORY

The Code Function C5 transfers data from a selected area of target memory space to the equivalent area in Overlay Memory. To use this Code Function the Overlay memory must first be located at the proper address by rotating the thumb-wheel switch. The Overlay is then enabled by setting the selector switch to the appropriate position. Then the BEG and END registers are set to the range of addresses over which data is to be transferred. The last step is to call the Code Function to execute the transfer. While executing, the displays show the addresses and data. When data transfer is completed, the displays show CODE C5 and the Trace Memory contains a record of the last 252 cycles of the data transfer.

If a non-verify occurs during the transfer, the Diagnostic Emualtor emits three beeps and temporarily halts the transfer. The error may be skipped and the transfer resumed by depressing INC, or the operation may be aborted by depressing a mode select keyswitch, such as CODE. While the operation is halted, the address aznd the data that failed to verify is shown on the display. By depressing and holding the EXAM keyswitch, the correct target data may be displayed.

CODE C6—VERIFY RAM OVERLAY WITH TARGET MEMORY

The Code Function C6 compares data from a selected area of Target Memory to the equivalent area in Overlay Memory.

For information on the operation of this function, see Code C5.

CODE C7—VERIFY TARGET WITH SERIAL LINK

The Code Function C7 is nearly identical to the C3 Code Function. It differs in two respects:

1. Data is not stored to target memory but only verified.

2. A non-verify results in Error 22 and the compare operation is aborted. Register ADDR will contain the address of the non-compare while register DATA will contain the data that was supposed to be in the target memory location.


CODE C8—FILL MEMORY WITH DATA

The Code Function C8 is used to fill a block of target memory or RAM Overlay with the same data, usually all one's (FF) or all zeros. To use this Code Function, set the BEG and END registers to the range of target memory or RAM Overlay to be filled, load the DATA Register with the data to be stored then execute CODE C8. The Display shows the transfer as it takes place. After transfer is completed the display shows CODE C8 and the trace contains a record of the alst 252 cycles of the transfer.

If a location fails to store the correct data, the Diagnostic Emulator emits three beeps and temporarily halts the fill operation. The error may be skipped and the transfer resumed by depressing INC, or aborted by depressing a mode select keyswitch such as TRACE. While the operation is halted the address and the data that failed to verify are shown on the Display. By depressing and holding EXAM the correct data (which was in DATA) may be displayed.

CODE C9—VERIFY MEMORY WITH DATA

The Code Function C9 compares a block of target memory or RAM Overlay with the byte in register DATA. See the explanation of CODE C8 for the operation of the function.

CODE CB—BLOCK MOVE

The Code Function CB is used to move a block of data residing in the target system to a new location in the target system RAM. Define the block of data to be moved by entering the address of the first byte of the block in the BEG register and the address of the last byte of the block in the END register. Enter the address of the first byte of the destination block in the ADDR register. Execute Code Function CB to move the data.

This routine is able to move the block of data to a higher address or to a lower address. In addition, the blocks may overlap in any manner and [sic] moved without loss of data; for example, a block of 2K bytes could be moved up or down by ffteen positions.

The entire destination block must be in writeable memory.

CODE CC—DATA OUTPUT TO SERIAL PORT IN HEX AND ASCII FORMAT

This Code Function provides a formatted dump of a block of memory to the serial port. The memory block is defined by the addresses contained in the BEG and END registers. When the function is executed, data will be output from the serial port in the format shown in Figure 7-3.2.


Figure 7-3.2 Memory Dump Format

ADDRESS16 DATA16 ASCII

----  -----------------------------------------------  ----------------
0000  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F  ................
0010  10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F  ................
0020  20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F   !"#$%&'()*+,-./
0030  30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F  0123456789:;<=>?
0040  40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F  @ABCDEFGHIJKLMNO
0050  50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F  PQRSTUVWXYZ[\]^_
0060  60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F  `abcdefghijklmno
0070  70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F  pqrstuvwxyz{|}~.
0080  80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F  ................
0090  90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F  ................
00A0  A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF  ................
00B0  B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF  ................
00C0  C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF  ................
00D0  D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF  ................
00E0  E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF  ................
00F0  F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF  ................
0100  07 07 DD 07 00 07 DD 77 01 07 DD 77 02 07 DD 77  ...w...w...w...w
0110  03 07 DD 77 04 07 DD 77 05 07 DD 77 06 07 DD 77  ...w...w...w...w
0120  07 C9 21 00 10 DD 21 00 30 0E 00 1E 00 41 0C 78  ..!...!.0....A.x
0130  A9 A1 28 1F 47 AB 5F 16 86 78 A3 28 02 16 C6 78  ..(.G._..x.(...x
0140  06 07 0F 38 02 10 FB 36 DD 23 36 CB 23 70 23 72  ...8...6.#6.#p#r
0150  23 18 DA 36 E9 21 74 01 DD CB 07 86 DD CB 06 86  #..6.!t.........
0160  DD CB 05 86 DD CB 04 86 DD CB 03 86 DD CB 02 86  ................
NOTE: Memory data formatted into lines of 16 Bytes with the address of the first Byte at the left margin

CODE CE—REPEAT SEGMENT OF DATA OVER BLOCK

The purpose of Code Function CE is to make replicas of a block of data throughout a larger block. For example, suppose it is desired to have a block of identical jump instructions throughout memory. This may be accomplished by first entering the instruction (3 bytes) in the first three locations of the block. Next, enter the length of the block (3) in the DATA register; enter the address of the first location of the block in the BEG register (this is the same address as the first byte of the jump instruction); finally, enter the last address of the block in the END register. When the function is executed, the jump instruction will be copied as many times as it will fit in the specified block.


7-4 GROUP D: MISCELLANEOUS

CODE D0—CLEAR INTERRUPT ENABLE FLIP-FLOP

The interrupt enable flip-flop of the emulation processor is cleared so that the next time the processor starts running, interrupts will not be allowed.

CODE D1—SET INTERRUPT ENABLE FLIP-FLOP

The interrupt enable flip-flop of the emulation processor is set so that the next time the processor starts running, interrupts will be allowed.

CODE D2—DISPLAY CLOCK FREQUENCY

This Code Function is a routine that determines the clock frequency of the emulation processor by comparing the instruction execution rate of the processor with the EM-180 internal 1.2KHz reference frequency. The internal reference frequency is derived from the crystal controlled UART clock. The frequency is displayed on the ADDRESS display and is given in kilohertz. For example, a Z-80 operating with a 4.0 MHz clock will display 4000 (kilohertz) on the ADDRESS displays when CODE D2 is executed. The result is accurate to about ± .01% (the accuracy of the UART crystal.)

CODE D3—DISPLAY PROM/ROM SIGNATURE

The purpose of this Code Function is to provide a convienent way of verifying that all bits in a PROM or ROM are correct. The routine operates by reading each 8-bit byte in a specified range and shifting the bits into a firmware implemented feedback shift register. By this means, the routine calculates a 16-bit check value that is displayed as a 4-digit hexadecimal signature on the ADDRESS display. This signature has a very high probability (.9998) of being unique for any given bit pattern in a ROM. A PROM or ROM signature is obtained by setting the first address of the ROM in the BEG register and the last address of the ROM in the END register; then execute the routine. The Code Function routine will calculate and display the ROM signature. If the correct cignature has been obtained previously with a known good ROM, then the ROM under test is good if it has the same signature.

There is a technique that may be used to create PROMs or ROMs whose signatures are zero. For the method to work, the last two locations of the ROMs must be unused. Proceed as follows:

1. Program a PROM with the desired information, making sure that the last two bytes are zeros.

2. Determine the signature of the PROM using the CODE D3 function.


3. Program a new PROM with the desired information, but replace the last two bytes, which previously were zero, with the bit pattern of the signature obtained in Step 2.

Now, while the signature of the new PROM is being calculated, the routine will arrive at a point just prior to processing the last two bytes of the PROM and at that time, the shift register will contain the signature of the PROM as calculated in step 2; entry of the last two bytes, containing the same bit pattern as that already in the shift register results in the shift register reaching a final value of zero when computation is complete. Thus, the PROM will have a signature of 0000.

CODE D4—OUTPUT 50 NULS TO SERIAL PORT

This Code Function outputs 50 nul characters (0016) to the serial port for the purpose of providing leader or trailer for users using punched paper tape as a data storage media. There are no parameters for this Code Function.

CODE D5—CALL USER ROUTINE IN INTERNAL RAM AT 300016

CODE D6—CALL USER ROUTINE IN INTERNAL RAM AT 300316

These two Code Functions provide a means for the user to transfer control to routines that have been entered into the EM-180 internal scratch pad RAM for various reasons. To make use of this feature, the user must understand the requirements of the programs that run in the EM-180 internal environment. See Section 8—User Implemented Code Functions.

CODE D7—CLEAR TRACE MEMORY

The EM-180 Trace Memory ic cleared when power is applied as part of the power-on-reset operations. Code Function D7 is used to clear the Trace Memory at any other time. This routine does not use any parameters.

CODE D8—DISASSEMBLE AND OUTPUT ENTIRE CONTENT OF TRACE MEMORY (IF DISASSSEMBLER FIRMWARE IS INSTALLED)

This Code Function outputs the entire content of the Trace Memory to the serial port in the standard disassembler format (Code E2, 72-character lines*). This routine may be called even if the regular disassembly feature of the EM-180 is disabled. Data output may be suspended for a moment by depressing the EXAM key; when the key is released, data output will continue. See Section 6—Disassembly.

*The disassembly format can be changed by executing Code E1 or E3 before executing Code D8.


CODE D9—HALT CPU

Code Function D9 causes the CPU to execute a HALT instruction, thereby halting the CPU. It is recommended that the CPU be halted any time that an EPROM is inserted into or removed from the Front Panel Diagnostic PROM Socket to avoid the possibility of crashing the internal control program of the EM-180. After the CPU has been halted, RESET must be used to resume normal operation. There are no parameters for this function.

CODE DA—DISPLAY REVISION NUMBER FOR CONTROL PROM

CODE DB—DISPLAY REVISION NUMBER FOR DISASSEMBLY PROM

These two Code Functions display the date and revision information for the control PROM software and the disassembly PROM software respectively. The format is as follows:

ADDRESS DATA
DISPLAY DISPLAY

Revision number (0, 1, 2, ...)
Revision letter (A, B, C, ...)
Day of Month (1-31)
Month (1, 2, 3, ... 9, A, B, C)
Year (0, 1, 2, ... 9)

CODE DC—CALCULATE BRANCH OFFSETS

Code Function DC is intended to simplify the task of calculating branch offsets for Z-80 relative branch instructions. To use this routine, enter the address of the destination of the branch instruction in the BEG register; enter the address of the byte following the branch instruction in the ADDR register. Execute the function and the Address Display will show two digits that are the required branch offset. If the required offset is too large to be reached by branch instructions, then the four digits will be displayed showing the offset.


CODE DD—SELF TEST OF INTERNAL PROM DATA

Code Function DD is used to perform a check of the data in the internal PROMs (the Control/Disassembly PROM and the two Line Assembler PROMs). When this function is called, the data display will show 01 while the first 8K (Control/Disassembly PROM) is being tested and 02 while the remaining 16K (Line Assembler PROMs) are being tested.

A failure of this test will result in three beeps and the display will show EC 31 if the Control/Disassembly PROM failed or EC 32 if either of the Line Assembler PROMs failed.

CODE DE—OUTPUT LINE ENDING SEQUENCE TO SERIAL PORT

This Code Function outputs the line ending sequence to the serial port consisting of a carriage return, a line feed, and two null characters. The routine is used to obtain a new line on a CRT or other ASCII display.

CODE DF—DISPLAY HOURS, MINUTES, SECONDS

Code Function DF places the EM-180 in a clock mode that counts hours, minutes and seconds on the Address and Data displays. To set the initial display, enter the desired hours and minutes into the ADDR register and the desired seconds display into the DATA register. Then execute the function to start the clock. If the initial values are set to zero, then the clock will indicate elapsed time from 0000 00 to 1259 59 (13 hours).

7-5 GROUP E: CHANGE DEFAULT PARAMETERS

CODE E0—DISABLE DISASSEMBLY (DEFAULT)

Code Function E0 is used to disable the disassembly software if it is in operation. See Section 6—Disassembly.

CODE E1—ENABLE DISASSEMBLY

Code Function E1 enables the disassembly firmware and configures the firmware to output 80-character lines with one line of register display. See Section 6.

CODE E2—ENABLE DISASSEMBLY

Code Function E2 enables the disassembly firmware and configures the firmware to output 72-character lines with one line of register display. See Section 6.

CODE E3—ENABLE DISASSEMBLY

Code Function E3 enables the disassembly firmware and configures the firmware to output 72-character lines with two lines of register display. This is the only format that displays all the Z-80 internal registers of general interest. See Section 6, Disassembly.


CODE EF—ENABLE REMOTE CONTROL

Code EF disables the EM keyboard, placing it into remote control mode so that commands received through the serial port control the emulator.

7-6 GROUP F: INTERNAL OPERATIONS

CODE F—SET INTROSPECTION MODE

Execution of this Code Function sets the EM-180 so that its own internal address space becomes the "target system". After execution of the CODE F function, memory examine and store operations will be directed to the EM-180 internal address space; programs internal to the EM-180 may be executed in single-step mode and other internal operations performed. See Section 8—User Implemented Code Functions.

CODE F0, F1, ... F9

Code Functions F0 through F9 are used to set up the EM-180 to debug user programs residing in the front panel Diagnostic PROM Socket. These functions each set the emulator into "introspection" mode so that the internal address space is accessible, set the stack pointer to 306016 (the top of the internal user RAM area) and set the program counter to the starting address of the respective user Code Function. The EM-180 is then ready to execute the user's program in single-step mode or at full speed; breakpoints may be set and registers examined, and other normal debugging activities carried out.