|
@@ -62,9 +62,7 @@ module.exports = class Computer {
|
|
|
break;
|
|
|
}
|
|
|
case this.OPCODES.OUTPUT: {
|
|
|
- const outputPosition = this.stack.Next().Get();
|
|
|
-
|
|
|
- this.Operation_Output(outputPosition);
|
|
|
+ this.Operation_Output();
|
|
|
break;
|
|
|
}
|
|
|
case this.OPCODES.HALT:
|
|
@@ -160,11 +158,12 @@ module.exports = class Computer {
|
|
|
/**
|
|
|
* Execute the OUTPUT opcode
|
|
|
*
|
|
|
- * @param {number} outputPosition The memory address of the value to output
|
|
|
* @returns {void}
|
|
|
*/
|
|
|
- Operation_Output(outputPosition) {
|
|
|
- console.log(this.stack.Get(outputPosition));
|
|
|
+ Operation_Output() {
|
|
|
+ const outputPosition = this.stack.Next().Get(ComputerParameterMode.IMMEDIATE_MODE);
|
|
|
+
|
|
|
+ console.log(this.stack.GetAtIndex(outputPosition, ComputerParameterMode.IMMEDIATE_MODE));
|
|
|
}
|
|
|
|
|
|
/**
|