|
@@ -74,7 +74,7 @@ class TListenerMips extends template.TListener {
|
|
|
// Corresponde a posicao do label destino (decimal)
|
|
|
laddress = gctx.G(label);
|
|
|
|
|
|
-// System.out.printf("TemplateListener:{%s\n %s\n %s\n %s\n}\n", base, baseAddress, label, laddress);
|
|
|
+ System.out.printf("TemplateListener:{%s\n %s\n %s\n %s\n}\n", base, baseAddress, label, laddress);
|
|
|
int value = Integer.parseInt(laddress);
|
|
|
int fromStart = value - Integer.parseInt(baseAddress);
|
|
|
|
|
@@ -157,6 +157,7 @@ class TListenerMips extends template.TListener {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ long shift;
|
|
|
//
|
|
|
switch (type) {
|
|
|
case "S": // (j | jal) Salta para o endereco de destino
|
|
@@ -166,10 +167,13 @@ class TListenerMips extends template.TListener {
|
|
|
// System.out.println("JUMP:" + gctx.G(ctx.G("label")) + ":"
|
|
|
// + (Long.parseLong(gctx.G(ctx.G("label")), 10) >> 2));
|
|
|
|
|
|
- long shift = (Long.parseLong(gctx.G(ctx.G("label")), 10) >> 2);
|
|
|
+ shift = (Long.parseLong(gctx.G(ctx.G("label")), 10) >> 2);
|
|
|
ctx.Set("target", BIN("" + shift, 26));
|
|
|
break;
|
|
|
- case "I": // (bne...) Salta para posicao em relacao ao pc atual
|
|
|
+ case "I": // (bne...) Salta para posicao em relacao ao pc atual + 4
|
|
|
+// System.out.println("BIN iiiiii" + ctx);
|
|
|
+// shift = (Long.parseLong(gctx.G(ctx.G("label")), 10) >> 2);
|
|
|
+// ctx.Set("target", BIN("" + shift, 26));
|
|
|
|
|
|
// if (ctx.G("offset").equals("") && !ctx.G("label").equals("")) {
|
|
|
//
|