123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- const { GetDecimalInPlace } = require("./common");
- module.exports = {
-
- POSITION_MODE: 0,
-
- IMMEDIATE_MODE: 1,
-
- RELATIVE_MODE: 2,
-
- ParseParameterMode: function (rawOpcode, parameterIndex) {
- const paramModeFromOpcode = GetDecimalInPlace(rawOpcode, parameterIndex + 1);
- switch (paramModeFromOpcode) {
- case 0: return this.POSITION_MODE;
- case 1: return this.IMMEDIATE_MODE;
- case 2: return this.RELATIVE_MODE;
- default: return this.POSITION_MODE;
- }
- },
- };
|