From: Doni Pracner Date: Mon, 20 Jan 2014 17:06:20 +0000 (+0100) Subject: mjc2wsl - dup, dup2 commands X-Git-Tag: v0.1.4~14 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=a2bd7f29ece868c30e34f85e4e474ad947794642;p=mjc2wsl.git mjc2wsl - dup, dup2 commands --- diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index 6f7efe1..4b231aa 100644 --- a/src/mjc2wsl.java +++ b/src/mjc2wsl.java @@ -473,7 +473,20 @@ public class mjc2wsl{ break; } - //TODO dup, dup2 + case dup : { + prl(getTop()); + prl(cmdToEStack("tempa")); + prl(cmdToEStack("tempa")); + break; + } + case dup2 : { + prl(getTopTwo()); + prl(cmdToEStack("tempb")); + prl(cmdToEStack("tempa")); + prl(cmdToEStack("tempb")); + prl(cmdToEStack("tempa")); + break; + } case pop : { prl(cmdPopEStack());