"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_X+(ARG_RS),},
{CLASS_BIT+6,CLASS_BIT+0,CLASS_REGN0+(ARG_RS),CLASS_REG+(ARG_RD),CLASS_ADDRESS+(ARG_SRC),0,0,0,0,},2,4,74},
-/* 0010 0000 0000 dddd imm8 imm8 *** ldb rbd,imm8 */
+/* 1100 dddd imm8 *** ldb rbd,imm8 */
{
#ifdef NICENAMES
-"ldb rbd,imm8",8,7,0x00,
+"ldb rbd,imm8",8,5,0x00,
#endif
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),},
- {CLASS_BIT+2,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,74},
+ {CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},2,2,74},
-/* 1100 dddd imm8 *** ldb rbd,imm8 */
+/* 0010 0000 0000 dddd imm8 imm8 *** ldb rbd,imm8 */
{
#ifdef NICENAMES
-"ldb rbd,imm8",8,5,0x00,
+"ldb rbd,imm8",8,7,0x00,
#endif
"ldb",OPC_ldb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_IMM+(ARG_IMM8),},
- {CLASS_BIT+0xc,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),0,0,0,0,0,0,},2,2,74},
+ {CLASS_BIT+2,CLASS_BIT+0,CLASS_BIT+0,CLASS_REG+(ARG_RD),CLASS_IMM+(ARG_IMM8),CLASS_IMM+(ARG_IMM8),0,0,0,},2,4,74},
/* 1010 0000 ssss dddd *** ldb rbd,rbs */
{
/* 1000 1000 ssss dddd *** xorb rbd,rbs */
{
#ifdef NICENAMES
-"xorb rbd,rbs",8,4,0x01,
+"xorb rbd,rbs",8,4,0x1c,
#endif
"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),},
{CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,203},
/* 1000 1000 ssss dddd *** xorb rbd,rbs */
{
#ifdef NICENAMES
-"xorb rbd,rbs",8,4,0x1c,
+"xorb rbd,rbs",8,4,0x01,
#endif
"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),},
{CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,203},
}
static int
-func (struct op *a, struct op *b)
+func (const void *p1, const void *p2)
{
- return strcmp ((a)->name, (b)->name);
+ const struct op *a = p1;
+ const struct op *b = p2;
+ int ret = strcmp (a->name, b->name);
+ if (ret != 0)
+ return ret;
+ return p1 > p2;
}
memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */
- qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *))func);
+ qsort (new_op, c, sizeof (struct op), func);
p = new_op;
while (p->flags && p->flags[0] != '*')
memcpy (new_op, p, c * sizeof (struct op));
/* Sort all names in table alphabetically. */
- qsort (new_op, c, sizeof (struct op), (int (*)(const void *, const void *)) func);
+ qsort (new_op, c, sizeof (struct op), func);
printf ("/* DO NOT EDIT! -*- buffer-read-only: t -*-\n");
printf (" This file is automatically generated by z8kgen. */\n\n");