@gaialabs/core 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -715,9 +715,11 @@ var AddressingModeHandler = class {
715
715
  case "Immediate":
716
716
  this.handleImmediateMode(code.mnem, context.size, operands, reg);
717
717
  break;
718
+ case "AbsoluteIndexedIndirect":
719
+ this.handleAbsoluteMode(code.mnem, void 0, context.nextAddress, reg.dataBank, operands, reg, true);
720
+ break;
718
721
  case "AbsoluteIndirect":
719
722
  case "AbsoluteIndirectLong":
720
- case "AbsoluteIndexedIndirect":
721
723
  case "Absolute":
722
724
  case "AbsoluteIndexedX":
723
725
  case "AbsoluteIndexedY":
@@ -847,19 +849,20 @@ var AddressingModeHandler = class {
847
849
  const stackOperations = new StackOperations(reg, this._blockReader);
848
850
  stackOperations.handleStackOperation(mnemonic);
849
851
  }
850
- handleAbsoluteMode(mnemonic, xBank1, next, dataBank, operands, registers) {
852
+ handleAbsoluteMode(mnemonic, xBank1, next, dataBank, operands, registers, isIndexedIndirect = false) {
851
853
  let refLoc = this._dataReader.readUShort();
852
854
  const isPush = this.isPushInstruction(mnemonic);
853
855
  if (isPush) {
854
856
  refLoc++;
855
857
  }
856
- const isJump = isPush || this.isJumpInstruction(mnemonic);
858
+ const isJump = isPush || isIndexedIndirect || this.isJumpInstruction(mnemonic);
857
859
  const bank = xBank1 ?? (isJump ? this._dataReader.position >> 16 : dataBank ?? 129);
858
860
  const addr = new shared.Address(bank, refLoc);
859
861
  if (addr.isROM) {
860
862
  const wrapper = new shared.LocationWrapper(addr.toInt(), shared.AddressType.Offset);
861
863
  if (isJump) {
862
- const name = this._blockReader.noteType(wrapper.location, "Code", isPush, registers);
864
+ const type = isIndexedIndirect ? "*Code" : "Code";
865
+ const name = this._blockReader.noteType(wrapper.location, type, isPush, registers);
863
866
  if (isPush) {
864
867
  operands.push(`&${name}-1`);
865
868
  return;
@@ -3194,7 +3197,7 @@ var AssemblerState = class _AssemblerState {
3194
3197
  this.dbStruct = structType === null ? null : Object.values(this.root.structs).find(
3195
3198
  (x) => x.name.toLowerCase() === structType.toLowerCase()
3196
3199
  ) || null;
3197
- this.parentStruct = this.dbStruct?.parent == null ? null : Object.values(this.root.structs).find(
3200
+ this.parentStruct = !this.dbStruct || !this.dbStruct.parent ? null : Object.values(this.root.structs).find(
3198
3201
  (x) => x.name.toLowerCase() === this.dbStruct.parent.toLowerCase()
3199
3202
  ) || null;
3200
3203
  this.discriminator = this.parentStruct?.discriminator ?? null;