Skip to content

Commit 0dcc768

Browse files
committed
Completed jasmin array access (non-initialization)
1 parent 4281e80 commit 0dcc768

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/pt/up/fe/comp2023/jasmin/JVMInstructionUtils.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ public static String createBinaryOpInstruction(BinaryOpInstruction instruction,
195195
}
196196

197197
public static String createNoperInstruction(SingleOpInstruction instruction, HashMap<String, Descriptor> varTable) {
198-
return getLoadInstruction(instruction.getSingleOperand(), varTable);
198+
Element operand = instruction.getSingleOperand();
199+
if (operand instanceof ArrayOperand) {
200+
return getArrayLoadInstruction((ArrayOperand)operand, varTable)
201+
+ "\tiaload\n";
202+
}
203+
return getLoadInstruction(operand, varTable);
199204
}
200205

201206
public static String createAssignStatement(AssignInstruction instruction, HashMap<String, Descriptor> varTable) {

0 commit comments

Comments
 (0)