Skip to content

Commit

Permalink
Merge pull request #3 from not-a-dogOK/parameter-handling
Browse files Browse the repository at this point in the history
updated read me
  • Loading branch information
not-a-dogOK authored Jul 2, 2022
2 parents d593315 + 057077f commit f7214c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
an assembler for the hack machine language
knows to handle A type instructions (op code 0), C type instructions (op code 1) and L type instructions (labels for easier usage)
the midterm project of "The Elements of Computing Systems" course aka "from nand to tetris" more at https://www.nand2tetris.org


![image](https://user-images.githubusercontent.com/57526797/163774382-5a759c36-fd16-4d23-8d2e-7fa1caf56f4d.png)
![image](https://user-images.githubusercontent.com/57526797/163774626-958ad445-de89-405f-b08e-f82107f19610.png)


# API
input: program get file via user input
1) First pass on the on the file, removing labels and generating "Nolable.asm"
2) Second pass on the line, reads "Nolable.asm" and write binary code into “output.hack”
<br /> output: “output.hack” 16 bit binary code for the hack computer, ready to run
The program asks the user for the name of the file starting with “\”, in order for the program to find the file it must be in the same folder as the java files
<br />
1) First pass on the on the file, replacing labels with the number they represent, removing comments and writing it to the file: "Nolable.asm"
2) Second pass on the file, reads "Nolable.asm" and writes hack 16 bit machine language code into “output.hack”
<br /> output: “output.hack” 16 bit binary code for the hack computer, ready to run
# Running the machine language code
In the release tab there will be a hack emulator and hack assembler, taken from https://www.nand2tetris.org under "Creative Common" license
<br /> This also should run on a physical hack computer but wasn’t tested on one

2 changes: 1 addition & 1 deletion assembler/RunMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void main(String[] args) throws IOException {
reader = new BufferedReader(new FileReader(parser.fileName));
String line2 = reader.readLine();
while (line2 != null) {
parser.writeline(line2);
parser.writeline(line2, L);
line2 = reader.readLine();
L++;
}
Expand Down

0 comments on commit f7214c5

Please sign in to comment.