0% found this document useful (0 votes)
387 views22 pages

ESA Microprocessor Monitor Commands

This document describes monitor commands for the ESA 86/88-3 microprocessor trainer. The trainer can operate in either serial or standalone mode. Most monitor commands are the same in both modes. Commands include substituting or displaying memory bytes and words, examining and modifying registers, moving memory blocks, filling memory with data, input/output operations, comparing memory blocks, executing user programs, and getting help. The document provides details on command syntax and parameters.

Uploaded by

Ma Lathi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
387 views22 pages

ESA Microprocessor Monitor Commands

This document describes monitor commands for the ESA 86/88-3 microprocessor trainer. The trainer can operate in either serial or standalone mode. Most monitor commands are the same in both modes. Commands include substituting or displaying memory bytes and words, examining and modifying registers, moving memory blocks, filling memory with data, input/output operations, comparing memory blocks, executing user programs, and getting help. The document provides details on command syntax and parameters.

Uploaded by

Ma Lathi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 22

CHAPTER 4

ESA 86/88-3 MONITOR COMMANDS


ESA 86/88-3 Microprocessor can be operated either in serial or stand-alone mode. This chapter describes the serial and standalone mode monitor commands used for working with the trainer. Most of the monitor commands in either mode of operation bear uniformity in syntax and operation. The following discussion on Monitor commands is therefore common to either mode of trainer operation, unless otherwise specified.

4.1

GENERAL OPERATION

Installation and Configuration of ESA 86/88-3 is described in Chapter 2. It is essential that the trainer should be configured properly for working with it smoothly. Getting a proper sign-on message upon RESET as explained in the previous chapter is the minimum requirement for working with ESA 86/88-3 Reset Status: On Power ON/Reset, all information about the previous user program is lost and the registers may acquire new data. However the contents of user RAM are not disturbed if onboard RESET is used. If the RAM is backed up with battery, then the user RAM data is not lost even if power is switched OFF. Resetting the trainer initializes the segment & status registers of the CPU as described below. Table 4.1 Register Initialization Register CS (Code Segment) DS (Data Segment) ES (Extra Segment) SS (Stack Segment) IP (Instruction Pointer) FL (Flags) SP (Stack Pointer) Value (HEX) 0 0 0 0 0 0 100

Further, interrupt vectors 1, 2 and 3 are initialized as follows: Interrupt 1: Single Step Interrupt -This interrupt is used by the monitor with the step command. Interrupt 2: NMI (Non-maskable Interrupt)- This interrupt is implemented by BREAK key and the vectoring information is completely user defined. . Interrupt 3: Breakpoint Interrupt-This interrupt is used with GO command and its use is at the users discretion. A detailed discussion of the 8086/8088-interrupt vectors can be found in the Intels 8086 Family Users Manual (Chapter 2, Processor Control and Monitoring, Interrupts PP 2.22-2.28).
30

ESA 86/88-3 Users Manual

Whenever the monitor is re-entered as a result of a single step or Breakpoint Interrupt, the monitor saves the contents of the 8086/8088 registers on the User Stack and subsequently restores the register contents from the stack before it prompts for command entry. Since the SP register is initialized to 0100H, and memory locations 0H-CFH are reserved for monitor, the stack length reserved for the user is 48 bytes (i.e. locations D0H - FFH). Of these, 26 bytes must be left for register contents, should one of the above interrupts occur (leaving 22 bytes for the user). In addition locations 100H to 1FFFH are used for other system functions and system tables. Hence the user RAM starts from 0:2000H

4.2

STRUCTURE OF MONITOR COMMANDS

When the monitor is ready to accept a command from the user it outputs a period ('.') as the command prompt character at the beginning of a new line. The commands entered by the user consist of one or two-character command mnemonic followed by a list of command parameters. This list may be up to three parameters long depending on the command being used. When more than one parameter is required, a single comma (',') is used between the parameters as a separator. A command is terminated either by a carriage return or by Escape depending on the command itself. Commands are executed one at a time and only one command is allowed in a command line.

4.2.1 RULES OF PARAMETER ENTRY


All addresses in 8086/8088 systems consist of a segment value and an offset value. The segment value is entered first, a colon (':') is entered as a separator and then the offset value is entered. If the segment value is not specified (note that in such a case, the colon also should be omitted), the default segment value is the current content of the code segment (CS) register. The address is entered as a hexadecimal value, most significant character first. The valid range of hexadecimal values for an address entry (either segment or offset) ranges from 0000 to FFFFH. If more than four digits are entered, only the last four digits entered are valid. In other words all address values are interpreted modulo 64K. Data is also entered as hexadecimal value, most significant character first. The valid range for data entries is 00 to FFH for byte entries and from 0000 to FFFFH for word entries. If more than two (for byte entries) or four (for word entries) digits are entered, only the last two or four digits entered are valid. Examine/Modify register command (X) requires register symbols as parameters. The register abbreviation entries required by the X command are described in detail with the explanation of this command.

4.2.2 USE OF +/- OPERATORS AND REGISTERS, IN PARAMETERS SPECIFICATION


While the address/data parameters are to be entered as hexadecimal values, the operators + and - can be used to form expressions and also to specify the use of the contents of any 8086/8088 register as address/data values.

ESA 86/88-3 Users Manual

31

For example, suppose we wish to specify an address whose segment is (ES) + 10H and whose offset is (BX) - 30H. One way is to calculate these values as shown below. Assume (ES) = 0270H and (BX) = 0080H Segment value = (ES) + 10H = 0280H Offset value = (BX) - 30H = 0050H Then the address can be specified as 0280:0050 However, ESA 86/88-3 supports direct specification of such an address value as shown below: ES + 10:BX - 30 The system will automatically evaluate such expressions and use the correct values. These operators can be used to considerably simplify the specification and checking of relative addresses also.

4.2.3 RESPONSE TO ERRORS


Whenever an error is detected the command is aborted, the symbol (`?') is output on the command line, a carriage return and line-feed are issued and the command prompt character (`.') is output at the beginning of the new line. Command execution occurs only after a command terminator (a comma or a carriage return, depending on the command) is entered. Hence a command entry can be cancelled any time before the terminator is entered. The monitor detects entry of any character that is not legal or does not match the expected entry. The monitor then aborts the command, displays a `?' and returns to command entry mode.

4.3

ESA 86/88-3 MONITOR COMMANDS

The Monitor commands in both serial and stand-alone mode are similar and the following discussion holds good for trainer operation in either mode. These commands are summarized in the following table and are described in detail in later sections. In both the table and individual command descriptions, the following notation is used. [V] [V]* <V> ,/indicates that `V' is optional indicates one or more optional occurrences of "V" indicates that V is a parameter to be entered by the user. indicates that either of the two characters is to be entered.

NOTE: These symbols are used to clarify the command formats and they are neither to be entered by the user nor output by the system. In the description of the individual commands, it is assumed that 8086 CPU has been installed. However, all the commands work in identical fashion even if 8088 CPU is installed. The only observable difference would be in the sign-on message generated by the system following Power ON/Reset.

ESA 86/88-3 Users Manual

32

4.3.1 SUMMARY OF ESA 86/88-3 MONITOR COMMANDS


COMMAND
S SW D

FUNCTION
Substitute Memory bytes: Displays / modifies memory bytes Substitute Memory Words: Displays / modifies memory words. Display Memory bytes: Displays block of memory in byte format Display Memory Words: Displays block of memory in word format Examine / modify Registers: Displays modifies 8086/8088 CPU registers Move Memory: Copies a block of memory from one location to the other. Fill Memory (Bytes): Fills a block of Memory with constant byte data Fill Memory (Words): Fills a block of Memory with constant Word data Input byte: Accepts and displays the data byte at the input port Input Word: Accepts and displays the data word at the input port Output byte: Outputs a data byte to the output port Output Word: Outputs a data word to the output port Compare Memory: Compares a block of memory with another block Go (Execute): Transfers the processor control from the monitor to the user program address with optional breakpoint. Single Step: Executes single instruction of the user program Help Command: Lists Monitor commands with their valid syntax.

FORMAT / SYNTAX
S [<address>] <CR> [,/[<new data>] ,] * <CR> SW[<address>]<CR> [,/[<new data>] ,] * <CR> D <start address> [,<end address>]<CR>

DW

DW <start address> [,<end address>] <CR>

X [<reg><CR> [<new data>/,]] <CR>

M <start address> , <end address>,<destination address> <CR> F<start address>,<end address>,<byte value><CR> F<start address>,<end address>,<byte value><CR> I <port address> <CR>[,] * <CR>

FW

IW

IW <port address> <CR>[,] * <CR>

O <port address><CR>[<data>/,]* <CR>

OW

OW <port address> <CR>[<data>/,]* <CR>

C<start address1>,<end address1>,<start address2><CR> G <CR> [<start address> [,<breakpoint address>]] <CR>

N<CR> [<start address>],[,/<new address>]* <CR> H[<Command mnemonic>]<CR>

ESA 86/88-3 Users Manual

33

P*

A**

LL**

LC**

Z**

Invoke Programmer Software: Invokes the software for ESA EPROM Programmer Interface Enter Assembler: Invokes ESA 86/88-3 Symbolic One-line Assembler List Labels: Lists all labels defined in the Symbol table Label Clear: Clears all previously defined labels from the Symbol Table Disassembly Command: Disassemble Hex Code into 8086 mnemonics for a specific memory range

P<CR>

A [address]<CR>

LL<CR>

LC<CR>

Z[<start address>[,<end address>]]<CR>

* Refer Chapter 7 for a detailed discussion of this command ** Refer Chapter 8 for a detailed discussion of these commands.

4.4

COMMAND OUTPUT CONTROL

1. In Serial Mode: During Serial operation, the output to the console can be stopped using the following method. This is applicable in cases of commands wherein the monitor continuously outputs data to the terminal viz. Display memory, Disassembly and compare memory commands. Control-C, entered at any time, immediately terminates the command and the monitor returns to the command entry mode. Entering Control-S stops the output to the terminal but does not terminate the command. Entering Control-Q now resumes the output from the point at which it has been stopped. Entering Control-C now terminates the command. Note that Control-S should be followed only with Control-Q or Control-C. No other console input is allowed following a Control-S. 2. In Stand-alone Mode: When working in stand-alone mode, the LCD is refreshed when the display on row 4 is completed. The next display occurs on Row 1 of the LCD. In case of commands where large display is involved, such as Display Memory, the LCD displays a total of 16 bytes or 8 words at one time and waits for the user to enter <CR> to proceed with subsequent displays. Also there is an additional <CR> required in stand-alone mode for the monitor to return to Command entry prompt. However such commands can be terminated at any stage by entering <Esc>.

4.5

COMMANDS DESCRIPTION

This section describes the commands supported by ESA 86/88-3 monitor. The discussion holds good for either mode of trainer operation unless otherwise mentioned.
34

ESA 86/88-3 Users Manual

4.5.1 SUBSTITUTE MEMORY COMMANDS


FUNCTION Substitute memory byte (S) and Substitute memory word (SW) commands are used to examine the contents of the selected memory locations. If the memory locations selected can be modified (i.e., user RAM locations), the contents can optionally be modified. FORMAT S[<address>]<CR> [,/[<new data>] ,] * <CR> SW[<address>]<CR> [,/[<new data>] ,] * <CR> OPERATION 1. Both commands operate in a similar fashion. To use either command, enter S or SW when prompted for command entry. Then enter the address of the memory location to be examined. followed by carriage return. 2. The monitor will now output the contents of the addressed location followed by a hyphen (the monitor's data entry prompt character) and a space to indicate that the addressed location can now be modified. 3. To modify the contents of this location, enter the new data value. Note that when using the SW command, the byte contents of the next consecutive memory location (addressed memory location +1) are output first, followed by the byte contents of the actual location addressed. Similarly, when updating memory contents using the SW command, the first byte entry will be written into the next consecutive memory location, and the second byte entry will be written into the addressed memory location. 4. After optionally modifying the contents of the addressed location, enter a comma to proceed with the command or <CR> to terminate the command. Entering a comma displays the byte or word data at the subsequent memory locations and prompts the user to optionally substitute the memory content with new data. ERROR CONDITIONS 1. Trying to modify non-existent memory or ROM locations. 2. Entering non-Hex parameters as data. EXAMPLES 1. Examine RAM location 2100H, relative to the DS register, modify the contents of location 2101H and 2102H and examine the contents of 2101H again. .S DS:2100 0000:2100 0000:2101 0000:2102 0000:2103 . <CR> A5-, FF- B7, FF- 5A, FF-<CR>

ESA 86/88-3 Users Manual

35

.S DS:2101 <CR> 0000:2101 B7- <CR> . Note: Here DS is set at 0000. Hence the segment value displayed will be 0000. 2. Examine ROM location FF00:9CH and trying to modify the same. .S FF00:9C<CR> FF00:009C FF- 44,?<CR> . 3. Examine word at location 2120 H relative to DS register. Assume that DS is set to 2000 .SW DS:2120 <CR> 2000:2120 A1F4 <CR> . Note: Here the location DS:2121H contains A1H while DS:2120 contains F4H

4.5.2 DISPLAY MEMORY COMMANDS


FUNCTION Display memory byte (D) and Display memory word (DW) commands enable the user to output the contents of a block of memory to the LCD or to the console, either in byte or word format. FORMAT D <start address> [,<end address>]<CR> DW <start address> [,<end address>]<CR> OPERATION Both the commands operate in a similar fashion. When operating in Serial Mode, these commands provide a line-formatted output of the memory block starting at the `start address' and ending at the end address. However in case of Stand-alone operation a total of 16 bytes or 8 words is displayed at one time and the monitor waits for a <CR> to refresh the output and display the next 16 bytes or 8 words of data if required. Note: The `end address' is always relative to the segment value specified with "start address", or implied with `start address' (i.e. the current contents of CS register if no segment value are specified). Thus with each command execution, a maximum of 64K bytes or 32K words can be displayed. To use either command, enter D (for byte output) or DW (for word output) when prompted for command entry. Then enter the start address of the memory block. Now, if only one byte or word is to be displayed, enter the carriage return. On the other hand, if a block of memory is to be displayed enter a comma and the end address of the range followed by <CR>.

ESA 86/88-3 Users Manual

36

The monitor will now output, beginning on the next line, the starting offset address, the data contents of that location and the contents of the consecutive memory locations up to the end address, if an end address is specified. The line format is arranged such that any subsequent lines (if present) will begin with an offset address whose last nibble is zero. A line consists of a maximum number of 16 bytes or 8 words. In case of stand-alone operation the same amount of data as contained in one line is displayed on the LCD making use of all the 4 lines available. In serial mode, the ASCII equivalents of the memory locations are also displayed at the end of a line of display. ASCII equivalents that cannot be displayed are represented by a ".". The display memory commands can be cancelled, or the output can be stopped and resumed at any time by entering appropriate control parameters described in Section 4.4 ERROR CONDITIONS 1. Specifying an end address that is lesser than the offset value of the start address. EXAMPLES 1. Display contents of location 140H relative to DS register. Assume DS is set to 0000. .D DS:140 <CR> 0000:0140 A0 . 2. Display contents of locations 1000:10CH through 1000:125H. .D 1000:10C,125 <CR> 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 1000:010C 1000:0110 1000:0120 F0 00 00 9C EA BD 04 BA 00 F2 10 21 A4 35 14 17 FA F0 F1 F5 30 31 32 32 34 35 . In addition to the above, the ASCII characters equivalent to the data bytes are also displayed on the right hand side of each line of output only in Serial Mode of operation. The non-existent ASCII equivalent data are represented by a .. In the stand-alone mode the output for the above command will be in the format described below. .D1000:10C,125 <CR> 1000:010C F0 00 00 9C The monitor now waits for the user to enter <CR> to refresh the display and output subsequent data bytes.
37

ESA 86/88-3 Users Manual

<CR> 1000:0110 EA BD 04 10 21 A4 FA F0 F1 <CR> 1000:0120 30 31 32 <CR> .

BA 00 F2 35 14 17 F5 32 34 35

3. Display word at location 10C H relative to DS register. Assume DS is initialized to 2000. .DW DS:10C<CR> 0000 0002 0004 0006 0008 000A 000C 000E 2000:0100 . In case of stand-alone operation, the LCD will output .DW DS:10C<CR> 2000:010C 00F0 <CR> . For displaying a range of data words, the same procedure as with Display Byte is followed, with the only exception that DW replaces D. Note that ASCII equivalent characters are not displayed with word data. 00F0

4.5.3 EXAMINE/MODIFY REGISTER COMMAND


FUNCTION The Examine/Modify Register (X) command is used to examine and optionally modify any of 8086/8088 CPU registers contents. FORMAT X [<reg><CR> [<new data>/,]] <CR> OPERATION 1. To use the Examine/Modify Register command, enter X when prompted for command entry. 2. To examine the current contents of all the registers, enter <CR>. Now the monitor will output the contents of all 14 registers.

ESA 86/88-3 Users Manual

38

3. If the contents of a particular register are to be examined or modified, enter the abbreviated register name after entering X and press <CR>. The abbreviations for the register names are shown in the table 4.2 Table 4.2 Register Abbreviation Register Name Accumulator Base Count Data Stack Pointer Base Pointer Source Index Destination Index Code Segment Data Segment Stack Segment Extra Segment Instruction Pointer Program Counter* Abbreviation AX BX CX DX SP BP SI DI CS DS SS ES IP PC

Now the monitor will output an equals sign =, the current contents of the specified register, the data prompt character - and a space. If you wish to change the contents of this register, enter the new value followed by a comma, or a carriage return. Entering a comma displays the contents of the next sequential register and opens it for optional modification. The register sequence is in the order as shown in the above table. This sequence is not circular i.e. if a comma is entered after the contents of the last modifiable register (viz. Flags register FL) is examined /modified, the command is terminated and the monitor returns to the command entry mode. Entering a carriage return terminates the command. *Program Counter cannot be modified using this command. To modify PC, the user will have to modify CS and IP registers, such that the PC will point to the desired effective address. EXAMPLES 1. Examine the contents of all the registers. .X <CR> AX=1182 BX=A113 CX=000F DX=1242 SP=0100 BP=4020 SI=6020 DI=6F20 DS=0000 SS=0000 ES=0000 CS=0000 IP=0200 FL=F046 PC=00000 . In case of stand-alone mode operation, the display format will be as follows. .X <CR>
39

ESA 86/88-3 Users Manual

AX=1182 CX=000F SP=0100 SI=6020

BX=A113 DX=1242 BP=4020 DI=6F20

The monitor now waits for a user strobe viz. <CR> to refresh the display and output subsequent data <CR> DS=0000 SS=0000 ES=0000 CS=0000 IP=0200 FL=F046 PC=00000 <CR> . 2. Examine and modify the SP register and examine the next register i.e. BP .XSP=0100 - 0110, BP=4020-<CR> .

4.5.4 MOVE MEMORY COMMAND


FUNCTION Move Memory command (M) is used to copy a block of data from one area of the memory to another area within the CPU's memory space. FORMAT M <start address>,<end address>,<destination address> <CR> OPERATION 1. To use this command, enter M when prompted for command entry. Now enter the three required parameters separated by commas. The three parameters are the "start" and "end" addresses of the memory block to be copied and the start address of the destination block. In this command, the end address is relative to the segment value specified with `start address' or implied with the `start address' (i.e. the current contents of CS register if no segment value is specified). Consequently, no segment value is permitted with the `end address' and with each command execution, a maximum of 64K bytes can be moved. The segment for the destination address is relative to the current CS value unless otherwise specified. Then enter <CR> to execute the command. 2. Now the monitor copies the contents of the memory block from "start address" to "end address", of consecutive memory locations beginning at `destination address'. After moving the block of memory, monitor returns to the command entry mode.
ESA 86/88-3 Users Manual 40

Notes: Since Move operation is performed one byte at a time, M command can be used to fill a block of memory with a predefined constant. To do this, move the constant into the "start address" location using S command. Then M command is used with a "destination address" which is one greater than the "start address". Then the memory block from start address to "end address" +1 is filled with the value contained in "start address". ERROR CONDITIONS 1. Trying to move data into a non-existent memory or ROM locations. 2. Specifying an `end address' value that is less than the offset value of the "start address". EXAMPLES 1. Move the contents of the locations 2000H through 2020H relative to CS register, to the memory block starting at 3000H relative to the DS register. .M2000,2020,DS:3000<CR> 2. Fill memory locations 1000:2000H through 1000:2100H with constant AAH. .S 1000:2000, <CR> 1000:2000 BA- AA<CR> .M1000:2000,20FF,1000:2001<CR> The validity of the Move Memory commands can be verified anytime using the Display Memory or Compare Memory commands.

4.5.5 FILL BYTE AND FILL WORD COMMANDS


FUNCTION This command is used to fill a block of memory with constant byte or word data. FORMAT F<start address>,<end address>,<byte value><CR> FW<start address>,<end address>,<word value><CR> OPERATION 1. Both commands operate in a similar way. Enter F or FW to fill byte or word data respectively when prompted for command entry. Now enter the starting address of the block and the ending address of the block separated by a comma. 2. Now enter a comma and the byte or word data to be filled. Enter <CR> to execute the command after which the monitor returns to the command entry mode. 3. The user may check the validity of this command by using Display Memory commands described above.
41

ESA 86/88-3 Users Manual

NOTE: The command will accept the last two Hex Characters entered as valid data in case of Byte operation and the last four Hex characters as valid data during Word operation. In case, less than four characters are entered during Word operation the command assumes the upper nibbles not entered to be 0. ERROR CONDITIONS 1. 2. 3. Entering the ending address offset lesser than the starting address offset Trying to enter a non-Hex value for the address or data. Trying to fill non-existent memory or ROM locations.

EXAMPLE 1. Filling the memory locations from 0:2000 to 0:2050 with constant data byte 55

F0:2000,2050,55<CR> 2. Filling the memory locations from 0:5000 to 0:6000 with constant word data 1234 FW0:5000,6000,1234<CR> 3. Filling the memory locations from 0:5000 to 0:6000 with constant word data 00AA FW0:5000,6000,AA<CR>

4.5.6 INPUT BYTE AND INPUT WORD COMMANDS


FUNCTION The Input Byte (I) and Input Word (IW) commands are used to input (accept) a byte or word from an input port, and to display the accepted byte or word. FORMAT I <port address> <CR>[,] * <CR> IW <port address> <CR>[,] * <CR> OPERATION 1. Both the commands operate in a similar way. Enter I (to input byte) or IW (to input word) when prompted for command entry. Now enter the address of the port to be read followed by <CR>. Since the I/O space is only 64K bytes, no segment value is permitted with port address. 2. The monitor now reads the byte or word at the specified port and displays it on the console or LCD. To proceed with the command, enter comma. Each subsequent comma increments the port address and displays the current data at the addressed port on a new line. Entering a carriage return terminates the command and the monitor returns to the command entry mode.

ESA 86/88-3 Users Manual

42

EXAMPLES 1. Input a byte from parallel I/O port at address FFE1H .IFFE1<CR> FFE1 - FA<CR> . 2. Input a series of words from parallel I/O ports located at addresses FFE0H and FFE6H. .IWFFE0<CR> FFE0 - A2A2, FFE2 - B2B2, FFE4 - C2C2, FFE6 - D2D2<CR> . Note that when using word input i.e. IW command, lower order addresses i.e. addresses on word boundaries are entered as port addresses.

4.5.7 OUTPUT BYTE AND OUTPUT WORD COMMANDS


FUNCTION The Output Byte (O) and Output Word (OW) commands are used to output a byte or word to an output port. FORMAT O<port address> <CR> [<data>/,] * <CR> OW<port address> <CR> [<data>/,] * <CR> OPERATION 1. Both the output commands (O and OW) operate similarly. Enter O to output a byte, or OW to output a word when prompted for a command entry. Now enter the address of the port to which data is to be output followed by a <CR>. No segment value is permitted with the port address. (I/O address space is limited to 64K bytes). 2. After this, enter the data to be output in Byte or Word format as applicable or a comma if you wish to skip outputting data at this port. Entering a comma will increment the port address after which the monitor displays this address on a new line and the process continues. 3. To send data to the specified port, enter the byte or word data, followed by a comma or <CR>. Entering <CR> terminates the command after the command execution Entering a comma sends the data to the specified port but does not terminate the command, and it permits subsequent data output to IO ports in succession. The users always have an option to either output data at a port, or skip the port and proceed with the subsequent I/O port. At any stage, entering <CR> terminates the command and returns to the monitor command prompt.

ESA 86/88-3 Users Manual

43

EXAMPLES 1. Program the parallel I/O port FFE0H for output by sending appropriate command byte to the status port FFE6H. .OFFE6 <CR> FFE6 - 80<CR> . 2. Output a series of words to ports ranging from FF00 to FF06 .OFF00<CR> FF00 - 1234, FF02 - ABCD, FF04 - 5555, FF06 - 3676<CR> .

4.5.8 COMPARE MEMORY COMMAND


FUNCTION This command compares a block of memory with another block and displays differences in the locations when found. FORMAT C<start address1>,<end address1>,<start address2><CR> OPERATION 1. 2. To use this command enter C when prompted for command entry Now enter the starting address of the first block of memory followed by a comma and the ending address of the block. Follow this with a comma and the starting address of the second block.

NOTE: In this command, end address1 is always relative to the segment value specified with start address1 or implied with start address1 (i.e. the contents of CS register if no segment value is specified). Consequently, no segment value is permitted with the end address1 and with each command execution, a maximum of 64K bytes can be compared. The segment for start address2 is relative to the current CS value unless otherwise specified. 3. Pressing <CR> starts execution of the command. The monitor will compare subsequent data at each corresponding location of the blocks and display differences when found in the following pattern. The display format for stand-alone mode of operation is described below Segment1:offset1 - data 4. Segment2:offset2 - data

The monitor returns to command entry mode at the end of command execution
44

ESA 86/88-3 Users Manual

ERROR CONDITIONS 1. Entering the ending address offset lesser than the starting address offset 2. Trying to enter a non-Hex value for the address or data. 3. Entering a value for the offset of the second address such that the range of locations left in the segment from this offset does not match the range to be compared. EXAMPLES 1. Compare a block of memory beginning at 0:2000 to 0:2050 with a block beginning at 0:3000

.C0:2000,2050,0:3000<CR> . . This response shows that there was no mismatch. 2. Compare a block of memory beginning at 0:2500 to 0:2550 with a block beginning at 0:3000

.C0:2500,2550,0:3000<CR> 0000:2505 - 45 0000:3005 - 76 0000:2515 - 21 0000:3015 - 16 0000:2532 - 45 0000:3032 - A3 0000:2544 - 1A 0000:3044 - 22 . This response shows that there was a mismatch at 4 locations. In case of stand-alone operation, the command entry format is similar to that in the serial mode. The output in case of example 2 will be as follows. 0000:2505 - 45 0000:3005 - 76<CR> 0000:2515 - 21 0000:3015 - 16<CR> The display will now be refreshed and the monitor will output the following result. 0000:2532 - 45 0000:3032 - A3<CR> 0000:2544 - 1A 0000:3044 - 22<CR> .

4.5.9 GO (EXECUTION) COMMAND


FUNCTION Go (G) command is used to transfer control of the CPU from the Monitor to a user's program.
ESA 86/88-3 Users Manual 45

FORMAT G <CR> [<start address> [,<breakpoint address>]]<CR> OPERATION 1. To use this command, enter G when prompted for command entry followed by a <CR>. The monitor now outputs the current CS and IP register contents in the Segment:Offset format. 2. If the user wishes to start program execution from an alternate starting address, the user has to enter the same. Segment specification is not necessary if the segment value of the program start address is the same as the current code segment. 3. The user may use the Breakpoint facility by entering a comma followed by a break point address at which program execution needs to be stopped. No segment value is permitted with breakpoint address. Thus the default segment value for the break-point address is either the segment specified with the "start address" or the current CS register content if a segment value is not specified. Breakpoint implementation is discussed below in detail. 4. To begin program execution, enter carriage return. CPU Control is now transferred from the monitor to the user program. Program termination is entirely dependent on the instructions entered by the user. 5. To exit from the executing program and to return control to the monitor the user has the following options. At the logical termination of the users program the user should enter the instruction INT 03 (Hex Code = CC). This instruction will perform the Type 3 interrupt service routine embedded in the ESA 86/88-3 Monitor, which will break the program at that address, display all the current register contents and return to command entry prompt. The user can use the Breakpoint facility provided with the GO command and can break the program at any desired address. With this option, the user program breaks at the specified address and control is transferred back to the monitor. Breakpoint facility is discussed in detail below. If the user program ends with a HLT instruction (Hex Code = F4) or continues to execute in an endless loop, the user may have to RESET the trainer. However upon RESET, any previous information of the program contained in segment and status registers is lost and they are reinitialized to their default values.

4.5.10 BREAKPOINT FACILITY


GO command permits the optional specification of a "breakpoint address". When program reaches the breakpoint address, control is transferred to the monitor and contents of all registers are saved. Before returning to command entry prompt, the monitor outputs the message BR@ followed by a display of all processor registers, the breakpoint address in Segment:Offset format, the machine code and disassembled line of the program instruction at that address.

ESA 86/88-3 Users Manual

46

If a subsequent GO command is entered, the current address displayed will be the break-pointed address. The user can resume execution of the program from this address by just entering <CR>. While implementing breakpoint facility the monitor saves the instruction at the breakpoint address, and replaces it with an interrupt before transferring control to the user's program. When the program reaches the breakpoint address, control is returned to the monitor. The monitor saves all CPU registers, restores the break-pointed instruction and outputs the previously described pattern. It then issues the command entry prompt allowing the user to modify any of the registers, memory locations before resuming the execution of the program. From the above discussion, it is clear that The user can specify a Breakpoint address only when a comma precedes it. The segment value for the breakpoint address is always relative to the start address segment value. An instruction in the read-only memory cannot be break-pointed. Break point address must be specified each time when a program to be break-pointed is executed.

BR@ is displayed on the console only i.e. it appears only in the serial mode. In stand-alone mode the monitor proceeds with the registers display directly. EXAMPLES 1. Transfer control to the program at 2000H relative to CS register .G<CR> .G 0000:0000 2000<CR> . 2. Transfer CPU control to a program starting at location 20:300H and breakpoint the instruction at location 20:3F2H. .G<CR> .G 0000:0000 20:300,3F2<CR> BR@ AX=1182 BX=A113 CX=000F DX=1242 SP=0100 BP=4020 SI=6020 DI=6F20 DS=0000 SS=0000 ES=0000 CS=0020 IP=03F2 FL=F002 PC=005F2 0020:03F2 55 PUSH BP . In Stand-alone mode of operation, the output format on the LCD with respect to the above command will be as described below. .G<CR> .G 0000:0000 20:300,3F2<CR>

ESA 86/88-3 Users Manual

47

The monitor refreshes the LCD and displays all the CPU registers in the following format. In this mode, the monitor waits for user strobes wherever necessary. AX=1182 CX=000F SP=0100 SI=6020 <CR> BX=A113 DX=1242 BP=4020 DI=6F20

DS=0000 SS=0000 ES=0000 CS=0020 IP=03F2 FL=F002 PC=005F2 <CR> 0020:3F2 PUSH BP 55 <CR> . 3. Attempting to breakpoint an instruction in the EPROM area. As shown below, this will result in an error. .G<CR> .G 0000:0000 F000:100,122<CR> ?G 0000:0000 20:300,3F2 NOTE: All underlined lines in these examples are either overwritten by the statements following or are inserted in the text merely for illustration.

4.5.11 SINGLE STEP COMMAND


FUNCTION Single step (N) command is used to execute single instruction of a program. After the execution of each instruction executed, CPU control is returned to the monitor from the program being executed. FORMAT N<CR> [<start address>],[,/<new address>]* <CR> OPERATION 1. To use the single step command, enter N with <CR> when prompted for command entry. Now the monitor will output the current contents of CS & IP registers in Segment:Offset format.

ESA 86/88-3 Users Manual

48

2. If the program is to be executed from an address other than that displayed, the user must enter a new start address followed by a comma. The segment value of the start address is implied to be the same as the current value of the CS register unless it is explicitly entered. 3. The monitor now outputs the current content of the CPU registers followed by a line of disassembled code at the start address. To proceed with execution of this instruction, enter another comma. 4. The addressed instruction is now executed and CPU control returns to the monitor. Before this the monitor saves all the registers, displays them and outputs a line of disassembled code at the address of the next subsequent instruction. Now the user can enter a comma and proceed with executing the instruction at the displayed address or enter a new address at which an instruction is to be single stepped. Note that the monitor does not output a command entry prompt, although at this stage control rests with the monitor. Hence entry of any other command at this stage will result in an error. 5. Each time a comma is entered, the addressed instruction is executed and the address and instruction byte contents of the next instruction to be executed along with all registers and a disassembled line of next instruction code is displayed. A new start address can be specified after executing any instruction. 6. A carriage return, after executing an instruction terminates the command and returns the monitor to command entry mode. Modification of any memory or register contents can be done while single stepping through a program only by using a <CR>. However since the current command is terminated, the user will have to re-enter the single-step command and proceed. RESTRICTIONS 1. An instruction that is part of a sequence of instructions that switches between stack segments (i.e. changes the SS and SP register contents) can not be single stepped. 2. If an interrupt occurs prior to the completion of a single-stepped instruction or if a singlestepped instruction generates an interrupt, then CS and IP registers will contain the address of the interrupt service routine when the monitor regains control. Consequently, a Type 3 (Breakpoint) interrupt instruction (CCH) should not be single-stepped (since its execution will cause the program execution sequence to enter the Monitor). EXAMPLES 1. Single step the first three instructions of a program starting from location 0:2000H onwards and then branch off the execution sequence to location 100:3000H and execute the single instruction at that location.

.N<CR> .N 0000:0000 0:2000, AX=0000 BX=0000 CX=0000 DX=0000 SP=0100 BP=0000 SI=0000 DI=0000 DS=0000 SS=0000 ES=0000 CS=0000 IP=2000 FL=0000 PC=02000 0000:2000 BA E6 FF MOV DX,FFE6 , BR@
ESA 86/88-3 Users Manual 49

AX=0000 BX=0000 CX=0000 DX=FFE6 SP=0100 BP=0000 SI=0000 DI=0000 DS=0000 SS=0000 ES=0000 CS=0000 IP=2003 FL=F002 PC=02003 0000:2003 B0 80 MOV AL,80 , BR@ AX=0080 BX=0000 CX=0000 DX=FFE6 SP=0100 BP=0000 SI=0000 DI=0000 DS=0000 SS=0000 ES=0000 CS=0000 IP=2005 FL=F002 PC=02005 0000:2005 EE OUT DX,AL , BR@ AX=0080 BX=0000 CX=0000 DX=FFE6 SP=0100 BP=0000 SI=0000 DI=0000 DS=0000 SS=0000 ES=0000 CS=0000 IP=2006 FL=F002 PC=02006 0000:2006 FF DB FF 100:3000, BR@ AX=0080 BX=0000 CX=0000 DX=FFE6 SP=00FE BP=0000 SI=0000 DI=0000 DS=0000 SS=0000 ES=0000 CS=0100 IP=3001 FL=F002 PC=04002 0100:3001 50 PUSH AX <CR> . For better understanding and familiarization of this command, single step the example programs given in Chapter 10 following the above discussion and observe the results. Note: The above description of this command is applicable to serial mode operation where the command output can be seen on the console. The command will follow a similar execution sequence in stand-alone mode operation also, except for a difference in the register display format. An extra <CR> will be required to proceed with the command since the LCD output will be refreshed after a strobe from the user. 4.5.12 HELP COMMAND (H) FUNCTION This command lists ESA 86/88-3 Monitor commands with their valid syntax in Stand-alone mode of trainer operation. FORMAT & OPERATION H[<Command mnemonic>]<CR> 1. When prompted for command entry entering H with <CR> lists ESA 86/88-3 Monitor commands with a description of their valid syntax on the LCD. Thus the user can use this command as a ready reference source on the monitor commands. 2. If the command syntax of a particular command is required, then the user should enter H followed by the command Mnemonic.
50

ESA 86/88-3 Users Manual

For e.g. entering HS with <CR> will output the syntax of the Substitute memory command. After displaying the command, the monitor waits for a user strobe viz. <CR> to display the next command and its syntax. Pressing <Esc> will terminate the command and the monitor returns to command entry mode. The command syntax appearing with the description of this command is the same as that of the Command Help appearing in Serial Mode of operation.

4.6

MORE MONITOR COMMANDS

1. Refer Chapter 7 of this manual for a detailed description of ESA 86/88-3 EPROM Programmer system invoked by the following command. P (Invoke Programmer) P<CR>

The EPROM Programmer software further supports commands to Read, Blank Check, Verify and/or Program the popular EPROMS 2716 through 27512 and the on-chip code memory of 8x51 Microcontrollers. 2. Refer Chapter 8 of this manual for a detailed description of ESA 86/88-3 Symbolic Oneline Assembler and a discussion of the following Monitor commands in support of this assembler. A (Invoke Assembler) LL (List Labels) LC (Clear Labels) Z(Disassembly) A[address>]<CR> LL<CR> LC<CR> Z[<start address>[,<end address>]]<CR>

ESA 86/88-3 Users Manual

51

You might also like