コード例 #1
0
ファイル: ROM.java プロジェクト: kingpinzs/nand2tetris-emu
 /** Called when the contents of the memory are changed through the memory gui. */
 public void valueChanged(ComputerPartEvent event) {
   short newValue = event.getValue();
   int newAddress = event.getIndex();
   clearErrorListeners();
   try {
     HackAssemblerTranslator.getInstance().codeToText(newValue);
     setValueAt(newAddress, newValue, true);
   } catch (AssemblerException ae) {
     notifyErrorListeners("Illegal instruction");
     quietUpdateGUI(newAddress, mem[newAddress]);
   }
 }