1 USING: compiler.codegen.labels cpu.x86.assembler.private help.markup
2 help.syntax kernel math sequences ;
6 { $values { "dst" "destination" } { "src" "immediate value" } }
7 { $description "MOV where 'src' is immediate. If dst is a 64-bit register and the 'src' value fits in 32 bits, then zero extension is taken advantage of by downgrading 'dst' to a 32-bit register. That way, the instruction gets a shorter encoding." } ;
10 { $values { "operand" "operand" } { "reg,rex.w,opcode" sequence } }
11 { $description "Used for encoding some instructions with one operand." } ;
14 { $values { "dst" "register" } }
15 { $description "Emits a DEC instruction." } ;
18 { $values { "dst" "register" } }
19 { $description "Emits an INC instruction." } ;
22 { $values { "dst" "destination address or " { $link label } } }
23 { $description "Emits a conditional jump instruction to the given address relative to the current code offset." }
26 "USING: cpu.x86.assembler make ;"
27 "[ 0x0 JE ] B{ } make disassemble"
28 "000000e9fcc71fe0: 0f8400000000 jz dword 0xe9fcc71fe6"
33 { $values { "dst" "destination" } { "src" "source" } }
34 { $description "Moves a value from one place to another." } ;
37 { $values { "dst" "destination" } { "src" "source" } }
38 { $description "Moves a value with sign extension." } ;
41 { $values { "dest" "destination" } { "src" "source" } { "imm" "immediate" } }
42 { $description "Packed extract byte. This instruction copies the byte selected by 'imm' into the first eight bits of the selected register." } ;
45 { $values { "dst" "dst" } { "imm" "imm" } { "reg,rex.w,opcode" sequence } }
46 { $description "If imm is a byte, compile the opcode and the byte. Otherwise, set the 8-bit operand flag in the opcode, and compile the cell. The 'reg' is not really a register, but a value for the 'reg' field of the mod-r/m byte." } ;
48 HELP: zero-extendable?
49 { $values { "imm" integer } { "?" boolean } }
50 { $description "All positive 32-bit numbers are zero extendable except for 0 which is the value used for relocations." } ;
52 ARTICLE: "cpu.x86.assembler" "CPU x86 assembler"
53 "This vocab implements an assembler for x86 architectures."
55 "General instructions:"
56 { $subsections DEC INC JE MOV MOVSX }
58 { $subsections PEXTRB } ;
60 ABOUT: "cpu.x86.assembler"