Skip to content

Commit

Permalink
Change the labels to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
VipinindKumar committed Aug 27, 2017
1 parent c9c5c6c commit 6ab162b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CodeWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public void writeInit() {
public void writeLabel(String label) {
try {
// Label LABEL
out.write("(" + label + ")");
out.write("(" + label.toUpperCase() + ")");
out.newLine();
}
catch (IOException e) {
Expand All @@ -392,7 +392,7 @@ public void writeLabel(String label) {
public void writeGoto(String label) {
try {
// goto LABEL
out.write("@" + label);
out.write("@" + label.toUpperCase());
out.newLine();
out.write("0;JMP");
out.newLine();
Expand All @@ -416,7 +416,7 @@ public void writeIf(String label) {
out.newLine();

// jump to the label, if the value is not equal to 0
out.write("@" + label);
out.write("@" + label.toUpperCase());
out.newLine();
out.write("D;JNE");
out.newLine();
Expand Down
4 changes: 2 additions & 2 deletions VMTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Usage: java VMTranslator <file-name/path-to-directory>
*
* Dependicies: Parser.java, CodeWriter.java
* Dependencies: Parser.java, CodeWriter.java
*
* - Constructs a Parser from input file
* - Construct a CodeWriter to generate code in output file
Expand All @@ -28,7 +28,7 @@ private void parse(File in) {

String ctype = parser.commandType();

// artithmetic command
// Arithmetic command
if (ctype.equals("C_ARITHMETIC")) {
code.writeArithmetic(parser.arg1());
}
Expand Down

0 comments on commit 6ab162b

Please sign in to comment.