Introduction to BUFFALO Command

The monitor BUFFALO program is the resident firmware for the EVB, which provides a self-contained operating environment. It interacts with the user through predefined commands. The BUFFALO command line format is as follows:

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

where:

> EVB monitor prompt.

<command> Command mnemonic.

<parameters> Expression or address.

(RETURN) RETURN keyboard key

NOTES:

  1. The command line format is defined using special characters that have the following syntactical meanings:
    < > Enclose syntactical variable
    [ ] Enclose optional fields
    [ ]... Enclose optional fields repeated
    These characters are NOT entered by user, but are for definition purpose only.
  2. Fields are separated by any number or 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.
  5. A maximum of 35 characters may be entered on a command line.
  6. Command line errors may be corrected by backspacing or by aborting the command (CRTL-X/Delete).
  7. After a command has been entered, pressing (RETURN) a 2nd time will repeat the command.

Some of the frequently used BUFFALO commands are listed alphabetically in Table 1.

CAMMAND

DESCRIPTION

ASM [<address>]

Assembler/disassembler

BF <address1> <address2> <data>

Block fill memory with data

CALL [<address>]

Execute subroutine

G [<address>]

Execute program

HELP

Display monitor commands

MD [<address1> [<address2>]]

Memory Display

MM [<address>]

Memory Modify

MOVE <address1> <address2> [<destination>]

Move memory to new location

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

Register modify

T [<n>]

Trace $1~$ff instructions

Next few pages are detailed description and examples for each command.

ASM

Assembler/Disassembler

ASM [<address>]

where: <address> is the starting address for the assembler operation.

Assembler operation defaults to internal RAM if no address is given. 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.

The syntax rules for the assembler are as follows:

  1. All numerical values are assumed to be hexadecimal.
  2. Operands must be separated by one or more space or tab characters.

Addressing modes are designated as follows:

  1. Immediate addressing is designated by pre-ceeding the address with a # sign.
  2. Indexed addressing is designated by a comma. The comma must be preceeded a one byte relative offset and followed by an X or Y designating which index register to use (e.g., LDAA 00,X).
  3. Direct and extended addressing is specified by the length of 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.
  4. 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.

/

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.

EXAMPLE

DESCRIPTION

>ASM C000

C000 STOP $FFFF

>LDAA #55

86 55

C002 STOP $FFFF

>STAA C0

97 C0

C004 STOP $FFFF

>LDS 0,X

AE 00

C006 STOP $FFFF

>BRA C500

 

Immediate mode addressing, requires # before operand.

Direct mode addressing.

Index mode, if offset = 0 (,X) will not be accepted.

 

Branch out of range message.

Branch out of range C006 STOP $FFFF

>BRA C030

20 28

C008 STOP $FFFF >(CTRL)A

Branch offsets calculated automatically, address required as conditional branch operand.

Assembler operation terminated.

 

EXAMPLE

DESCRIPTION

>ASM C000

C000 CLR $0800

>LDY #C200

18 CE C2 00

C004 TEST

>LDX #C400

CE C4 00

C007 TEST

>LDAA 102E

B6 10 2E

C00A TEST

>LDAA 0,X

A6 00

C00C TEST

>STAA 102F

B7 10 2F

C00F INX

>LDAA 102E

B6 10 2E

C012 TEST

>ANDA #80

84 80

C014 TEST

>BEQ C00F

27 F9

C016 BITB $80F6

>LDAA 102E

B6 10 2E

C019 BVS $C01B

>ANDA #20

84 20

C01B STX $00FF

>BEQ C016

27 F9

C010 STX $4065

>LDAA 102F

B6 10 2F

C020 STAA $00,Y

>STAA 0,Y

18 A7 00

C023 STX $00FF

>INX

08

C024 TEST

>INY

18 08

C026 ASRB

>CPX #C41F

8C C4 1F

C029 ASLD

>BEQ C02E

27 03

C02B STX SOOFF

>JMP C00C

7E C0 0C

C02E MUL

>BRA C02E

20 FE

C030 ILLOP

>(CTRL)A

Enter assembler/disassembler mode.

First byte where data is stored.

IMM mode

Point to data to be fetched.

IMM mode

Clear RDRF bit if set.

EXT mode

Get f1rst data byte.

INX mode

Store data in SCI data register.

EXT mode

Read SCI status register.

EXT mode

Send data byte.

IMM mode

Wait for empty transmit data register.

REL mode

Read SCI status register.

EXT mode

Extract RDRF bit fram status register.

IMM mode

Branch true = SCI RDR not fu11.

Branch false = SCL RDR fu11.

REL mode

Read data from SCI RDR.

EXT mode

Store data byte.

INY mode

Increment fetch pointer.

INH mode

Increment storage pointer.

INH mode

Done sending data?

IMM mode

 

 

 

No, get next data byte.

EXT mode

Yes, stop here.

REL mode

Exit assembler/dissembler mode.

BF

Block Fill

BF <address1> <address2> <data>

where:

<address1> Lower limit for fill operation.

<address2> Upper limit for fill operation.

<data> Fill pattern hexadecimal value.

EXAMPLE

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.

 

CALL

Execute Subroutine

CALL [<address>]

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

 

EXAMPLE

DESCRIPTION

>CALL C000

Execute program subroutine.

P-COOO Y-DEFE X-F4FF A-44 B-FE C-DO 5-004A

Displays status of registers at time RTS encountered (except P register contents).

 

G(GO)

Execute Program

G [<address>]

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

 

EXAMPLE

DESCRIPTION

>G C000

Execute program subroutine.

P-COOO Y-DEFE X-F4FF A-44 B-FE C-DO 5-004A

Displays status of registers at time RTS encountered (except P register contents).

 

HELP

Help Screen

HELP

Display monitor commands

 

MD

Memory Display

MD [<address1> <address2>]

Display a block of user memory beginning at address 1 and continuing to address 2.

EXAMPLE

>MD C000 C00F

C000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

 

MM

Memory Modify

MM [<address>]

Examine/Modify contents in user memory at specified address in an interactive manner

 

EXAMPLE

DESCRIPTION

>MM C700

Display memory location C700.

C700 44 66(RETURN)

Change data at C700

>MM C000

C000 55 80 C2 00 CE C4

Examine location $C000.

Examine next 1ocation(s) using (SPACE BAR).

 

MOVE

Block Move

MOVE <addressl> <address2>) [<dest>]

where: <address1> Memory starting address.

<address2> Memory ending address.

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

Copy/move memory to new memory location. If the destination is not specified, the block of data residing from addressl to address2 will be moved up one byte.

 

EXAMPLE

DESCRIPTION

>MOVE E000 E7FF C000

Move data from locations $E000-$E7FF to

locations $C00D-$C7FF.

>MOVE C000 C0FF

Move data from locations $C000-$C0FF to

locations $C001-$C100.

RM

Register Modify

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

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

EXAMPLE

DESCRIPTION

>RM

P-C007 Y-7982 X-FF00 A-44 B-70 C-C0 S-0054

P-C007 C020

Display P register contents.

Modify P register contents.

>RM X

P-C007 Y-7982 X-FF00 A-44 B-70 C-C0 S-0054

X-FFOO C020

Display X register contents.

Modify X register contents.

 

T

Trace

T[<n>]

Where: <n> is the number ($1~$FF) of instructions to execute.

Monitor program execution on an instruction-by-instruction basis. Execution starts at the current program counter (PC).

EXAMPLE

DESCRIPTION

>T

Op-86

P-C002 Y-DEFE X-FFFF A-44 B-00 C-00 S-0048

Single trace

Register contents after execution.

>T2

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

Multiple trace (2)