Language Implementation
7-85
7
Compiling this program produces assembly language similar to the
following:
_main:
ld 0xFE00FF00 , g4; #first template
L5:
ld 0xFE00FF00 , g4; #second template
bbc 0,g4,L5
callj _service_device
b L5
IAC Breakpoint.
The following example shows an asm block that sends an
inter-agent communication (IAC) breakpoint to the processor. For
information on the IAC structure, see the i960 KB processor manual.
struct message {
unsigned short field2;
unsigned char field1;
unsigned char message_type;
unsigned int field3;
unsigned int field4;
unsigned int field5;
} iac_struct;
/*
* This routine issues an IAC message to the local
* processor where the program resides. It accepts
* a pointer to a preformed IAC message as input and
* uses the synmovq instruction to send the IAC to the
* processor.
*/
asm void send_iac(struct message *base_msg)
{
%void return; reglit base_msg; tmpreg myreg; spillall;
lda 0xff000010, myreg /* load local IAC address */
synmovq myreg, base_msg /* issue IAC message */
%error;
Incorrect C call to send_iac
}
/*