From a2bd7f29ece868c30e34f85e4e474ad947794642 Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Mon, 20 Jan 2014 18:06:20 +0100 Subject: [PATCH] mjc2wsl - dup, dup2 commands --- src/mjc2wsl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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()); -- 2.25.1