1
DUP2
Nunuhara Cabbage edited this page 2019-11-05 17:29:12 -08:00

DUP2

Instruction Arguments

None.

Stack Arguments

int32 value1 - The first value to duplicate
int32 value2 - The second value to duplicate

Description

Duplicate the top two values on the stack.

Example

PUSH 0x1 ; stack: [1]
PUSH 0x2 ; stack: [1, 2]
DUP2     ; stack: [1, 2, 1, 2]
ADD      ; stack: [1, 2, 3]