ref: ecf8ce9396333eecb45500ae306f73405285806d
dir: /8/insns.def/
/* Table of instructions. Each instruction
is defined by the following macro:
Insn(enumval, fmt, attr)
The format string 'fmt' has the following expansions:
%r - A register
%m - A memory location.
%l - A location (either register or memory)
%x - Any value.
%[0-9]*t - Mode of an operand. The optional number
preceeding it is the operand desired for
the mode.
%v - a value (ie, immediate integer or label)
Currently, there aren't any attrs, because none were needed yet.
Eventually, they'll probably include flag setting and so on.
*/
/* Note, the mov instruction is specified in an overly general manner. */
Insn(Inone, "BAD_INSN", 0)
Insn(Imov, "\tmov%t %x,%x\n", 0)
Insn(Imovz, "\tmovz%0t%1t %x,%x\n", 0)
Insn(Imovs, "\tmovs%0t%1t %x,%x\n", 0)
Insn(Ilea, "\tlea%t %x,%x\n", 0)
Insn(Iadd, "\tadd%t %r,%x\n", 0)
Insn(Isub, "\tsub%t %r,%x\n", 0)
Insn(Iand, "\tand%d %r,%x\n", 0)
Insn(Ior, "\tor%d %r,%x\n", 0)
Insn(Ixor, "\txor%d %r,%x\n", 0)
Insn(Itest, "\ttest%t %r,%r\n", 0)
Insn(Icmp, "\tcmp%t %r,%r\n", 0)
Insn(Ipush, "\tpush%t %r\n", 0)
Insn(Ipop, "\tpop%t %r\n", 0)
/* branch instructions */
Insn(Isetz, "\tsetz\n", 0)
Insn(Isetnz, "\tsetnz\n", 0)
Insn(Isetlt, "\tsetlt\n", 0)
Insn(Isetle, "\tsetle\n", 0)
Insn(Isetgt, "\tsetgt\n", 0)
Insn(Isetge, "\tsetge\n", 0)
/* branch instructions */
Insn(Ijmp, "\tjmp %v\n", 0)
Insn(Ijz, "\tjz %v\n", 0)
Insn(Ijnz, "\tjnz %v\n", 0)
Insn(Ijl, "\tjl %v\n", 0)
Insn(Ijle, "\tjle %v\n", 0)
Insn(Ijg, "\tjg %v\n", 0)
Insn(Ijge, "\tjge %v\n", 0)
Insn(Iret, "\tret\n", 0)
/* not really an insn... */
Insn(Ilbl, "%v:\n", 0)