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: c8eb389)
raw | patch | inline | side by side (parent: c8eb389)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 5 Jan 2014 18:59:27 +0000 (19:59 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 5 Jan 2014 18:59:27 +0000 (19:59 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index 0adf8f9abfa5468e852ee6c709b60ac1216f81b5..512d238b9d89a98176058d8253180290c9f6021b 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
public void convertStream(InputStream ins) throws Exception{
mainIn = ins;
- //skip start TODO make better
- for (int i = 0; i < 14; i++)
- get();
+ //process start
+ byte m = (byte) get();
+ byte j = (byte) get();
+ if (m!='M' || j !='J')
+ throw new Exception("Wrong start of bytecode file");
+ int codesize = get4();
+ int numberOfWords = get4();
+ int mainAdr = get4();
prl(getStandardStart());
prl("SKIP;\n ACTIONS A_S_start:\n A_S_start == CALL a14 END");