gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 102044c)
raw | patch | inline | side by side (parent: 102044c)
author | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 11 Jun 2014 14:37:24 +0000 (16:37 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Wed, 11 Jun 2014 14:37:24 +0000 (16:37 +0200) |
CALL commands should not be used in VAR blocks to go outside
them - so this was introduced. Alternative is to use "global" variables
for the operands.
them - so this was introduced. Alternative is to use "global" variables
for the operands.
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index dde880ee299a30f46f72d80ff559af68b94629c0..5472d5564234d3b689bcc9ad26f908e0361c2ef7 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
ret.append("mjvm_locals := ARRAY(1,0),");
ret.append("\n\tmjvm_statics := ARRAY("+numWords+",0),");
ret.append("\n\tmjvm_arrays := < >,");
+ ret.append("\n\tmjvm_flag_jump := 0,");
ret.append("\n\tmjvm_objects := < >,");
ret.append("\n\tmjvm_estack := < >, mjvm_mstack := < > > :");
case jge: {
prl(createStartVar("tempa", "tempb"));
prl(createTopTwoEStack());
- prl("IF tempb " + getRelationFor(op) + " tempa THEN CALL a"
- + (counter + get2()) + " ELSE CALL a" + (counter + 1)
+ prl("IF tempb " + getRelationFor(op)
+ + " tempa THEN mjvm_flag_jump := 1"
+ + " ELSE mjvm_flag_jump := 0"
+ " FI;");
prl(createEndVar());
+ prl("IF mjvm_flag_jump = 1 THEN CALL a"
+ + (counter + get2())
+ + " ELSE CALL a" + (counter + 1)
+ + " FI;");
break;
}