![]() Push symbol clear symbol for next iteration Push 18 clear 18 bytes which is comp, dest and jumpĬall getSymbol for example symbol = "150" ![]() Push comp clears comp, dest and jump field So please tell me how to improve.Ĭall getDetails get comp, dest and jump fieldsĬmp byte, 0 destination field is optionalĪdd edi, 3 fill adds 3 to edi so do it here if fill isnt calledĬmp byte, 0 jump field is optional I'm pretty embarrassed about the way I get the correct opcode for the instruction because it's basically just a bunch of if statements. ![]() If its an A instruction it gets the symbol of the instruction and converts it to the correct binary code.įor now its just prints the binary code, it doesn't yet write to a file If its a C instruction, it gets the dest, comp and jump fields and converts them to the correct binary code. So how it works is, is it reads the file line by line and first identifies if its a C or A instruction (there is also an L instruction which i haven't yet implemented). ![]() I made an assembler for the "hack" assembly language, here's an example of what it looks like: it only works with predefined symbols, I want to know what to improve before I continue. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |