diff --git a/assets/asmsimulator.js b/assets/asmsimulator.js index 4d04f8c..32c0d5d 100644 --- a/assets/asmsimulator.js +++ b/assets/asmsimulator.js @@ -204,6 +204,9 @@ var app = angular.module('ASMSimulator', []); } switch (instr) { + case 'NOP': + code.push(opcodes.NOP); + break; case 'DB': p1 = getValue(match[op1_group]); diff --git a/instruction-set.html b/instruction-set.html index fd2d8d5..3cffc80 100644 --- a/instruction-set.html +++ b/instruction-set.html @@ -259,6 +259,8 @@
Stops operation of the processor. Hit Reset button to reset IP before restarting.
+ NOP - does nothing +Increments the IP, steps to next instruction.
HLTdiff --git a/src/assembler/asm.js b/src/assembler/asm.js index c12ffd5..c29a58f 100644 --- a/src/assembler/asm.js +++ b/src/assembler/asm.js @@ -203,6 +203,9 @@ app.service('assembler', ['opcodes', function (opcodes) { } switch (instr) { + case 'NOP': + code.push(opcodes.NOP); + break; case 'DB': p1 = getValue(match[op1_group]); diff --git a/src/emulator/opcodes.js b/src/emulator/opcodes.js index 1a94a13..e3f567b 100644 --- a/src/emulator/opcodes.js +++ b/src/emulator/opcodes.js @@ -73,8 +73,9 @@ app.service('opcodes', [function() { SHR_REG_WITH_REG: 94, SHR_REGADDRESS_WITH_REG: 95, SHR_ADDRESS_WITH_REG: 96, - SHR_NUMBER_WITH_REG: 97 + SHR_NUMBER_WITH_REG: 97, + NOP: 98 }; return opcodes; -}]); +}]); \ No newline at end of file