
( Note: BUFFALO.TXT (this file) begins at section 3.4 )

3.4 CHECKOUT PROCEDURE

This procedure will enable the user to perform a pre-operational
checkout of the EVB for basic operation.  After completion of the
EVB kit and cable assembly construction, the EVB is configured
for operation.  For this procedure, the fabricated jumper is
removed from the re set select header Jl to enable power supply
and terminal, power is applied to the EVB.

			  NOTE 

	       Ensure that hte terminal connected to the
	       EVB is configured for the proper baud rate
	       applicable to the EVB.

Applying power to the EVB causes a Power On Reset (POR) to occur. 
This POR condition causes the MCU and user I/O port circuitry to
be reset, and the monitor invoked.  The terminal Cathode Ray Tube
(CRT) displays the following EVB monitor prompt:

     BUFFALO X.X - Bit User Fast Friendly Aid to Logical
			Operation

If the EVB monitor prompt is not displayed (as shown above),
press the user reset switch Sl.  If the EVB monitor prompt cannot
be displayed, the following steps are to be performed.

     a.  Disconnect EVB power source.

     b.  Check all EVB cabling and power connections.

     c.  Check hardware preparation procedures (jumper headers    
	J1-J4) for proper jumper placements.

     d.  Check all EVB components for paper PCB placement.

     e.  Check reset circuitry (UllB, pin 4).

     f.  Check MCU clock circuitry (U9, pins 7 and 8).

     g.  Check E-clock (U8, pin 14).

     h.  Check baud rate clock (U8, pins 3 and 4).

     i.  Check chip select signals for the RAM, EPROM, and ACIA   
	devices.

If the EVB monitor prompt is displayed, proceed to Chapter 5 for
complete operating instructions.






																						    CHAPTER 4 
				    
				    
			     MONITOR PROGRAM
				    
4.1 INTRODUCTION

This chapter provides the overall description of the monitor
program.  This description will enable the user to understand the
basic structure of the program, and to modify or customize the
program for specific applications.


4.2 PROGRAM DESCRIPTION

The monitor program supplied for the EVB is called BUFFALO (Bit
User Fast Friendly Aid to Logical Operations).  This program
communicates via the MC6850 Asynchronous Communications Interface
Adapter (ACIA) device and the MCU Serial Communications Interface
(SCI).  Refer to Appendix B for additional information pertaining
to the monitor (BUFFALO) program.

The EVB monitor program is contained in EPROM (external to the
MCU).  MCUs supplied with the EVB kit have the configuration
(CONFIG) register ROMON bit cleared thereby disabling hte MCU
internal ROM.  Having the monitor program in EPROM external to
the MCU at locations $EOOO-$FFFF is a great advantage because it
allows the user to add instructions to customize the monitor for
specific requirements.

The main module of the monitor program includes all the parts
required by any of the individual command modules.  Therefore the
main module is a kernal of the BUFFALO monitor program, and
consists of five parts which are as follows:


     a.  Initialization

     b.  Command interpreter

     c.  I/O routines 

     d.  Utility subroutines

     e.  Command table


4.2.1 Initialization

This part of the main module contains all of the reset
initialization code.  In this section, internal RAM locations are
set up, and the I/O channel for the terminal is set up.  To set
up the terminal I/O port, BUFFALO must determine if the terminal
is connected to the SCI or to an external ACIA/DUART.  This is
accomplished by sending a sign-on message to both ports and then
waiting for response from either port.  When BUFFALO recognizes a
carriage return from either port, that port is then used for all
subsequent terminal I/O operations.


4.2.2 Command Interpreter

The next section of the main module is the command interpreter. 
American Standard Code for Information Interchange (ASCII)
characters are read form the terminal into the input buffer until
a carriage return or a slash (/) is received.  The command field
is then parsed out of the input buffer and placed into the
command buffer.  A table of commands is then searched and if a
match is found, the corresponding command module is called as a
subroutine.  All commands return back to the command interpreter
upon completion of the operation.


4.2.3 I/O Routines

The I/O section of the main module consists of a set of
supervisor routines, and three sets of driver routines.  The
supervisor routines are INIT, INPUT, and OUTPUT.  These routines
determine which driver subroutine to call to perform the specific
action.  Each set of driver routine consists of an initialization
routine, an input routine, and an output routine.  One set of
drivers is for the SCI port and these routines are called ONSCI,
INSCI, and OUTSCI.  The second set of drivers is for a DUART and
these routines are called ONUART, INUART, and OUTUART.  The third
set of drivers is for an ACIA and these routine ar called ONACIA,
INACIA, and OUTACIA.

All I/O communications are controlled by three RAM locations
(IODEV, EXTDEV, and HOSTDEV).  EXTDEV specifies the external
device type (0=none, l=ACIA, 2=Duart).  HOSTDEV specifies which
I/O port is used for host communications (O=SCI, 1=ACIA,
2=DUARTB).  IODEV instructs the supervisor routine which
port/driver routine to use (0=SCI, 1=ACIA, 2=DUARTA, 3=DUARTB).

The INIT routines set up a serial transmission format of eight
data bits, two stop bits, and no parity.  For the SCI, the baud
rate is set to 9600 for an 8MHz crystal (2 MHz E-clock).  The
ACIA is also initialized to 9600 baud using and Acia crystal as
specified in Chapter 2.  To achieve a different baud rate,
different crystal values could be used, or the baud rate control
registers can be modified using the MM command.  For the SCI,
this means modifying address $102B (refer to MCU data sheet, SCI
baud rate selection).  For the ACIA $9800 is the address of the
control register.

The INPUT routine reads from the specified port.  If a Character
is received, the character is returned in accumulator A.  If no
character is received a zero (0) is returned in accumulator A. 
This routine does not wit for a character to be received before
returning (this function performed by the INCHAR subroutine).

The OUTPUT routine takes the ASCII character loaded in
accumulator A and writes to the specified I/O port.  This routine
waits until the character is transmitted before returning.


4.2.4 Utility Subroutine

Several subroutines exist that are available for performing I/O
tasks.  A jump table has been set up in ROM directly beneath the
interrupt vectors.  To use these subroutines, execute a jump to
subroutine (JSR) command to the appropriate entry in the jump
table.  By default, all I/O performed with these routines are
sent to the terminal port.  Redirection of the I/O port is
achieved by placing the specified value (O=SCI, 1=ACIA, 2=DUARTA,
3=DUARTB)into RAM location IODEV.

Utility subroutines available to the user are as follows:

     UPCASE    If character in accumulator A is lower case alpha,
	       convert to upper case.

     WCHEK     Test character in accumulator A and return with Z
	       bit set if character is whitespace (space, comma,
	       tab).

     DCHEK     Test character in accumulator A and return with Z
	       bit set if character is delimiter (carriage return
	       or whitespace).

     INIT      Initialize I/O device.

     INPUT     Read I/O device.

     OUTPUT    Write I/O device.

     OUTLHLF   Convert left nibble of accumulator A contents to
			ASCII and output to terminal port.

     OUTRHLF   Convert right nibble of accumulator A contents to
			ASCII and output to terminal port.

     OUTA      Output accumulator A ASCII character.

     OUTlBYT  Convert binary byte ar address in index register X
		 to two ASCII characters and output.  Returns
		address in index register X pointing to next byte.

     OUTlBSP   Convert binary byte at address in index register X
		to two ASCII characters and output followed by a
		space.  Returns address in index register 



     OUT2BSP   Convert two consecutive binary bytes starting at
		 address in index register X to four ASCII
		 characters and output followed by a space. 
		 Returns address in index register X pointing to
		next byte.

     OUTCCRLF  Output ASCII carriage return followed by a line
		 feed.

     OUTSTRG   Output string of ASCII bytes pointed to by address
		 in index register X until character is na end of
		transmission ($04).

     OUTSTRGO  Same as OUTSTRG except leading carriage return
		and line feed is skipped.

     INCHAR    Input ASCII character to accumulator A and echo
		back.  This routine loops until character is
		actually received.


Utility jump subroutines for performing I/O tasks are shown
below.  These subroutines are in ROM and are programmed as jumps. 
To use the jump subroutine, execute a JSR to the applicable
address shown below.


$E1B0     JMP  UPCASE           Convert character to uppercase
$E319     JMP  WCHEK            Test character for whitespace
$E324     JMP  DCHEK            Check character for delimiter
$E37B     JMP  INIT             Initialize I/O device
$E39B     JMP  INPUT            Read I/O device
$E3C3     JMP  OUTPUT           Write I/O device
$E4D3     JMP  OUTLHLF          Convert left nibble to ASCII and output
$E4D7     JMP  OUTRHLF          Convert right nibble to ASCII and output
$E4E1     JMP  OUTA             Output ASCII character
$E4E5     JMP  OUTlBYT          Convert binary byte to 2 ASCII
					characters and output
$E4F4     JMP  OUT1BSP          Convert binary byte to 2 ASCII
					characters and output followed by space 
$E4F1     JMP  OUT2BSP          Convert 2 consecutive binary bytes to 4
					ASCII characters and output followed by
					space.    
$E4FD     JMP  OUTCRLF          Output ASCII carriage return followed by
					line feed
$E50D     JMP  OUTSTRG          Output ASCII string until end of
					transmission ($04)  
$E510     JMP  OUTSTRGO         Same as OUTSTRG except leading carriage
					 return and line fees is skipped    
$E539     JMP  INCHAR           Input ASCII character and echo back



4.2.5  Command Table

The command table consists of three lines for each entry.  The
first byte is the number of characters in the command name.  The
second entry is the ASCII command name.  The third entry is the
starting address of the command module.  As and example:

	  FCB  3                3 characters in command name
	  FCC  'ASM'            ASCII litera command name string
	  FDB  #ASM     Jump address for command module

Each command in the BUFFALO program is a individual module. 
Thus, to add or delete commands, all that is required os to
include a new command table.


4.3 INTERRUPT VECTORS

Interrupt vectors residing in MCU internal Rom are accessible as
follows.  Each vector is assigned a three byte field residing in
EVB menory map locations $0000-$0100.  This is where the monitor
program expects the MCU RAM to reside.  Each vector points to a
three byte field which is used as a jump tablr to the vector
service routine.  Table 4-1 lists the interrupt vectors adn
associated three byte field.


TABLE 4-1.  Interrupts                                                                                                                                                            t Vector Jump Table 

		INTERRUPT VECTOR                   FIELD

     Serial communications Interface (SCI)      $00C4-$00C6
     Serial Peripheral Interface (SPI)          $00C7-$00C9
     Pulse Accumulator Input Edge               $00CA-$00CC         
     Pulse Acccumulator Overflow                $00CD-$00CF
     Timer Overflow                             $00DO-$00D2
     Timer Output Compare 5                     $00D3-$00D5
     Timer Output Compare 4                     $00D6-$00D8
     Timer Output Compare 3                     $00D9-$00DB
     Timer Output Compare 2                     $00DC-$00DE
     Timer Output Compare 1                     $00DF-$00E1
     Timer Input Capture 3                      $00E2-$00E4
     Timer Input Capture 2                      $00E5-$00E7
     Timer Input Capture 1                      $00E8-$00EA
     Real Time Interrupt                        $00EB-$00ED
     IRQ                                        $00EE-$00FO
     XIRQ                                       $00F1-$00F3
     Software Interrupt (SWI)                   $00F4-$00F6
     Illegal Opcode                             $00F7-$00F9
     Computer Operating Properly (COP)          $00FA-$00FC
     Clock Monitor                              $00FD-$00FF


To use vectors specified in Table 4-1, the user must insert a
jump extended opcide in the byte field of th evector required. 
For an exmple, for the IRQ vector, the following is performed:

     a.  Place $7E (JMP) at location $00EE.

     b.  Olace IRQ service routine address at locations $00EF and
	       $00F0.

	       $00EE     7E  80  00   JMP IRQ SERVICE



CHAPTER 5 
	 
				    OPERATING INSTRUCTIONS

				    5.1  INTRODUCTION

This chapter provides the necessary information to initialze and
operate the EVB in a target system environment.  Information
consists of the control switch description, operating
limitations, command line format, monitor commands, and poerating
procedures.  The operating procedures consist of
assembly/disassembly and downloading descriptions and examples.


5.2  CONTROL SWITCH

The EVB contains a user reset switch Sl.  This switch is a
momentary action pushbutton switch that resets the EVB MCU
circuits.


5.3  LIMITATIONS

CAUTION
	  Caution should be observed when programming or erasing
	  MCU EEPROM locations.  EVB MCU configuration (CONFIG)
	  register ROMON bit is cleared to disable MCU internal
	  ROM, thereby allowing external EPROM containing the
	  BUFFALO program to control EVB operations.

The MC68HC11 MCU SCI has been set for 9600 baud using a 2 MHz E
clock external bus.  This baud rate can be chaned by software by
reprogramming the BAUD register in the ONSCI subroutine of the
BUFFALO monitor program.  Refer to Appendix B for additional
information pertainging to the ONSCI subroutine.

As the RS-232C hadnshake lines are not used, a delay of
approximately 300 milliseconds is present between successive
characters sent to teh host computer during the execution of the
LOAD command in the monitor program.

The monitor program usesethe MCU internal RAM located at $0036-
$00FF.  The controal registers are located at $1000-$103F.  Teh
monitor program also uses Output Compare 5 (OC5) for the TRACE
instrution, therefore OC5 should not be used in user routines
being traced.

The EVB allows the user to use all the features of the BUFFALO
evaluation software, however it should be noted (when designing
code) that the BUFFALO uses the MCU on-chip RAM locations $0036-
$00FF leaving only 54 bytes for the user (i.e., $0000-$0035).



5.4 OPERATING PROCEDURES

THe EVB is a simplified debugging/evaluating tool designed to
operate in either the debugging or evaluation (emulation) mode of
operation.


5.4.1 Debugging Mode

The first mode of opreation allows teh user to debug user code
under contral of th emonitor program.  User code can be assembled
in one of two methods.  THe first methos is to assemble code
using the line assembler in the BUFFALO monitor program via the
EVB usrer RAM ($C000-$DFFF).  The second method is to assemble
code on a host computer and then download the code to the EVB
user RAM via Motorola S-records.  THe monitor program is then
useedd to debug the assembled user code.  Having the monitor
program in EPROM external to the MCU ($E000-$FFFF) allows the
user to add instructions to cuxtomize teh monitor for specific
requirements.


5.4.2  Evaluation Mode

The second mode of operation allows the user to evaluate
(emulate) user code in a target system environment tilizing the
memory of the MC68HC11 MCU.  This is accomplished by relocating
the code from locations $C000-$DFFF (EVB user RAM) to $E000-$FFFF
(MCU 8k ROM).  MCU locations $0000-$00FF (RAM) and $B600-$B7FF
(EEPROM) are also available to the user.  The EVB then emulates 
an  EPROM equivalent of the masked ROM device in the single chip
mode of operation.  The EVB emulates as if in a single-chip mode
of operation, even operation. 

5.4.3 Monitor Program

The monitor BUFFALO program is the resident firmware for the EVB,
which provides a self contained operating environment.  The
monitor interacts with the user through predefined dommands that
are entered from a terminal.  The user can use any of the
commands supported by the monitor.

A standard input routine controls the EVB operation while the
user types a command line.   Command processing begins only after
the command line has been terminated by depressing the keyboard
carriage return (Return) key.5.5  COMMAND LINE FORMAT

The command line format is as follows:


     ><command> [<parameters>](RETURN)

where:

     >              EVB monitor prompt.

     <command>      Command mnemonic(single letter for most commands).

     <parameters>   Expression or address.

     (RETURN)       RETURN keyboard key - depressed to enter command.


NOTES:

  (1) The command line format is defined using special characters which
	   have the following syntactical meanings:

	       < >    Enclose syntactical variable

	       [ ]    Enclose optional fields

	       [ ]... Encolse optional fields repeated

      These characters are not entered by the used, but are for            
		  definition purposes only.

  (2) Fields are separated by any number space, comma, or tab                     
      characters.

  (3) All input numbers are interpreted as hexadecimal.

  (4) All input commands can be entered either upper or lower case         
       lettering.  All input commards are converted automatically to
       upper case lettering except for downloading commands sent to
       the host computer, or when opeating in the transparent mode.

  (5) A maximum of 35 characters may be entered on a command line.         
       After the 36th character is entered, the monitor automaticaly
       terminateds the command entry and the terminal CRT displays the
       message "Too Long".  

  (6) Command line errors may be corrected by backspacing (CTRL-H) or by
      aborting the command (CTRL-X or DELETE).

  (7) After a command has been entered, pressing (RETURN) a second time
	will repeat the command.5.6  MONITOR COMMANDS

The monitor BUFFALO program commards are listed alphabetically by
mnemonic in Table 5-1.  Each of the commands are described in detail
following the tabualr command listing.

Additional terminal keyboard functions are as follows:

	  (CTRL)A   Exit transparent mode or assembler

	  (CTRL)B   Send break command to host in transparent mode

	  (CTRL)H   Backspace

	  (CTRL)J   Line feed <1f>

	  (CTRL)W   Wait/freeze screen (Note 1)

	  (DELETE)  Abort/cancel command

	  (RETURN)  Enter command/repeat last command


NOTES:

  (1) Execution is restarted by any terminal keyboard key.

  (2) When using the control key with a specialized command such as        
       (CTRL)A, the (CTRL) key is depressed and held, then the A key
       is depressed.  Both keys are then released.

Command line unput examples in this chapter are amplified with the
following:

     Underscore entries are user-entered on the terminal keyboard.

     Command line input is entered when the keyboard (RETURN) key is
     depressed.

Typical example of this explanantion is as follows:

     >MD F000 F100                       

		TABLE 5-1.  Monitor Program Commands


	  COMMAND                            DESCRIPTION

ASM [<address>]                    Assembler/disassembler

BF <addr1> <addr2> <data>               Block fill memory with data

BR [-] [<address>]...                   Breakpoint set

BULK                                            Bulk erase EEPROM

BUKALL                                          Bulk erase EEPROM + CONFIG register

CALL [<address>]                        Execute subroutine

G [<address>]                                   Execute program

HELP                                            Display monitor commands

LOAD <host download command>    Download (S-records*) via host port

LOAD <T>                                        Download (S-records*) via terminal
						port

MD [<addr1> [<addr2>]]                  Dump memory to terminal

MM [<address>]                          Memory modify 

MOVE <addr1> <addr2> [,dest>]   Move memory to new location

P                                               Proceed/continue from breakpoint

RM[p,y,x,a,b,c,s,]                              Register modify

T [<n>]                                         Trace $1-$FF instructions

TM                                               Enter transparent mode

VERIFY <host download command>  Compare memory to download data via 
							 host port

VERIFY <T>                              Compare memory to download data via
							terminal port


 
NOTE:     *Refer to Appendix A for S-record information.







Table 5-2 lists the compatible commands that are applicable to all
revisions of the BUFFALO monitor program.  In most cases the intial
single letter of the command mnemonic or a specific symbol (shown below)
can be used.  A minimum number of characters must be entered to at least
guarantee uniqueness from other commands (i.e., MD = MOVE, ME = MEMORY).

		  TABLE 5-2, Monitor Program Compatible Commands

     
     EVB COMMAND                   COMPATIBLE COMMANDS

ASM [<ADDRESS>]                                 ASSEM

BF <addr1> <addr2> <data>                       FILL

BR [-] [<address>]...                                   BREAK

BULK                                                    BULK

BULKALL                                                 BULKA

CALL [<address>]                                        CALL

G [<address>]                                   GO

HELP                                                            HELP, ?

LOAD <host download command>                    LOAD

LOAD <T>                                                LOAD

MD [<addr1> [<addr2>]]                                  DUMP

MM [<address>]                                          MEMORY, /

MOVE <addr1> <addr2> [<dest>]                   MOVE

P                                                               PROCEED

RM [P,X,Y,A,B,C,S,]                                     REGISTER

T [<n>]                                                         TRACE

TM                                                              HOST

VERIFY  <host download command> VERIFY

VERIFY <T>                                              VERIFYASM


		 Assembler/Disassembler                  ASM

5.6.1  Assembler/Disassembler

       ASM [<address>]

where:  <address> is the starting address for the assembler operation.  
		  Assembler operation defaults to internal RAM if no 
		  address if given.

The assembler/disassembler is an interactive assembler/editor.  Each
source line is converted into the proper machine language code and is
stored in memory overwriting previous data on a line-by-line basis at
the time of entry.  In orderr to display and instruction, the machine
code is disassemble and the instruction mnenomic and operands are
displayed.  All valid opcodes are converted to assembly language
mnemonics.  All invalid opcodes are displayd on the terminal CRT as
"ILLOP".

The syntax rules for the assembler are as follows:  (a.) All numerical
values are assumed to be hexadecimal.  Therefore no base designators
(e.g., $ + hex, % + binary, etc.) are allowed.  (b.) Operands must be
swparated by one or more space or tab characters.  (c.) Any characters
after a vvalid mnemonic and associated operands are sasumed to be
comments and are ignored.  

Addressing modes are designed as follows:  (a.) Immediate addressing is
designated by preceeding the address with a # sign.  (b.) Indexed
addressing is designated by a comma.  The comma must be preceeded a one
byte relative offset (even if the offset is 00), and the comma must be
followed by an X or Y designating which inde register to use (e.g., LDAA
00,X).  (c.) Direct adn extended addressing is specified by the lenght
fo the address operand (1 or 2 digits specifies direct, 3 or 4 digits
specifies extended).  Extended addressing can be forced by padding the
address operand with leading zeros.  (d.) Relatice offsets for branch
instructions are computed by the  assembler.  Therefore the valid
operand for any branch instruction is the branch-if-true address, not
the relative offsset.

When a new source line is assembled, the assembler overwrites what was
previously in memory.  If no new source line is submitted, or if there
is an error in the source line, then the contents of meme\ory remain
unchanged.  Each of the instruction paris Arithmetic Shift Left
(ASL)/Logical Shift Left (LSL) have the same opcode, so disassembly
alwas displays the ASL mnemonic.  If the assembler tries to assemble at
an address that is not in RAM, an invalid address message "rom-xxx" is
displayed on ther terminal CRT (xxxx = invalid address.)

ASM                 Assenbler/Disassembler               ASM


Assembler/disassembler subcommands are as follows.  If the assembler
detects an error in the new source line, the assembler will output an
error message and then reopen the same address location.


     /         Assemble the current line and then disassemble the same 
	       adress location.

     ^         Assemble the current line and then disassemble the
	       previous sequential address location.


     (RETURN)  Assemble the current line and then disassemble the 
	       next opcode address.

     (CTRL)J   Assemble the current line.  If there isn't a new line to
	       assemble, then disassemble the next sequential address 
	       location.  Otherwise, disassemble the next opcode
	       address.

     (CTRL)A   Exit the assembler mode of opertion.


     EXAMPLES                      DESCRIPTION

>ASM C000                       Immediate mode addressing, requires, # before
C000 STOP $FFFF                 operand.  
     >LDAA #55
      86 55
C002 STOP $FFFF                 Direct mode addressing.
     >STAA C0
      97 C0
C004 STOP $FFFF                 Index mode, if offset = 0 (,X) will not be
     >LDS 0,X                           accepted.
     AE 00
C006 STOP $FFFF                 Branch out of range message.
     >BRA C030           

Branch out of range
C006 STOP $FFFF                 Branch offsets calculated automatically,
     >BRA C030                  address required as conditional branch operand.
     20 28               
C008 STOP $FFFF     
     >(CTRL)A                           Assembler operation terminated.

>

Refer to the end of this chapter for additional operational information
pertaining to the use of the assembler/disassembler.

BF                            Block Fill                         BF

5.6.2  Block Fill


     BF <address1> <address2> <data>

where: <address1>   Lower limit for fill operation.

      <address2>    Upper limit for fill operation.

       <data>       Fill pattern hexadecimal value.

The BF command allows the user to repeat a specific byte throughout a
determined user memory range.  If an invalid address is specified, an
invalid address is specified, an invalid address message "rom-xxxx" is
displayed on ther terminal CRT (xxxx = invalid address).

     
     EXAMPLES                      DESCRIPTION

>BF C000 C030 FF         Fill each byte of memory from C000 through C030
			 with data pattern FF.


>BF C000 C000 0          Set location C000 to 0.

BR                      Breakpoint Set                 BR

5.6.3 Breakpoint Set

     
     BR [-][<address>]...


where:  [-] by itself removes (clears) all breakpoints.


	[-] proceeding [<address.]... removes individual or multiple 
	   addresses from breakpoint table.

The BR command sets the address into the breakpint address table. 
During program execution, a halt occurs to the program execution
immediately preceding the execution of any instruction address in the
breakpint table.  A maximum of four breakpoints may be set.  After
setting the breakpoint, the current breakpoint addresses, if any, are
displayed.  Wheneer the G, CALL, or P commands are invoked, the monitor
program inserts breakpoints into the user code at the address specified
in the breakpoint table.

Breakpoints are accomplished by the placement of a software interrupt
(SWI) at each address specified in the breakpint address table.  The SWI
service routine saves and displays the internal machine state, then
restores the original opcodes at the breakpoint location before
returning control back to the monitor program.

SWI opcode cannot be executed or breakpointed in user code because the
monitor program uses the SWI vector.  Only  RAM locations can be
breakpointed.  Branch on self instructions cannot be breakpointed.


     COMMAND FORMATS                    DESCRIPTION


BR                            Display all current breakpoints.

BR  <address>                 Set breakpoint.

BR <addr1> <addr2>...         Set several breakpoints.

BR -                          Remove all breakpoints.

BR -<addr1> <addr2>...        Remove <addr1> and add <addr2>.

BR <addr1> - <addr2>...       Add <addr1>, claer all entries, then add
			      <addr2>.

BR <addr1> -<addr2>...        Add <addr1>, then remove addr2>.


BR                     Breakpoint Set                    BR


     EXAMPLES                                DESCRIPTION

>BR C003                                Set breakpoint at address location
						C003.

C003 0000 0000 0000
>

>BR C003 C005 C007 C009         Sets four breakpoints. Breakpoints at
						same address will result in only one
C003 C005 C007 C009                     breakpoint being set.
>

>BR                                             Display all current breakpoints.

C003 C005 C007 C009
>

>BR - C009                                      Remove breakpoint at addresss
						location C009.

C003 C005  C007 0000
>

>BR - C009                                      Clear breakpoint table and add C009.

 C009 0000 0000 0000
>

>BR -                                           Remove all breakpoints.

0000 0000 0000 0000
>

>BR E000                                        Only RAM locations can be
							breakpointed.

rom-E000                                        Invalid Address message.
0000 0000 0000 0000
>

>BR C005 C007 C009 C011 C013    Maximum of four brakpoints cam be
						set.

Full                                            Buffer full message.
C005 C007 C009 C011
> 

				       Bulk




5.6.4 Bulk


     Bulk


The bulk command allows the user to erase all MCU EEprom locations
($B600-$B7FF).  A delay loop is built in such that the erase time is
about 10 ms when running at 1 MHz E clock.  This command is only
applicable for A38P and A95J mask sets, and all future mask sets.



  NOTE

	  No erase verification message will be displayed upon
	  completion of the bulk EEPROM erase operation.  User
	  must verify erase operation by examing one or two EEPROM
	  locations using the MM or MD command.

	  






     EXAMPLE                                 DESCRIPTION


>BULK                           Bulk erase all MCU EEPROM locations
				($B600-$B7FF).
>                                Prompt indicates erase sequence completed.



				      Bukall

5.6.5 Buckall

     Buckall

The buckall command allows the user to erase all MCU EEPROM locations
($B600-$B7FF) including the configuration (CONFIG) register location
($103F).  A delay loop is built in such that the erase time is about 10
ms when running at 1 MHz E Clock.



				       NOTE


	  No erase verification message will be displayed upon 
	  completion of the buklkall EEPROM and configuration 
	  register erase operation.  User must verify erase 
	  operation by examing one or two EEPROM locations/configuration
	  register location using the MM or MD command.

					 
				     CAUTION

Caution should be observed when erasing MCU EEPROM locations.  EVB MCU
configuration (CONFIG) register ROMON bit is cleared to disable MCU
internal ROM, thereby allowing external EPROM containing the BUFFALO
program to control EVB operations.




     EXAMPLE                       DESCRIPTION

>BULKALL                Bulk erall all MCU EEPROM (4B600-$B7FF) and
				configuration register ($103F) locations. 
				Prompt indicates erase sequence completed.



				       Call

5.6.6 Call


     CALL [<address>]


where: <address> is the starting address where user program subroutine
	       execution begins.


The CALL command allows the user to execute a user program subroutine. 
Execution starts at the current program counter (PC) address location ,
unless a starting address is specified.  Two extra bytes are placed onto
the stack before the return from interrupt (RTI) is issued so that the
first unmatched return from subroutine (RTS) encountered will return
control back to the monitor program.  Thus any user program subroutine
can be called and executed via the monitor program.  Program execution
continues until a breakpoint encountered, or the EVB reset switch S1 is
activated (pressed).



     EXAMPLE PROGRAM CALL, G, AND P COMMAND EXAMPLES


     >ASM C000                  C006 STX $FFFF
						>NOP
     C000 STX $FFF                   01
	  >LDAA #44             C007 STX $FFFF
	  86 44                         >NOP
     C002 STX $FFFF                   01
	  >STAA C7FC            C008 STX $FFFF
	  B7 C7 FC                      >RTS
     C005 STX $FFFF                  39
	  >NOP                  C009 STX  $FFFF
	   01                      >(CTRL)A




     EXAMPLE                                 DESCRIPTION


>CALL C000                              Execute program subroutine.

P-C000 Y-DEFE X-F4FF A-44 B-FE C-D0 S-004A    Displays status of
						registers at time RTS
						encountered (except P register
						contents).

					Go

5.6.7 Go

     G [<address>]


where:  <address>  is the starting address where user program execution
(free run in real time).  The user may optionally specify a starting
address where execution is to begin.  Execution starts at the current
program counter (PC) address location, unless a startin address is
specified.  Program execution continues until a breakpoint us
encountered, or the EVB reset seitch S1 is activated (pressed).


NOTE

Refer to example program show on page 5-14 and insert breakpoints at
locations $C005 and $C007 for the following G command example.



     EXAMPLE                       DESCRIPTION

>GC000                                  Begin program execution at PC
						address location C000. 

P-C005 Y-0000-X-00CD A-44 B-FB C-DO S-004A    Breakpoint encountered at
					 C005.

				       Help
5.6.8  Help

The HELP command enables the user available EVB command information to
be displayed on ther terminal CRT for quick reference purposes.


					 
EXAMPLE

>HELP

ASM [<address>]  Line assembler/disassembler.

     /       Do same address.           ^               Do previous address.
     CTRL-J  Do next address       RETURN  Do next opcode.
     CTRL-A  Quit.
BF <addr1>  <addr2>  [>data>] Block fill
BR [-] [<addr>] Set up breakpoint table.
BULK Erase the EEPROM>        BULKALL   Erase EEPROM and
						    CONFIG>
CALL [<addr>] Call user subroutine.             G [<addr>] Execute user code.

LOAD, VERIFY <T> or <host download command>
						Load or verify S-records.
MD [<addr1>] [addr2>]] Memory dump.
MM [<addr>] Memory modify
     /     Open same address.                   CTRL-H or A Open previous addr.
     CTRL-J Open next addr.             SPACE       Open next addr.
     RETURN Quit.                               <addr>0   Compute offset to
							<addr>    
MOVE <s1> <s2> [<d>] Block move.
P Proceed/continue execution.
RM [P,Y,X,A,B,C, OR S] Register modify.
T[<n>] Trace n instuctions.
TM Transparent mode (CTRL-A = exit, CTRL B= send break).
CTRL-H Backspace.                               CTRL-W Wait for any key.
CTRL-X or DELETE Abort/cancel command.
RETURN  Repeat last command.
>

				       Load

5.6.9 Load

     LOAD      <Host download command>

     LOAD      <T>

where: <host download command>  download S-records to EVB via host port.

       <T>                      download S-records to EVB via terminal                           
			port.

The LOAD command moves (downloads) object data in S-record format (see
Appendix A) from an external host computer to EVB.  As the EVB monitor
processes only valid S-record data, it is possible for the monitor to
hang up during a load operation.  If an S-record starting address points
to and invalid memory location, the invalid address message "error addr
xxxx" is displayed on the Terminal CRT (xxxx = invalid address).


EXAMPLES                           DESCRIPTION


>LOAD cat trial.out     LOAD command entered to download data from host 
			cat trail.out computer to EVB via host port.
done
>

>LOAD cat trial.out     LOAD command entered.
			cat trial.out
error addr E000          Invalid address message.
>                               S-records must be downloaded into RAM.


Refer to the downloading procedures at the end of this chapter for
additional information pertaining to the use of the LOAD command.

				  Memor Display

5.6.10 Memory Display

     
       MD [<address1>  [<address2>]]

where: <address1>       Memory starting address (optional).

       [<address2>]     Memory ending address (optional).

The MD command allows the user to display a block of user memory
beginning at address1 and continuing to address2.  If address2 is not
entered, 9 lines of 16 bytes are displayed beginning at address1.  I
adress1 is greater than address2, the display will defualt to the first
address.  If no addresses are specified, 9 lines of 16 bytes are
displayed near the last memory location accessed.

EXAMPLES

>MD

F7D0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F7E0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F7F0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F800 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F810 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F820 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F830 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F840 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
F850 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA   ................
>

>MD C030 C020

C030  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  .................
>

>MD C000 C020

C000  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  .................
C010  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  .................
C020  FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  .................


				    Memory Modify

5.6.11 Memory Modify

      MM [<address>]

CAUTION - Caution should be observed when modifying EEPROM locations.
		EVB MCU CONFIG register ROMON bit is cleared to disable MCU         
	internal ROM.

where: <address> is the memory location at which to sart display/modify.

The MM command allows the user to examine/modify contents in user memory
at specified locations in an interactive manner.  Once entered, the MM
command has several submodes of operation that allow modification and
verification of data.  The following subcommands are recognized.

     CTRL J or (Space Bar)      Examine/modify next location.

     CTRL H or A                Examine/modify previous location.

     /                                  Examine/modify same location.

     RETURN                     Terminte MM operation.

     O                                  Compute branch instruction relative
					offset.

If an invalid address is specified, the invlid address message "rom" is
displayed on the terminall CRT>



EXAMPLES                           DESCRIPTION


>MM C700                Display memory location C700.

C700 44 66/                     Change data at C700 and reexamine location.
C700 66 55A             Change data at C700 and backup one location.
C6FF FF AA(RETURN)       Change data at C6F and terminate MM operation.

>MM C13C                 Display memory location.

C13C F7 C18E0 51     Compute offset, result = $51.
C13C F7

>MM C000                Examine location $C000.

C000 55 80 C2 00 CE C4   Examine next location(s) using (Space Bar).


					Move

5.6.12  Move

     MOVE <address1> <adddress2> [<dest>]

where: <address1>       Memory starting address.

	<address2>      Memory ending address.

	[<dest>]        Destination starting address (optional).


The MOVE command allows the user to copy/move memory to new memory
location.  If the destination is not specified, the block of data
residing from address1 to address2 will be moved up one byte.  Using the
MOVE command on EEPROM locations will program EPROM cells.

The MOVE command is useful when programming EEPROM.  As an example, a
program is created in user RAM using the assemble, debugged using the
monitor, and then programmed into EEPROM wit the MOVE command.

No messages will be displayed on the terminal CRT upon completion of the
copy/move operation, only the prompt is displayed.

				     CAUTION

Caution should be observed when moving data into EEPROM locations.  EVB
MCU CONFIG register ROMON bit is cleared to disable MCU internal ROM.


     Example                            Description


>MOVE E000 E7FF C000    Move data from locations $E000-$E7FF to 
					locations $C000-$C7FF.
>


				 Proceed/Continue

5.6.13 Proceed/Continue

     P

This command is used to procced or continue program execution without
having to remove assigned breakpoints.  This command is used to bypass
assigned breakpoints in a program executed by the G command.


NOTE

Refer to example program show on page 5-14 for the following P command
example.  Breakpoints have been inserted at locations $C005 and $C007
(refer to page 5-15).


     EXAMPLE                                 DESCRIPTION

>G C000                                         Start execution at C000.

P-C005 Y-7982 X-FF00 A-44 B-70 C-DO S-004A    Breakpoint encountered at
>P                                                      C005.  Continue execution.

P-C007 Y-7982 X-FF00 A-44 B-70 C-C0 S-004A    Breakpoint encountered at
							C007
>
 

				Register Modify

5.6.14  Register Modify

     RM [p,,x,a,b,c,s]

The RM command is used to modify the MCU program counter (P), Y index
(Y), X index (X), A acculmulator (A), B accumulator (B), C accumulator
(C), and stack pointer (S) register contents.

     EXAMPLE                            DESCRIPTION

>RM                                                     Display P register contents.
P-C00 Y-798 X-FF00 A-44 B-70 C-C0 S-0054      
P-C007 C020                                     Modify P register contents.


>

>RM X                                            Display X register contents.
P-C007 Y-7982 X-FF00 A-44 B-70 C-C0 S-0054
X-FF00 C020                                     Modify X register contents.


>

>RM                                                     Display P register contents.
P-C020 Y0DEFE X-C020 A-DF B-DE C-D0 S-0054
P-C020 (SPACE BAR)                      Display remaining registers.
Y-DEFE (SPACE BAR)
X-C020 (SPACE BAR)
A-DF (SPACE BAR)
B-DE (SPACE BAR)
C-DO (SPACE BAR)
S-0054 SPACE BAR)                       (SPACE BAR) entered following
							stack pointer display will
						terminate RM command.

5.6.15  TRACE


       T [<n>]

where: <n> is the number (in hexadecimal, $1-FF max.) of instructions to
	  execute.

The  T  command allows the user to monitor program execution on an
instruction-by-instruction basis.  The user may optionally execute
several instructions at a time by entering a count value (up to $FF). 
Execution starts at the current program counter (PC).  The PC display
with the event message is of the nest instruction to be executed.  The
trace command operates by setting the OC5 interrupt to time out after
the first cycle of the first opcode fetched.


     EXAMPLES                                DESCRIPTION

>T                                           SINGLE TRACE


Op- 86
P-C002 Y-DEFE X-FFFF A-44 B-00 C-00 S-004B
>


>T 2                                         MULTIPLE TRACE (2)

Op-B7
P-C005 Y-DEFE X-FFFF A-44 B-00 C-00 S-004B

Op-01
P-C006 Y-DEFE X-FFFF A-44 B-00 C-00 S-004B
>
				 Transparent Mode

5.6.16 Transparent Mode

     TM

The TM connects the EVB host port to the terminal port, which allow
direct communication between the terminal and the host computer.  All
I/O between the ports are ignored by the EVB until the exit character is
entered from the terminal.

The TM subcommands are as follows:

     (CTRL)A   Exit from transparent mode
     (CTRL)B   Send break to host computer.


     EXAMPLE                            DESCRIPTIION


>TM                                     Enter transparent mode.

appslab login: ED               Host computer login response.
Password: _______               Host computer password.


"System Message"


$
.
.
.
$(CTRL)A                                Task completed. Enter exit command.
>                                       Exit transparent mode.




Refer to the downloading procedures at the end of this chapter for
additional information pertaining to the use of the TM command.                                      Verify


5.6.17 Verify

     VERIFY host download command>

     VERIFY <T>

where: <host download command>          compare memory to host port download                         
					data.

       <T>                                      compare memory to terminal port download                        
					data.


The VERIFY command is similar to the LOAD command except that the VERIFY
command instructs the EVB to compare the downloaded S-record data to the
data stored in memory.


	  EXAMPLES                      DESCRIPTION


>VERIFY cat trial.out           Enter verify command.
				cat trial.out
done                                    Verification dompleted.
>


>VERIFY cat trial.out           Enter verify command.
				cat trial.out                    
Mismatch encountered.

error addr E000                         Error message displaying first byte
					address.


Refer to the downloading procedures at the end of this chapter for
additional information pertaining to the use of the LOAD commmand.





5.7 ASSEMBLY/DISASSEMBLY PROCEDURES

The aseembler/disassembler is an interactive assembler/editor.  Each
source line is converted into the proper machine language code and is
stored in memory overwriting previous data  on a line-by-line basis at
the time of entry.  in order to display an instruction, the machine code
is disassembled and the instruction mnemonic and operands are displayed.
All valid  opcodes are converted to assembly language mnmenocs.  All
invalid opcodes are displayed on teh terminal CRT as "ILLOP".

The syntax rules for the assembler are as follows: (a.) All numerical
values are assumed to be hexadecimal.  Therefore no base designators
(e,g,, $ = hex, % = binary, etc.) are allowed.   (b.0  Operands must be
separated by one or more space or tab characters.  (c.) Any characters
after a valid mnemonic and associated operands are assumed to be
comments and are ignored.

Addressing modes are designated as follows:  (a.) Immediate addressing
is designated by preceeding the address with a # sign.  (b.) Index
addressing is designated by a comma.  The comma must be preceeded a one
byte relative offset (even if the offset is 00), and the comma must be
followed by an X or Y designating which index register to use (e.g.,
LDAA 00,X).  (c.)  Direct and extending addressing is specified by the
lengh of the addres operand (1 or 2 digits specifies direct, 3 0r 4
digits specifies extended).  Extended addressing can be forced by
padding the address operand with leading zeros.  (d.) Relative offsets
for branch instructions are computed by the assembler.  Therefore the
valid operand for any branch instruction is the branch-if-true address,
not the relative offset.

Assembler/disassembler subcommands are as follows.  If the assembler
directs an error in the new source line, the assembler will output an
error message and then reopen the same address location.

     /         Assemble the current line and then disassemble the same
	       address location. 

     ^         Assemble the current line and then disassemble the
	       previous sequential address location.

     (RETURN)   Assemble the current line and then disassemble the next 
		opcode address.

     (CTRL)J    Assemble the current line.  If there isn't a new line to
		assemble, then disassemble the next sequential address
		location.  Otherwise, disassemble the next opcode
		address.

     (CTRL)A    Exit the assembler mode of operation.

When a new source line is assembles, the assembler overwrites what was
previously in memory.  If now new soucre line is submitted, or if there
is an error in the source line, then the contents of memory remain
unchanged.  Each of the instruction pairs Arithmetic Shift Left
(ASL)/Logical Sheft Left (LSL) have the same opcode, so disassembly
always displays the ASL mnemonic.  If the assembler tries to assemble at
an address that is not in RAM, an invalid address message "rom-xxx" is
displayed on the terminal CRT (xxxx = invalid address).

The following pages describe how to operate the assembler/disassembler
by creating a typical program loop, and debugging the program by the use
of the EVB monitor commands.  A typical Serical Communications Interface
(SCI) program loop is first assemble.  Routine examples are then
provided to illustrate how to perform breakpoint setting, proceeding
from breakpoint, register display and modification, and initiation of
user program execution.

A program loop (that transmits RAM data from the SCI transmitter to the
SCI receiver) is assembled as follows:

	  EXAMPLE                       PROGRAM
	  PROGRAM                       DESCRIPTION


>BF C200 C21F 00                Clear memory space.

>ASM C000                       Enter assembler/disassembler mode.

C000 CLR $0800
     >LDY #C200                         First byte where data is stored.
     18 CE C2 00                   
C004 TEST
     >LDX #C400                 Point to data to be fetched.
     CE C4 00
C007 TEST
     >LDAA 102E                 Clear RDRF bit if set.
      B6 10 2E
C00A TEST
>LDAA 0, X                      Get first data byte.
     A6, 00
C00C TEST
     >STAA 102F                 Store data in SCI data register.
     B7 10 2F
C00F INX
     >LDAA 102E                 Read SCI status register.
     B6 10 2E
C012 TEST
     >ANDA #80                  Send data byte.     

EXAMPLE  PROGRAM

     PROGRAM                            DESCRIPTION

C014 TEST
     >BEQ C00F                  Wait for empty transmit data register.
     27 F9
C016BITB $80F6
     >LDAA 102 E                Read SCI status register.
      B6 10 2E
C019 BVS $C01B           
     >ANDA #20                  Extract RDRF bit from status register.
      84 20
C01B STX $00FF
     >BEQ C016                  Branch true = SCI RDR not full.
      27 F9                             Branch false = SCI RDR full.
C01D STX  $4D65
     >LDAA 102F                 Read data from SCI RDR.
      B6 10 2F
C020 STAA $00,Y     
     >STAA O,Y                  Store data byte.
      18 A7 00
C023 STX  $00FF
     >INX                       Increment fetch pointer.           
      08
C024 TEST
     >INY                       Increment storage pointer.
      18 08
C026 ASRB
     >CPX #C41F                 Done Sending data?
      8C C4 1F
C029 ASLD
     >BEQ C02E
      27 03
C02B STX  $00FF
     >JMP C00C                  No, get next data byte.
7E C0 0C
C02E MUL
     >BRA C02E                  Yes, stop here.
C030 ILLOP
     >(CTRL)A                   Exit assembler/dissambler mode.The following routines are                                               performed on the SCI program loop use assembled:

NOTE

Connector P1 pins 20 and 21 are connected (connects SCI transmitter to
the receiver) in order to perform the following routines.

     TERMINAL                           ROUTINE
     CRT/KEYBOARD               DESCRIPTION

>RM                                     Display user machine state.
P-C000 Y-E8CC X-6FD1 A-DF B-0F C-D0 S-0054
P-C000 C000
Y-E8CC  (SPACE BAR)
X-6FD1 (SPACE BAR)
A-DF (SPACE BAR)
B-0F (SPACE BAR)
C-D0 FF
>BF C400 C41F 55                Block with $55.

>MD C400 C41F                   Verify block fill.

C400 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 UUUUUUUUUUUUUUUU
C410 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 UUUUUUUUUUUUUUUU
>BF C200 C220 00                Clear data storage area.

>BR C004 C00A C02E              Set breakpoints.

C004 C00A C02E 0000
>G C000                                 Execute program.

P-C004 Y-C200 X-6FD1 A-DF B-OF C-F9 S-004A
>P                                              Proceed thru first breakpoint.

P-C00A Y-C200 X-C400 A-C0 B-0F C-E9 S-004A
>BR C024                                Insert breakpoint.

C004 C00A C02E C024
>P

P-C024 Y-C200 X-C401 A-55 B-0F C-E1 S-004A

     TERMINAL                           ROUTINE
     CRT/KEYBOARD               DESCRIPTION

>MD C200 C210                           Display machine state after first
					loop.
C200 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 U
C210 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
>P

P-C024 Y-C201 X-C402 A-55 B-0F C-E1 S-004A
>MD C200 C210                   Display machine state after second
					loop.

C200 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UU
C210 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
>BR  -C024                              Remove breakpoint.

C004 C00A C02E 0000
>P

P-C02E Y-C21F X-C41F A-55 B-0F C-E4 S-004A
>MD C200 C210                   Display machine state after last
					breakpoint.

C200 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 UUUUUUUUUUUUUUUU
C210 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 UUUUUUUUUUUUUUUU
     

5.8 DOWNLOADING PROCEDURES

This portion of text describes the EVB downloading procedures.  The
downloading operation enable the user to transfer information from a
host computer to the EVB (or target system memory) using the LOAD
command.  The VERIFY command is used to compare the S-record data to
memory data.

Specific downloading procedures are described enabling the user to
perform downloading operations with an EXORciser, EXORset, and IBM
Personal Computer (PC) host computer systems.  EXORciser downloading
operations are accomlished utilizing the TM adn LOAD commands.   The TM
(Transport Mode) commnad connects the EVB host port to the terminal
port, which allows direct communication between the terminal and host
computer.  All I/O between the ports are ignored by the EVB until the
exit command (CTRL)A is entered from the terminal.  The LOAD command
moves data information in S-record format (see Appendix A) from an
external host computer to the EVB user RAM.

Ensure that a jumper is installed on pins 1 & 2 of the host prot RX
signal disabling header J4 during all downloading operations or when
communicating to a host computer in the transparent mode.  (Refer to
paragraph 3.2.4)

The following pages provide examples and descriptions of how to perform
EVB downloading operations in conjunction with an EXORciser, EXORset,
and IBM PC  host computer systems.5.8.1  EXORciser to EVB

To perform the EXORciser to EVB downloading procedure, perform/observe
teh following:

     EXAMPLE                            DESCRIPTION

>TM (RETURN)                    EXORciser intialized into MDOS 
					via TM command ot download 
(RETURN)                        S-records.

EXBUG09 2.1
*E MDOS (RETURN)
MDOSO9  3.05
=(CTRL)A                        Exit transparent mode.
>LOAD COPY TRIAL.LX:1,#CN     LOAD coomand entered to download
					data to EVB through host port.

>LOAD COPY TRIAL.LX:1,#CN     LOAD command entered.
COPY TRIAL.LX:1,#CN     Downloading successful.
done                                    Data transfer completed.
>

>LOAD COPY TRIAL.LX:1,#CN     LOAD command entered.
COPY TRIAL.LX:1,#CN             Downloading unsuccessful.
						Error address displayed.
error addr F800
>

>VERIFY COPY TRIAL.LX:1,#CN     VERIFY command entered.
COPY TRIAL.LX:1,#CN             Compares S-records to RAM file.
done                                            Comparison verified.
>

>VERIFY COPY TRIAL.LX:1,#CN     VERIFY command entered.
COPY TRIAL.LX:1,#CN             Verification unsuccessful.
			      Error address displayed.
error addr F800
>5.8.2 EXORset to EVB

Prior to perofrming any EXORset operation, ensure that both EXORset and
EVB baud rates are identical.  This is accomplished by excuting the
EXORset RATE command.

NOTE

EXORset to EVB interconnection is accomplished by a single RS-232C cable
assembly.  This cable is connected to the EVB terminal I/O port
connector P2 for downloading operations.

To perform the EXORset to EVB downloading procedure, perform/observe the
following:

     EXAMPLE                                 DESCRIPTION

.XCOM(RETURN)                   XCOM command entered to allow
(RETURN)                                communication with EVB.

>LOAD T                                 EVB download command (via terminal
					port) entered.
>(BREAK)                                EXORset BREAK/ABORT key or RESET
					switch exits XCOM command.
ABORTED AT
L-XXXX S-XXXX U-XXXX Y-XXXX X-XXXX DP-XX B-XX A-XX C-XX
.

.XDOS                                   XDOS command entered.
XDOS 4.13

DRV. 0-3
S.S. MODE : 16 SCT/CYL, 640 USABLE SCT.
D.S. MODE : 32 SCT/CYL, 1280 USABLE SCT.

DRV. 4-7
S.S  MODE : 26 SCT/CYL, 2000 USABLE SCT.
D.S. MODE : 52 SCT/CYL, 4004 USABLE SCT.
= TRANSFER                      TRANSFER command entered.

     EXAMPLE                            DESCRIPTION

EXIRset '.LX' FILE TRANSFER UNTILITY REV 0.0
COPYWRIGHT 1982 MOTOROLA INC.

ENTER TRANSFER DIRECTION (I/0):0
ENTER NAME OF FILE TO BE TRANSFERRED: TRIAL.LX:1

ENTER 'COMMAND LINE' TO SEND VIA SERIAL PORT
PRESS 'CONTROL AND P' KEYS TO RETURN TO XDOS

PRESS 'CONTROL AND B' KEYS TO SEND THE FILE

(CTRL)B                                 (CTRL)B starts data transfer.

END OF TRANSER
= (BREAK)                       BREAK/ABORT key returns control
						to XCOM.
ABORTED AT
L-XXXX S-XXXX U-XXXX Y-XXXX X-XXXX DP-XX B-XX A-XX C-XX
.XCOM                           Issue EVB reset prior to XCOM
						entry.  Returned to debug mode.  5.8.3 IBM to EVB

Prior to perofrming any IBM PC operation, ensure that both IBM PC and
EVB baud rates are identical.

				       NOTE

IBM PC to EVB interconnection is accomplished by a single RS-232C cable
assembly.  This cable is connected to the EVB terminal I/O port
connector P2 for downloading operations.

To perform the IBM PC to EVB downloading procedure, perform/observe the
following:

     EXAMPLE                            DESCRIPTION

C>KERMIT                                IBM PC prompt.  Enter KERMIT 
IBM-PC Kermit-MS VX.XX             program.
Type ? for help

Kermit-MS>SET BAUD 9600            Set IBM PC baud rate.
Kermit-MS>-CONNECT                      Connect IBM PC to EVB.

[Connecting to host, type Control-] C to return to PC]


(RETURN)                           
>LOAD T                                 EVB download command (via terminal
					port) entered.

(CTRL)]C
Kermit-MS>PUSH

The IBM Personal Computer DOS
Version X.XX (C)Copyright IBM Corp 1981, 1982, 1983

C>TYPE (File Name) > COM1       Motorola S-record file name.

C>EXIT                                          S-record downloading completed.

Kermit-MS>CONNECT                       Return to monitor BUFFALO program.

>(CTRL)]C
Kermit-MS>EXIT                          Exit Kermit program. 


				    APPENDIX A

			       S-RECORD INFORMATION

INTRODUCTION

The Motorola S-record format was devised for the purpose of encoding
programs or data files in a printable format for transportation between
computer systems.  This transportation process can therefore be
monitored and the S-records can be easily edited.

S-RECORD CONTENT

When observed, S-records are essentially character strings made of
several fields which identify the record typer, record length, memory
address, code/data, and checksum.  Each byte of binary data is encoded
as a 2-charactrer hexadecimal number: the first character representing
the high-order 4 bits, and the second the low-order 4 bits of the byte.

Five fields which compromise an S-record are shown below:


TYPE      RECORD LENGTH       ADDRESS   CODE/DATA      CHECKSUM
where the fields are composed as follows:

	       PRINTABLE
FIELD          CHARACTERS                    CONTENTS

Type                    2                       S-record type - S0, S1, etc.

Record                  2               Character pair count in the record,
length                                  excluding the type and record length.

Address         4,6,            2-, 3-, or 4-byte address at which 
			or 8            the data field is to be loaded into                    
					memory.

Code/data       0-2n            From 0 to n bytes of executable code,
					memory loadable data, or descriptive
					information.  Tor compatibility with
						teletypewriters, some programs may
					limit thenumber of bytes to as few as
					28 (56 printable characters in the S-
					record.

Checksum            2           Least significant byte of the one's
					complement of the sum of the values
					represented by the pairs of
					characters making up the record
						 length, address, and the code/data
					fields.

Each record may be terminated with a CR/LF/NULL.  Additionally, an S-
record may have an initial field to accommodate other data such as line
numbers generated by some time-sharing systems.

Accuracy of transmission is ensured by the record length (byte count)
and checksum fields.

S-RECORD TYPES

Eight types of S-records have been defined to accomodate the several
needs of the encoding, transportation, and decoding functions.  The
various Motorola upload, download, and other record transportation
control programs, as well as cross assemblers, linkers, and other file-
creating or debugging programs, utilize only those S-records which serve
the purpose of the program.  for specific information on which S-records
are supported by a particula program, the user manual for that program
must be consulted.

				       NOTE

The EVB monitor supports only the S1 and S9 records.  All data before
the first S1 record is ignored.  Thereafter, all records must be S1 type
until the S9 record terminates data transfer.


An S-record format may contain the following record types:

     S0         Header record for each block of S-records.  The code/data
		field may contain any descriptive information identifying
		the following block of S-records.  The address field is
		normally zeroes.

     S1         Code/data reocrd and the 2-byte address at which the
		code/data is to reside.

     S2-S8      Termination record for a block of S1 records.  Address
		fields may optionally contain the 2-byte address of the
		instruction to which control is to be passed.  If not
		specified, the first entry point specification
		encountered in the input will be used.  There is no
		code/data field.

Only one termination record is used for each block of S-records. 
Normally, only one header record is used, although it is possible for
multiple header records to occur.

S-RECORD CREATION

S-record format programs ma be producd by several dump utilities,
debuggers, or several cross assemblers or cross linkers.  Several
programs are available for downloading a file in S-record format from a
host system to an 8-bit or 16-bit microporcessor-based system.

S-RECORD EXAMPLE

Shown below is a typical S-record format, as printed or displayed:


	  S00600004844521
	  S1130000285F245F2212226A000424290008237C2A
	  S11300100002000800082629001853812341001813
	  S113002041E900084E42234300182342000824A952
	  S107003000144ED492
	  S9030000FC

The above format consists of an S0 header record, four S1 code/data
records, and an S9 termination record.

The S0 header record is comprised of the following character pairs:

     S0   S-record type S0, indicating a header record.

     06   Hexadecimal 06 (deicmal 06), indicating six character pairs
	  (or ASCII bytes) follow.

     00   Four-character 2-byte address field, zeroes.
     00

     48
     44   ASCII H, D, and R - "HDR".    
     52

     1B   Checksum of SO record.

The first S1 code/data record is explained as follows:


     S1   S-record type S1, indicating a code/data record to be
		loaded/verified at a 2-byte address.

     13   Hexadecimal 13 (decimal 19), indicating 19 character pairs,
		 representing 19 bytes of binary data, follow.

     00   Four-character 2-byte address field; hexadecimal address 0000,
		 indicates location where the following data is to be loaded.     

The next 16 character pairs are the ASCII bytes of the actual program
code/data.  In this assembly language example, the hexadecimal opcodes
of the program are written in sequence in the code/data fields of the S1
records;

     OPCODE              INSTRUCTION

28 5F                           BHCC  $0161
24 5F                           BCC   $0163
22 12                           BHI   $0118
22 6A                           BHI   $0172
00 04 24                        BRSET 0,$04,$012F
29 00                           BHCS  $010D
08 23 7C                        BRSET 4,$23,$018C

.    (Balance of this code is continued in the code/data fields 
.    of the reamaining S1 records, and stored in memory location 
.    0010, etc..)

2A   Checksum of the first S1 record.

The second and third S1 code/data records each also contain $13 (19)
character pairs and are ended with checksums 13 and 51, respectively. 
The fourth S1 code/data record contains 07 character paris and has a
checksum of 92.

The S9 termination record is explained as follows:

     S9         S-record type S9, indicating a termination record.

     03         Hexadecimal 03, indicating three character pairs (3 bytes)
			follow.

     00         Four-character 2-byte address field, zeroes.
     00

     FC         Checksum of S9 record.

Each printable character in an S-record is encoded in hexadecimal (ASCII
in this example) representation of the binary bits which are actually
transmitted.  For example, the first S1 reocrd above is sent as shown
below.


  type         length         address        code/data      checksum

 S     1       1      3     0  0   0   0      2   8     5   F     2  A

5 3  3 1     31      33    3 0 3 0 3 0 3 0   3 2 3 8 3 5 4 6  3 2 4 1

0101 0011 0011 0001  0011 0001 0011 0011 0011 0000 0011 0000 0011 0000
0011 0000 0011 0010 0011 1000 0011 0101 0100 0110 *** 011 0010 0100 0001







			TEXT MESSAGES
	What?
	Too Long
	Full
	Op-  
	rom-
	Command?
	Bad Argument
	No host port available
	done
	checksum error
	error addr


		ERROR MESSAGES FOR ASSEMBLER

	Immediate mode illegal
	Error in mnemonic table
	Illegal bit op
	Bad argument
	Mnemonic not found
	Unknown addressing mode
	Indexed addressing assumed
	Syntax error
	Branch out of range
     
