USING: compiler.codegen.labels cpu.x86.assembler.private help.markup
-help.syntax ;
+help.syntax sequences ;
IN: cpu.x86.assembler
+HELP: 1-operand
+{ $values { "operand" "operand" } { "reg,rex.w,opcode" sequence } }
+{ $description "Used for encoding some instructions with one operand." } ;
+
+HELP: DEC
+{ $values { "dst" "register" } }
+{ $description "Emits a DEC instruction." } ;
+
+HELP: INC
+{ $values { "dst" "register" } }
+{ $description "Emits an INC instruction." } ;
+
HELP: JE
{ $values { "dst" "destination address or " { $link label } } }
{ $description "Emits a conditional jump instruction to the given address relative to the current code offset." }
M: immediate SUB { 0b101 t 0x80 } immediate-1/4 ;
M: operand SUB 0o050 2-operand ;
+: INC ( dst -- )
+ { 0b000 t 0xff } 1-operand ;
+
+: DEC ( dst -- )
+ { 0b001 t 0xff } 1-operand ;
+
GENERIC: XOR ( dst src -- )
M: immediate XOR { 0b110 t 0x80 } immediate-1/4 ;
M: operand XOR 0o060 2-operand ;