Skip to content

Commit

Permalink
Add M rec generation for literal operand
Browse files Browse the repository at this point in the history
  • Loading branch information
quazi-irfan committed Nov 29, 2016
1 parent a92d00f commit 64fb098
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Assembler/Pass2Utility.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ private static ArrayList<String> generateMRecord(String[] fields, SymbolTable sy
offset = 1;
}

// handle literal
if(fields[3].charAt(0) == '='){
String genMRec = "M^" + Utility.padAddress(Integer.parseInt(fields[0], 16)+offset, 6) + "^"+ nibbles + "^+" + Utility.padLabel(Pass1Utility.controlSectionName);
MRecordList.add(genMRec);
}


// always M record for external symbol
for (Node symbol : symbolTable.getAllExternal()) {
Expand Down

0 comments on commit 64fb098

Please sign in to comment.