chiark / gitweb /
fix comments
[trains.git] / hostside / skelproto-pic.c
1 /* @skeleton@ @1@ @L@ */
2 /*
3  * definitions of
4  *  enco_pic_WHATEVER
5  *  on_pic_WHATEVER
6  * and the tables
7  * and related functions
8  */
9
10 #include "hostside.h"
11 #include "auproto-pic.h"
12
13 extern void enco_pic_anyinsn(PicInsn *out, const PicInsnInfo *pii,
14                              int objnum) {
15   unsigned long as= objnum;
16   int i;
17
18   out->l= 1 + pii->argbits/7;
19   for (i= out->l - 1;
20        i >= 0;
21        i--, as >>= 7)
22     out->d[i]= (as & 0x07fUL) | 0x080UL;
23   out->d[out->l - 1] &= ~0x080UL;
24   out->d[0] |= pii->opcode;
25 }
26
27 const PicInsnInfo pic_command_infos[]= {
28   { "@cnameyn@", @opcodeyn@, @arglen@ }, @h2p@
29   { 0 }
30 };
31
32 const PicInsnInfo pic_reply_infos[]= {
33   { "@cnameyn@", @opcodeyn@, @arglen@ }, @p2h@
34   { 0 }
35 };