From 09a4e62c7c6f3741bfba575bcd7c9f167bf0ead5 Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Sun, 1 Aug 2021 10:08:01 +0200 Subject: [PATCH] Bugfix: Interpretation of register lists was wrong in BNF. Massively extended M68kIsa with description on register modifications (not yet used in production code). Changed BNF for additional AddressingMode interfaces. --- README.md | 9 +- build.gradle | 6 +- .../plugins/m68k/parser/M68kParser.java | 62 ++-- ...AddressRegisterIndirectAddressingMode.java | 2 +- ...RegisterIndirectPostIncAddressingMode.java | 2 +- ...sRegisterIndirectPreDecAddressingMode.java | 2 +- ...rectWithDisplacementNewAddressingMode.java | 4 +- ...rectWithDisplacementOldAddressingMode.java | 4 +- ...terIndirectWithIndexNewAddressingMode.java | 8 +- ...terIndirectWithIndexOldAddressingMode.java | 8 +- ...rectWithDisplacementNewAddressingMode.java | 4 +- ...rectWithDisplacementOldAddressingMode.java | 4 +- ...terIndirectWithIndexNewAddressingMode.java | 8 +- ...terIndirectWithIndexOldAddressingMode.java | 8 +- .../psi/M68kRegisterListAddressingMode.java | 8 + .../plugins/m68k/psi/M68kRegisterRange.java | 20 ++ .../intellij/plugins/m68k/psi/M68kTypes.java | 3 + .../plugins/m68k/psi/M68kVisitor.java | 23 ++ ...WithDisplacementNewAddressingModeImpl.java | 2 +- ...WithDisplacementOldAddressingModeImpl.java | 2 +- ...ndirectWithIndexNewAddressingModeImpl.java | 10 +- ...ndirectWithIndexOldAddressingModeImpl.java | 10 +- ...WithDisplacementNewAddressingModeImpl.java | 2 +- ...WithDisplacementOldAddressingModeImpl.java | 2 +- ...ndirectWithIndexNewAddressingModeImpl.java | 10 +- ...ndirectWithIndexOldAddressingModeImpl.java | 11 +- .../M68kRegisterListAddressingModeImpl.java | 18 +- .../m68k/psi/impl/M68kRegisterRangeImpl.java | 52 +++ .../intellij/plugins/m68k/asm/M68kIsa.kt | 337 +++++++++++++----- .../platon42/intellij/plugins/m68k/m68k.bnf | 106 +++++- .../plugins/m68k/psi/M68kAddressModeUtil.kt | 30 +- .../plugins/m68k/psi/M68kPsiImplUtil.kt | 17 + .../psi/M68kWithAddressRegisterIndirect.kt | 6 + .../plugins/m68k/psi/M68kWithDisplacement.kt | 6 + .../plugins/m68k/psi/M68kWithIndexRegister.kt | 12 + .../m68k/parser/AddressingModesTest.kt | 23 +- .../addressingmodes/movem_register_list.txt | 23 +- 37 files changed, 680 insertions(+), 184 deletions(-) create mode 100644 src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kRegisterRange.java create mode 100644 src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kRegisterRangeImpl.java create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kWithAddressRegisterIndirect.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kWithDisplacement.kt create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kWithIndexRegister.kt diff --git a/README.md b/README.md index b0ab434..1e54b1a 100644 --- a/README.md +++ b/README.md @@ -42,14 +42,14 @@ it's "good enough" to get started, and I can return to demo coding with its curr - No support for register replacement (e.g. registers replaced by `EQUR` or `EQURL` will cause syntax errors) - While the Lexer supports the -spaces option (where a space introduces a comment), this cannot be configured yet (default is off). - No support for other processor instructions, FPU or 68020+ address modes. -- No semantic checking for allowed address modes or data widths yet. +- For versions < V0.4: No semantic checking for allowed address modes or data widths yet. - Unit Test coverage is not as good as it could be (ahem). - Missing but planned features: - Macro evaluation on invocation - Folding - - Semantic inspections - - Quick fixes - - Formatter + Code Style Settings + - Semantic inspections + - Quick fixes + - Formatter + Code Style Settings - Register use analysis (but this only makes sense after macro evaluation) - Cycle counting @@ -74,6 +74,7 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42. - New: Added inspection to validate the correctness of a MC68000 instruction regarding operation size and address modes. - Bugfix: Added several missing assembler directives (`opt`, `machine`, etc.). - Bugfix: Uppercase hexadecimal literals were not parsed (JFlex bug?). +- Bugfix: Interpretation of register lists was wrong in BNF. ### V0.3 (28-Jul-21) diff --git a/build.gradle b/build.gradle index d73041e..a047980 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,10 @@ dependencies { } compileKotlin { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xjvm-default=all" + } } compileTestKotlin { @@ -63,6 +66,7 @@ patchPluginXml {
  • New: Added inspection to validate the correctness of a MC68000 instruction regarding operation size and address modes.
  • Bugfix: Added several missing assembler directives (opt, machine, etc.).
  • Bugfix: Uppercase hexadecimal literals were not parsed (JFlex bug?). +
  • Bugfix: Interpretation of register lists was wrong in BNF.

    V0.3 (28-Jul-21)