EasyManua.ls Logo

Intel i960 - Page 275

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
i960 Processor Compiler User's Guide
7-86
7
* Send a breakpoint IAC to the processor. The
* address is supplied by the routine that calls
* set_bp. Do not forget to enable breakpoints in the
* trace control. Fields 1, 2, and 5 are not used.
*/
void set_bp(unsigned int addr1, unsigned int addr2)
{
iac_struct.message_type = 0x8f;
iac_struct.field3 = addr1;
iac_struct.field4 = addr2;
send_iac(&iac_struct);
}
In this example, the first line (asm void send_iac(struct message
*base_msg)
) declares that the function does not return a value and the
base_msg argument is a pointer to a structure of type message.
The second and eighth lines contain braces. These lines begin and end the
function definition, which contains two expansion definitions.
The third line is a control line containing three parameter declarations, as
follows:
%void return; reglit base_msg; tmpreg myreg; spillall;
The void return; declares that no value is returned by this asm function.
The
reglit base_msg; declares that the base_msg parameter matches
either a literal or a register argument. The
tmpreg myreg; declares that
the
myreg local variable is a temporary register. The spillall control
informs the optimizer that this template references memory.
The fourth and fifth lines load the IAC address into a temporary register
and issue an IAC message.
The sixth line is a control line containing the
error control and the
seventh line is the text of the
error message.
If the compiler cannot coerce the call arguments into the previous
expansion definition (the declarations in the third line), the compiler
displays the following error message and aborts the compilation:
Incorrect C call to send_iac

Table of Contents

Related product manuals