فهرست منبع

Set INPUT opcode to default to Immediate Mode

Commit #d1ef84a551 allowed the INPUT opcode to get its output position
in Position Mode if no Parameter Mode was specified. This is incorrect,
as INPUT should never use Position Mode. Updated to use Immediate Mode
if no mode is specified.
ApisNecros 1 سال پیش
والد
کامیت
2b65bc58b6
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      IntComp/Computer.js

+ 2 - 1
IntComp/Computer.js

@@ -304,7 +304,8 @@ module.exports = class Computer {
      * @returns {void}
      */
     Operation_Input(rawOpcode) {
-        const outputParamMode = ComputerParameterMode.ParseParameterMode(rawOpcode, 1);
+        // Disallow Position Parameter Mode
+        const outputParamMode = ComputerParameterMode.ParseParameterMode(rawOpcode, 1) || 1;
         const outputPosition = this.stack.Next().Get(outputParamMode);
 
         /** A variable to store the input in before putting it on the stack */