USING: alien assocs classes compiler.cfg.instructions
-compiler.cfg.registers compiler.cfg.stack-frame
-cpu.x86.assembler cpu.x86.assembler.operands help.markup
-help.syntax kernel layouts literals math multiline system vm
-words ;
+compiler.cfg.registers compiler.cfg.stack-frame cpu.x86.assembler
+cpu.x86.assembler.operands help.markup help.syntax kernel layouts
+literals math multiline sequences strings system vm words ;
IN: cpu.architecture
<<
{ $values { "abi" "a calling convention symbol" } { "regs" assoc } }
{ $description "Retrieves the order in which machine registers are used for parameters for the given calling convention." } ;
+HELP: %alien-invoke
+{ $values
+ { "reg-inputs" sequence }
+ { "stack-inputs" sequence }
+ { "reg-outputs" sequence }
+ { "dead-outputs" sequence }
+ { "cleanup" integer }
+ { "stack-size" integer }
+ { "symbols" string }
+ { "dll" { $maybe dll } }
+ { "gc-map" gc-map }
+}
+{ $description "Machine code emitter for the " { $link ##alien-invoke } " instruction." } ;
+
+
HELP: %allot
{ $values
{ "dst" "destination register symbol" }
}
} ;
+HELP: %load-double
+{ $values
+ { "reg" "destination register symbol" }
+ { "val" float }
+} { $description "Loads a literal floating point value into a register. On x86, this corresponds to the " { $link MOVSD } " instruction." }
+{ $see-also ##load-double } ;
+
HELP: %load-immediate
{ $values { "reg" "a register symbol" } { "val" "a value" } }
{ $description "Emits code for loading an immediate value into a register. On " { $link x86 } ", if val is 0, then an " { $link XOR } " instruction is emitted instead of " { $link MOV } " because the former is shorter." }
{ $description "Emits machine code for saving pointers to the callstack, datastack and retainstack in the current context field struct." }
{ $examples { $unchecked-example $[ ex-%save-context ] } } ;
+HELP: %set-slot
+{ $values
+ { "src" "register containing the element" }
+ { "obj" "register containing the object" }
+ { "slot" "register containing the slot index" }
+ { "scale" fixnum }
+ { "tag" "type tag for the builtin" }
+} { $description "Emits machine code for " { $link ##set-slot } " instructions." }
+{ $examples
+ { $unchecked-example
+ "USING: cpu.architecture prettyprint ;"
+ "[ RAX RBX RCX 3 2 %set-slot ] B{ } make disassemble"
+ "0000000000f1fda0: 488944cbfe mov [rbx+rcx*8-0x2], rax"
+ }
+} ;
+
HELP: %store-memory-imm
{ $values
{ "value" "source register" }
-USING: compiler.codegen.labels cpu.x86.assembler help.markup help.syntax ;
+USING: compiler.codegen.labels cpu.x86.assembler.private help.markup
+help.syntax ;
IN: cpu.x86.assembler
HELP: JE
"000000e9fcc71fe0: 0f8400000000 jz dword 0xe9fcc71fe6"
}
} ;
+
+HELP: MOV
+{ $values { "dst" "destination" "src" "source" } }
+{ $description "Moves a value from one place to another." } ;
+
+HELP: (MOV-I)
+{ $values { "dst" "destination" "src" "immediate value" } }
+{ $description "MOV where the src is immediate." } ;
+
+ARTICLE: "cpu.x86.assembler" "x86 assembler" "This vocab implements an assembler for x86 architectures." ;
+
+ABOUT: "cpu.x86.assembler"