
2-40
M5407C3 User’s Manual
TRAP #15 Functions
Assembly example:
move.l
#$0010,d0
Select the function
trap
#15
Make the call, the input character is in d1.
C example:
int board_in_char (void)
{
asm (“ move.l#0x0010,d0”);
/* select the function */
asm (“ trap#15”);
/* make the call */
asm (“ move.ld1,d0”);
/* put the character in d0 */
}
2.5.3 CHAR_PRESENT
This function (function code 0x0014) checks if an input character is present to receive. A
value of zero is returned in D0 when no character is present. A non-zero value in D0 means
a character is present.
Assembly example:
move.l
#$0014,d0
Select the function
trap
#15
Make the call, d0 contains the response (yes/no).
C example:
int board_char_present (void)
{
asm (“ move.l#0x0014,d0”);
/* select the function */
asm (“ trap#15”);
/* make the call */
}
2.5.4 EXIT_TO_dBUG
This function (function code 0x0000) transfers the control back to the dBUG, by
terminating the user code. The register context are preserved.
Assembly example:
move.l
#$0000,d0
Select the function
trap
#15
Make the call, exit to dBUG.
C example:
void board_exit_to_dbug (void)
{
asm (“ move.l#0x0000,d0”);
/* select the function */
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
n
c
.
..