L1Ext_do Permute
Permute the top N stack elements based on the literal which is an N-tuple of distinct integers in 1..N (i.e., a permutation). The mutability of the values is unaffected.
The first pushed value is considered position 1, and the most recently pushed value (the top of stack) is considered position N. The algorithm behaves as though a scratch N-array is available. The elements of the stack and of the permutation tuple are examined in lock-step, and each value is placed into the temporary array at the position indicated in the permutation tuple. The entire array is then pushed back on the stack (starting with the first element of the array).
As an example, if the nybblecodes have already pushed A, B, and C, in that order, the permute nybblecode with the tuple <2,3,1> would transfer A into array slot 2, B into array slot 3, and C into array slot 1, yielding the array C,A,B. These would then replace the original values as though C, A, and B had been pushed, in that order.
Properties
Functions
Dispatch this operation through an L1OperationDispatcher.
Write this operation to a NybbleOutputStream. Do not output operands.