Handbook
Glossary
%load-immediate ( reg val -- )
Vocabulary
cpu
.
architecture
Inputs
reg
a register symbol
val
a value
Outputs
None
Word description
Emits code for loading an immediate value into a register. On
x86
, if val is 0, then an
XOR
instruction is emitted instead of
MOV
because the former is shorter.
See also
##load-tagged
Definition
USING:
system
;
IN:
cpu.architecture
HOOK:
%load-immediate
cpu
( reg val -- )
Methods
USING:
cpu.architecture
cpu.x86.assembler
cpu.x86.assembler.operands
kernel
kernel.private
math
system
;
M:
x86
%load-immediate
{
fixnum
}
declare
[
32-bit-version-of
dup
XOR
]
[
MOV
]
if-zero
;