
D-4
DINK32 PowerPC ISA Debugger User’s Manual
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
Using the Dynamic Functions
To use any of these functions in user code, define the user code function name to be the dink
function name. For example, to link the user code printf to the DINK32 printf function,
#define printf dink_printf, to link the user code put_char to DINK32 write_char, #define
put_char writechar. See the directories demo and dhrystone for examples of setting up these
#define statements. See the directory memspeed for an example of how to use dynamic
global variables.
D.4
Using the Dynamic Functions
Using these functions is implemented via the assembly language file, dinkusr.s, and the
include file dinkusr.h. The user #includes dinkusr.h and links in dinkusr.s during
compilation/link time. All of the functions in this table except set_up_transfer_base,
transfer control to the DINK32 function while leaving the link register, lr, unchanged. This
effectively transfers control to the DINK32 function and the DINK32 function on
completion returns directly to the caller in the user’s code. The functions supplied in
dinkusr.s are shown in Table D-2.
Table D-2. dinkusr.s Functions
Function Name
Function Definition
set_up_transfer_base
Capture the dink_transfer_table address from r21 and store it into a local
memory cell for future use. You must call this function before using any
of the functions below, and it should be called immediately after entry,
such as the first statement in main().
dink_printf
DINK32 entry into printf.
dink_loop
DINK32 idle loop
is_char_in_duart
DINK32 function to detect if duart has a new character.
shell_help
DINK32 display menu function.
par_about
DINK32 display about function.
disassemble
DINK32 disassemble instruction
get_KEYBOARD
Return address of keyboard com port
dink_get_char
DINK32 get next character from the duart buffer, essentially the
keyboard for the user. This function requires the KEYBOARD value,
obtained from get_KEYBOARD, as an argument. See G.6 example
program _getcannon for an example of the correct way to obtain this
value.
dink_put_char
DINK32 put character to the output buffer.
get_memSpeed
returns the integer value of memSpeed
example:
int val;
val=get_memSpeed();
get_process_type
returns the character value of process_type
example:
char type;
type=get_process_type();
F
n
.