Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8xC196EA microcontroller user's manual.1998.pdf
Скачиваний:
52
Добавлен:
23.08.2013
Размер:
8.29 Mб
Скачать

USING THE TEST-ROM ROUTINES

17.7 RISM COMMAND DESCRIPTIONS

Table 17-7 lists and describes all the RISM commands for both the serial port mode and SDU RISM execution routines, along with their associated opcodes. Some of the RISM commands listed in Table 17-7 are SDU RISM only and some are serial port RISM only. Also, the RISM commands that are shared between the SDU and serial port do not share the same opcode values.

 

 

Table 17-7. RISM Commands

 

Serial

 

 

 

Command

Port

 

SDU

Description

RISM

 

RISM

 

 

 

 

Opcode

 

Opcode

 

 

 

 

 

 

SET_DLE_FLAG

00H

 

Sets the DLE (data latch enable) flag in bit 0 of the MODE

 

 

 

 

register (57H) to tell the RISM that the next byte on the

 

 

 

 

serial port is data that should be loaded into the DATA

 

 

 

 

register (58H). The flag is cleared as soon as the byte is

 

 

 

 

read.

 

 

 

 

 

RISM_IDLE

 

00H

The RISM routine halts and enters a loop waiting for

 

 

 

 

another interrupt.

 

 

 

 

 

TRANSMIT

02H

 

Transmits the low byte of the DATA register to the serial

 

 

 

 

port through the CHAR register, shifts the DATA register

 

 

 

 

right (long) by eight bits, and increments ADDR by one.

 

 

 

 

 

READ_BYTE

04H

 

01H

Reads the byte contents of the memory address pointed

 

 

 

 

to by the RISM_ADDR register and puts it into the low

 

 

 

 

byte of the DATA register (location 403H in SDU RISM

 

 

 

 

execution). The shadow address register, located in

 

 

 

 

register RAM, is loaded with RISM_ADDR + 1.

 

 

 

 

 

READ_WORD

05H

 

02H

Reads the word contents of the memory address pointed

 

 

 

 

to by the RISM_ADDR register and puts it into the low

 

 

 

 

word of the DATA register (locations 402–403H in SDU

 

 

 

 

RISM execution). The shadow address register, located

 

 

 

 

in register RAM, is loaded with RISM_ADDR + 2.

 

 

 

 

 

WRITE_BYTE

07H

 

03H

Stores the byte contents of the RISM_DATA register in

 

 

 

 

the memory address pointed to by the shadow address

 

 

 

 

register and increments the shadow address register by

 

 

 

 

one.

 

 

 

 

 

WRITE_WORD

08H

 

04H

Stores the word contents of the RISM_DATA register in

 

 

 

 

the memory address pointed to by the shadow address

 

 

 

 

register and increments the shadow address register by

 

 

 

 

two.

 

 

 

 

 

DATA_TO_ADDR

0AH

 

Puts the low word of the DATA register into the ADDR

 

 

 

 

register.

 

 

 

 

 

GO

12H

 

05H

Starts execution at location pointed to by register RAM

 

 

 

 

address 60H.

 

 

 

 

 

HALT

13H

 

06H

Stops execution and returns to the Monitor_Pause state

 

 

 

 

(RISM_IDLE state in SDU RISM execution).

 

 

 

 

— indicates the RISM command is not available

 

17-15

8XC196EA USER’S MANUAL

Table 17-7. RISM Commands (Continued)

 

Serial

 

 

 

Command

Port

SDU

 

Description

RISM

RISM

 

 

 

 

 

Opcode

Opcode

 

 

 

 

 

 

READ_NEXT_BYTE

11H

Reads the byte contents of the next memory address

 

 

 

pointed to by the shadow address register and

 

 

 

increments by one.

 

 

 

 

READ_NEXT_WORD

12H

Reads the word contents of the next memory address

 

 

 

pointed to by the shadow address register and

 

 

 

increments by two.

 

 

 

 

WRITE_NEXT_BYTE

13H

Stores the byte contents of the next memory address

 

 

 

pointed to by the shadow address register and

 

 

 

increments by one.

 

 

 

 

WRITE_NEXT_WORD

14H

Stores the word contents of the next memory address

 

 

 

pointed to by the shadow address register and

 

 

 

increments by two.

 

 

 

 

REPORT_STATUS

14H

Loads a value into the DATA register. This value indicates

 

 

 

the status of your program:

 

 

 

Value

Status

 

 

 

00

data latched

 

 

 

01

trapped

 

 

 

02

running

 

 

 

 

 

— indicates the RISM command is not available

17.8 EXECUTING PROGRAMS FROM REGISTER RAM

For those wanting to execute user programs from register RAM while in either serial port mode or SDU RISM execution, the RISM allows you to initialize the user program counter (UPC and UPC2), user processor status word (UPSW), and user window selection register (UWSR). Table 17-8 lists the registers and the register RAM addresses to which you may write new values.

Table 17-8. User Program Register and Register RAM Location

User Program Register

Register RAM Address

 

 

Shadow Address

5CH

 

 

UPC

60H

 

 

UPC2

62H

 

 

UPSW

64H

 

 

UWSR

66H

 

 

Before attempting to execute a program from RAM, write the beginning address of the program to UPC and UPC2 at the addresses shown in Table 17-8. You need not change the UWSR and UPSW unless other flags need to be set for the program you are executing. After writing the UPC and UPC2 values, issue the GO command, which automatically initializes the UPC and begins code execution (refer to “SDU RISM Execution Go Command Example” on page 17-20). When

17-16

Соседние файлы в предмете Электротехника