diff --git a/Thumbs.db b/Thumbs.db new file mode 100644 index 0000000..aef22ca Binary files /dev/null and b/Thumbs.db differ diff --git a/instructions/Thumbs.db b/instructions/Thumbs.db new file mode 100644 index 0000000..47c409b Binary files /dev/null and b/instructions/Thumbs.db differ diff --git a/public/vm/c0vm.js b/public/vm/c0vm.js index d2f9b72..4438948 100755 --- a/public/vm/c0vm.js +++ b/public/vm/c0vm.js @@ -473,7 +473,37 @@ ProgramState.prototype.step = function() { } } +ProgramState.prototype.remove_breakpoint = function(opcode_index) { + if (opcode_index < 0){ + console.log("Error: negative opcode_index" + opcode_index.toString()); + throw "Error - negative opcode index"; + } + else if (opcode_index >= this.program.length) { + console.log("Error: opcode index larger than max index:" + + opcode_index.toString()); + throw "Error - opcode index too large"; + } + for (i = 0; i < this.breakpoints.length; i++) { + if (this.breakpoints[i][1] == opcode_index){ + var index = i; + array.splice(index,1); + return; + } + } + console.log("Error: non-breakpoint opcode index" + opcode_index.toString()); + throw "Error - non-breakpoint opcode index"; +} + ProgramState.prototype.set_breakpoint = function(function_index, opcode_index) { + if (opcode_index < 0) { + console.log("Error: negative opcode_index" + opcode_index.toString()); + throw "Error - negative opcode index"; + } + else if (opcode_index >= this.program.length) { + console.log("Error: opcode index larger than max index:" + + opcode_index.toString()); + throw "Error - opcode index too large"; + } this.breakpoints.push([function_index, opcode_index]); }