System Call Functions; Out_Char; In_Char - Motorola MPC564EVB User Manual

Hide thumbs Also See for MPC564EVB:
Table of Contents

Advertisement

3.5 System Call Functions

An additional utility within the dBUG firmware is a function called the System Call handler. This
function can be called by the user program to utilize various routines within dBUG, to perform a
special task, and to return control to dBUG. This section describes the System Call handler and
how it is used.
There are 6 System Call functions. These are: OUT_CHAR, IN_CHAR, IN_STAT,
ISR_REGISTER, ISR_REMOVE and EXIT_TO_dBUG. The system call interface accepts an
opcode in r10 to indicate which operation is to be performed. Various results are returned, usually
in r3. When these routines are invoked, the following is true: sprg0 contains r31 and sprg1 contains
LR.

3.5.1 OUT_CHAR

This function (function code 0x0020) sends a character, which is in r3, to terminal. The system call
interface accepts an opcode in r10 to indicate which operation is to be performed.
Assembly example:
/* assume r3 contains the character */
addi r10, r0, 0x0020
sc
C example:
/* assume r3 contains the character */
void board_out_char (int ch)
{
asm("
asm("
}

3.5.2 IN_CHAR

This function (function code 0x0000) returns an input character (from terminal) to the caller. The
returned character is in r3.
Assembly example:
/* the character is returned to the user in r3*/
addi r10, r0, 0x0000
sc
C example:
int board_in_char (void)
Selects the function
The character in r3 is sent to terminal
addi r10, r0, 0x0020"); Selects the function
sc");
Selects the function
The character is returned in r3
Chapter 3. Using the Monitor/Debug Firmware
The character in r3 is sent to terminal
System Call Functions
3-39

Advertisement

Table of Contents
loading

Table of Contents