Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NOP :) #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions assets/asmsimulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 2 additions & 0 deletions instruction-set.html
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ <h4>Stack instructions</h4>
<h4>Other instructions</h4>
<b>HLT - Stops the processor.</b>
<p>Stops operation of the processor. Hit Reset button to reset IP before restarting.</p>
<b>NOP - does nothing</b>
<p>Increments the IP, steps to next instruction.</p>
<pre>
HLT
</pre>
Expand Down
3 changes: 3 additions & 0 deletions src/assembler/asm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
5 changes: 3 additions & 2 deletions src/emulator/opcodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}]);
}]);