|
@@ -186,7 +186,7 @@ module.exports = class Computer {
|
|
|
status = false;
|
|
|
break;
|
|
|
}
|
|
|
- this.Operation_Input();
|
|
|
+ this.Operation_Input(rawOpcode);
|
|
|
break;
|
|
|
}
|
|
|
case this.OPCODES.OUTPUT: {
|
|
@@ -300,10 +300,12 @@ module.exports = class Computer {
|
|
|
* user for input.
|
|
|
*
|
|
|
* @private
|
|
|
+ * @param {number} rawOpcode The opcode in memory used to make this call
|
|
|
* @returns {void}
|
|
|
*/
|
|
|
- Operation_Input() {
|
|
|
- const outputPosition = this.stack.Next().Get(ComputerParameterMode.IMMEDIATE_MODE);
|
|
|
+ Operation_Input(rawOpcode) {
|
|
|
+ const outputParamMode = ComputerParameterMode.ParseParameterMode(rawOpcode, 1);
|
|
|
+ const outputPosition = this.stack.Next().Get(outputParamMode);
|
|
|
|
|
|
/** A variable to store the input in before putting it on the stack */
|
|
|
let userInput;
|