cpu.x86.assember: add INC and DEC instructions to the assembler
parent
156fcbb48b
commit
5a2e1c953e
|
@ -1,7 +1,19 @@
|
||||||
USING: compiler.codegen.labels cpu.x86.assembler.private help.markup
|
USING: compiler.codegen.labels cpu.x86.assembler.private help.markup
|
||||||
help.syntax ;
|
help.syntax sequences ;
|
||||||
IN: cpu.x86.assembler
|
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
|
HELP: JE
|
||||||
{ $values { "dst" "destination address or " { $link label } } }
|
{ $values { "dst" "destination address or " { $link label } } }
|
||||||
{ $description "Emits a conditional jump instruction to the given address relative to the current code offset." }
|
{ $description "Emits a conditional jump instruction to the given address relative to the current code offset." }
|
||||||
|
|
|
@ -336,6 +336,12 @@ GENERIC: SUB ( dst src -- )
|
||||||
M: immediate SUB { 0b101 t 0x80 } immediate-1/4 ;
|
M: immediate SUB { 0b101 t 0x80 } immediate-1/4 ;
|
||||||
M: operand SUB 0o050 2-operand ;
|
M: operand SUB 0o050 2-operand ;
|
||||||
|
|
||||||
|
: INC ( dst -- )
|
||||||
|
{ 0b000 t 0xff } 1-operand ;
|
||||||
|
|
||||||
|
: DEC ( dst -- )
|
||||||
|
{ 0b001 t 0xff } 1-operand ;
|
||||||
|
|
||||||
GENERIC: XOR ( dst src -- )
|
GENERIC: XOR ( dst src -- )
|
||||||
M: immediate XOR { 0b110 t 0x80 } immediate-1/4 ;
|
M: immediate XOR { 0b110 t 0x80 } immediate-1/4 ;
|
||||||
M: operand XOR 0o060 2-operand ;
|
M: operand XOR 0o060 2-operand ;
|
||||||
|
|
Loading…
Reference in New Issue