code: function decode_operand(di, machine_code, offset=0) {
    const addressing_mode = di.addressing_mode;
    let consumed = 0;
    let value;
  
    switch(di.addressing_mode) {
      // 2-tryte operands
      case ADDR_MODE.INDIRECT_INDEXED_Y:
      case ADDR_MODE.INDEXED_X_INDIRECT:
      case ADDR_MODE.ABSOLUTE:
      case ADDR_MODE.ABSOLUTE_X:
      case ADDR_MODE.ABSOLUTE_Y:
      case ADDR_MODE.INDIRECT:
        value = machine_code[offset + 1];
        value += T_TO_TRITS_PER_TRYTE * machine_code[offset + 2];
        consumed = 2;
        break;
  
      // accumulator, register, no arguments
      case ADDR_MODE.ACCUMULATOR:
        consumed = 0;
        break;
  
      // immediate, 1-tryte literal
      case ADDR_MODE.IMMEDIATE:
        value = machine_code[offset + 1];
        consumed = 1;
        break;
    }
  
    return {addressing_mode, value, consumed};
  }
docs: Read operands from a decoded instruction start at machine_code[offset] (offset=opcode)