|
@@ -5,14 +5,14 @@ module.exports = {
|
|
* Position Mode
|
|
* Position Mode
|
|
*
|
|
*
|
|
* When the int computer is in Position mode, the value at the pointer
|
|
* When the int computer is in Position mode, the value at the pointer
|
|
- * is interpretted as another address in memory.
|
|
|
|
|
|
+ * is interpreted as another address in memory.
|
|
*/
|
|
*/
|
|
POSITION_MODE: 0,
|
|
POSITION_MODE: 0,
|
|
/**
|
|
/**
|
|
* Immediate Mode
|
|
* Immediate Mode
|
|
*
|
|
*
|
|
* When the int computer is in Immediate Mode, the value at the pointer
|
|
* When the int computer is in Immediate Mode, the value at the pointer
|
|
- * is interpretted as its literal value.
|
|
|
|
|
|
+ * is interpreted as its literal value.
|
|
*/
|
|
*/
|
|
IMMEDIATE_MODE: 1,
|
|
IMMEDIATE_MODE: 1,
|
|
/**
|
|
/**
|
|
@@ -28,7 +28,7 @@ module.exports = {
|
|
*
|
|
*
|
|
* @param {number} rawOpcode The opcode in memory
|
|
* @param {number} rawOpcode The opcode in memory
|
|
* @param {number} parameterIndex The index of the parameter in the function arguments
|
|
* @param {number} parameterIndex The index of the parameter in the function arguments
|
|
- * @returns {number} Either POSITION_MODE or IMMEDITATE_MODE
|
|
|
|
|
|
+ * @returns {number} Either POSITION_MODE or IMMEDIATE_MODE
|
|
*/
|
|
*/
|
|
ParseParameterMode: function (rawOpcode, parameterIndex) {
|
|
ParseParameterMode: function (rawOpcode, parameterIndex) {
|
|
if (DecimalPlaceIsNonZero(rawOpcode, parameterIndex + 1)) { return this.IMMEDIATE_MODE; }
|
|
if (DecimalPlaceIsNonZero(rawOpcode, parameterIndex + 1)) { return this.IMMEDIATE_MODE; }
|