This instruction duplicates the value at the op of the stack and inserts it 2 positions down so for example this stack
Top | |
A | B |
turns into
Top | | |
A | B | A |
maybe the duplicate instruction can have an optional number argument for where the duplicate goes. Default 0 puts it at the top (or right below the top value), 1 puts it below next value on the stack (basically matches the number of the java bytecode instruction) and any other value puts the duplicated value further down
This instruction duplicates the value at the op of the stack and inserts it 2 positions down so for example this stack
turns into
maybe the duplicate instruction can have an optional number argument for where the duplicate goes. Default 0 puts it at the top (or right below the top value), 1 puts it below next value on the stack (basically matches the number of the java bytecode instruction) and any other value puts the duplicated value further down