-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ed4630
commit 8914147
Showing
7 changed files
with
211 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
257 16448 16704 1892 29446 65280 16704 1537 16448 258 16449 16704 16450 12303 38 16451 16705 18243 29460 28703 16704 57921 29208 28700 16705 1537 16449 28688 357 16449 28688 16705 1381 29219 28674 16704 4096 28674 16706 1537 2305 16453 256 16454 16706 53829 16454 17989 2305 16453 16706 53829 16454 17989 2305 16453 16706 53829 16454 17989 2305 16453 1537 12544 | ||
8445 8701 16895 16437 256 16438 273 16439 28685 16693 4096 300 12301 16693 29961 256 65280 8704 9216 9729 33026 1793 29979 33026 23040 10752 28713 33026 1793 14848 273 12320 9473 40961 33026 1794 14848 273 12327 9473 42497 9473 8960 12544 16694 1537 16438 14848 16695 12338 9473 16437 12544 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
package drcs; | ||
|
||
import static drcs.Opcodes.*; | ||
|
||
import java.util.*; | ||
|
||
public class Mnemonics { | ||
|
||
private static final Map<Short, String> MAP = new HashMap<>(); | ||
|
||
static { | ||
put(HLT, "HLT"); | ||
|
||
put(NOP, "NOP"); | ||
put(LDAI, "LDAI"); | ||
put(NOTI, "NOTI"); | ||
put(ANDI, "ANDI"); | ||
put(ORI, "ORI"); | ||
put(XORI, "XORI"); | ||
put(ADDI, "ADDI"); | ||
put(SUBI, "SUBI"); | ||
put(LSHI, "LSHI"); | ||
put(RSHI, "RSHI"); | ||
|
||
put(OUT, "OUT"); | ||
put(LDALI, "LDALI"); | ||
put(NOTLI, "NOTLI"); | ||
put(ANDLI, "ANDLI"); | ||
put(ORLI, "ORLI"); | ||
put(XORLI, "XORLI"); | ||
put(ADDLI, "ADDLI"); | ||
put(SUBLI, "SUBLI"); | ||
|
||
put(LDBP, "LDBP"); | ||
put(LDSP, "LDSP"); | ||
put(PSHBP, "PSHBP"); | ||
put(POPBP, "POPBP"); | ||
put(MSPBP, "MSPBP"); | ||
put(ADDSP, "ADDSP"); | ||
put(SUBSP, "SUBSP"); | ||
|
||
put(DEA, "DEA"); | ||
put(DEB, "DEB"); | ||
put(STATB, "STATB"); | ||
put(STBTA, "STBTA"); | ||
|
||
put(CALL, "CALL"); | ||
put(RET, "RET"); | ||
|
||
put(PSHA, "PSHA"); | ||
put(POPA, "POPA"); | ||
|
||
put(STA, "STA"); | ||
put(LDA, "LDA"); | ||
put(NOT, "NOT"); | ||
put(AND, "AND"); | ||
put(OR, "OR"); | ||
put(XOR, "XOR"); | ||
put(ADD, "ADD"); | ||
put(SUB, "SUB"); | ||
put(LSH, "LSH"); | ||
put(RSH, "RSH"); | ||
|
||
put(STB, "STB"); | ||
put(LDB, "LDB"); | ||
|
||
put(LDEZ, "LDEZ"); | ||
put(LDNEZ, "LDNEZ"); | ||
put(LDLZ, "LDLZ"); | ||
put(LDLEZ, "LDLEZ"); | ||
put(LDMZ, "LDMZ"); | ||
put(LDMEZ, "LDMEZ"); | ||
|
||
put(LDNOT, "LDNOT"); | ||
put(LDNEG, "LDNEG"); | ||
|
||
put(JMP, "JMP"); | ||
put(JEZ, "JEZ"); | ||
put(JNEZ, "JNEZ"); | ||
put(JLZ, "JLZ"); | ||
put(JLEZ, "JLEZ"); | ||
put(JMZ, "JMZ"); | ||
put(JMEZ, "JMEZ"); | ||
|
||
put(STAPB, "STAPB"); | ||
put(LDAPB, "LDAPB"); | ||
put(NOTPB, "NOTPB"); | ||
put(ANDPB, "ANDPB"); | ||
put(ORPB, "ORPB"); | ||
put(XORPB, "XORPB"); | ||
put(ADDPB, "ADDPB"); | ||
put(SUBPB, "SUBPB"); | ||
put(LSHPB, "LSHPB"); | ||
put(RSHPB, "RSHPB"); | ||
|
||
put(STBPB, "STBPB"); | ||
put(LDBPB, "LDBPB"); | ||
put(LDIPB, "LDIPB"); | ||
|
||
put(STANB, "STANB"); | ||
put(LDANB, "LDANB"); | ||
put(NOTNB, "NOTNB"); | ||
put(ANDNB, "ANDNB"); | ||
put(ORNB, "ORNB"); | ||
put(XORNB, "XORNB"); | ||
put(ADDNB, "ADDNB"); | ||
put(SUBNB, "SUBNB"); | ||
put(LSHNB, "LSHNB"); | ||
put(RSHNB, "RSHNB"); | ||
|
||
put(STBNB, "STBNB"); | ||
put(LDBNB, "LDBNB"); | ||
put(LDINB, "LDINB"); | ||
|
||
put(MULI, "MULI"); | ||
put(MULLI, "MULLI"); | ||
put(MUL, "MUL"); | ||
put(MULPB, "MULPB"); | ||
put(MULNB, "MULNB"); | ||
|
||
put(DIVI, "DIVI"); | ||
put(DIVLI, "DIVLI"); | ||
put(DIV, "DIV"); | ||
put(DIVPB, "DIVPB"); | ||
put(DIVNB, "DIVNB"); | ||
|
||
put(REMI, "REMI"); | ||
put(REMLI, "REMLI"); | ||
put(REM, "REM"); | ||
put(REMPB, "REMPB"); | ||
put(REMNB, "REMNB"); | ||
} | ||
|
||
private static void put(short opcode, String mnemonic) { | ||
MAP.put(opcode, mnemonic); | ||
} | ||
|
||
public static String get(short opcode) { | ||
return MAP.get(opcode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters