Epson S5U1C17001C Manual page 537

Cmos 16-bit single chip microcomputer, c compiler package for s1c17 family
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

c17 call
(call user function)
Operation
Calls a user function.
However, an assembler entry program is required.
Format
c17 call Function [ Arg1 [ Arg2 [ Arg3 ]]]
The function to be called (function name or decimal/ hexadecimal start address)
Function:
Arg1–3:
Argument (decimal, hexadecimal, or symbol)
Conditions: Up to three arguments can be specified.
Usage example
(gdb) c17 callmd 1
(gdb) c17 call print_data 1 2 3
arg1=1, arg2=2, arg3=3
The function print_data() is called after specifying three arguments.
User function and entry routine
When c17 call is invoked, gdb executes a specified user function and receives a return value from %r0.
If the return value is -1 (0xffffff), gdb terminates the session without performing anything. When the value
received is other than that, gdb interprets it as the start address of a packet passed from the function and
displays internal data of the packet in the [Console] window or directly writes it to a file in its original form.
The c17 callmd command specifies the output destination. The default output destination is the [Console]
window.
The following shows the configuration of the packet returned by a user function.
data size (4 bytes) data ...
A packet must always start from a 4-byte boundary. A user function must set the start address of this packet in
%r0. If packets cannot be returned, the user function should set -1 in %r0.
The following shows an example of a user function to be called.
The user function must always end with "jpa %r1".
Example entry program (assembler)
#define
SP_INI
0x0800
jpa
;
****28 - ****3f DSIO command area, 24byte
;
;
;
;
;
;
;
;
;
;
; input
;
%r0 : debug ram start address = ****28
;
%r1 : return address( mini Monitor )
; output
;
;
;
<message format>
;
size
;
message : String data
;
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
(Execution result)
; sp is in end of 1KB internal RAM
%r1
; back to mini monitor
****28
WBUF data1
****2c
WBUF data2
****32
RBUF ID
****33
RBUF size
****34
RBUF addr
****38
RBUF data1
****3c
RBUF data2
****28 WBUF data1 : gdb output message start address
: message size (4 byte)
EPSOn
[ICD Mini / SIM]
DSIO output command
DSIO input command
10 DEBUggEr
10
Debugger
10-87

Advertisement

Table of Contents
loading

Table of Contents