NAME

set.ops - Assignment Opcodes

DESCRIPTION

These operations all set registers to various values.

When making changes to any ops file, run make bootstrap-ops to regenerate all generated ops files.

clone(out STR, in STR)
Effectively the same as set $1, $2, except that if $2 is a null STRING, $1 gets a new empty string instead.
set(out INT, in INT)
set(out INT, in NUM)
A floating-point number is truncated (rounded toward zero) when assigned to an integer register.
set(out INT, invar PMC)
set(out INT, invar PMC)
set(out INT, in STR)
set(out NUM, in INT)
set(out NUM, in NUM)
set(out NUM, invar PMC)
set(out NUM, in STR)
set(invar PMC, in INT)
set(invar PMC, in NUM)
set(out PMC, invar PMC)
set(invar PMC, invar STR)
set(out STR, in INT)
set(out STR, in NUM)
set(out STR, invar PMC)
set(out STR, inconst STR)
set(out STR, invar STR)
set(out PMC, inconst PMC)
set(invar PMC, inconst STR)
Set $1 to $2.

PMC assignment operations: Px = x

assign(invar PMC, in INT)
assign(invar PMC, in NUM)
Assign a new value $2, to PMC $1. Same as the equivalent set opcodes.
assign(invar PMC, in STR)
assign(invar PMC, invar PMC)
Assign a new value $2, to PMC $1 by copying the value.
assign(out STR, in STR)
Assign a new value to a string by reusing the string header.
setref(invar PMC, invar PMC)
Make $1 refer to $2 by calling set_pmc.
deref(out PMC, invar PMC)
Not strictly an assignment operation: Put into $1 the PMC that the reference PMC $2 refers to.

Keyed set operations: Px[ INTKEY ] = Bx

set(invar PMC, in INTKEY, in INT)
set(invar PMC, in INTKEY, in NUM)
set(invar PMC, in INTKEY, in STR)
set(invar PMC, in INTKEY, invar PMC)

Keyed get operations: Ax = Px[ INTKEY ]

set(out INT, invar PMC, in INTKEY)
set(out NUM, invar PMC, in INTKEY)
set(out STR, invar PMC, in INTKEY)
set(out PMC, invar PMC, in INTKEY)

Keyed set operations: Px[ KEY ] = Bx

set(invar PMC, in KEY, in INT)
set(invar PMC, in KEY, in NUM)
set(invar PMC, in KEY, in STR)
set(invar PMC, in KEY, invar PMC)

Keyed get operations: Ax = Px[ KEY ]

set(out INT, invar PMC, in KEY)
set(out NUM, invar PMC, in KEY)
set(out STR, invar PMC, in KEY)
set(out PMC, invar PMC, in KEY)
clone(out PMC, invar PMC)
Makes a copy of the PMC in $2 and puts it in $1.
clone(out PMC, invar PMC, in PMC)
Makes a copy of the PMC in $2 and puts it in $1, using the arguments in $3.
copy(inout PMC, invar PMC)
Morphs the PMC in $1 to the type of the PMC in $2, then assigns $2 to $1.

Register operations

These operations effect entire sets of registers.

null(out INT)
null(out NUM)
Set register $1 to zero.
null(out STR)
Set register $1 to a NULL string value.
null(out PMC)
Set register $1 to PMCNULL.

COPYRIGHT

Copyright (C) 2001-2011, Parrot Foundation.

LICENSE

This program is free software. It is subject to the same license as the Parrot interpreter itself.