diff --git a/README.md b/README.md index bbcb218..c9aebd7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ _MC68000 Assembly Language Plugin_ is plugin for Jetbrains IDEs (CLion, IntelliJ, etc.). -![Example Syntax Highlighting](docs/syntaxhighlighting.png "Example Syntax Highlighting") +![Example IDE Screenshot](docs/example.png "Example IDE Screenshot") ## Purpose @@ -19,13 +19,13 @@ awesome features and is pretty advanced. Check it out. You can install both plug Big kudos to Yann -- a few features were _inspired_ by his code. -My plugin, on the other hand, is still pretty basic and is the result of about two weeks of work. I released a really early first version it because I think -it's "good enough" to get started, and I can return to demo coding with its current state. +My plugin, on the other hand, is still pretty basic and is the result of a few weeks of work. I released a really early first version it because I think it's " +good enough" to get started, and I can return to demo coding with its current state. ## Features - Parser / Lexer for MC68000 (yes, only 68000 right now!) assembly language files in VAsm / DevPac style -- Inspection for validating the syntax the 68000 ISA. +- Inspection for validating the syntax of the 68000 ISA. - Syntax highlighting and Color Settings Page (you should really modify the color settings to your likings!) - Mnemonics code completion - Symbols / Labels / Macros code completion @@ -46,7 +46,7 @@ it's "good enough" to get started, and I can return to demo coding with its curr - 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. - Unit Test coverage is not as good as it could be (ahem). -- `opt` keyword needs special treatment and will currently show a parsing error +- `opt` keyword needs special treatment and will currently show a parsing error. - Missing but planned features: - Macro evaluation on invocation - Folding @@ -71,6 +71,11 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42. ## Changelog +### V0.5 (unreleased) + +- Bugfix: `movem` ISA was wrong regarding the `movem.w ,` (sign extends registers). +- Cosmetics: Changed Register Flow Documentation wording from _reads_ to _uses_ and from _modifies_ to _changes_. + ### V0.4 (03-Aug-21) - Notice: Due to major new API use, this plugin no longer works on IDEs >=2019.3.1, but rather requires >=2020.3. diff --git a/build.gradle b/build.gradle index 8660444..36d65aa 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ plugins { } group = 'de.platon42' -version = '0.4' +version = '0.5' sourceCompatibility = "1.8" targetCompatibility = "1.8" @@ -57,6 +57,11 @@ runPluginVerifier { patchPluginXml { setChangeNotes(""" +

V0.5 (unreleased)

+

V0.4 (03-Aug-21)

-

V0.2 (27-Jul-21)

-

Full changelog available at Github project site.

""") } diff --git a/docs/example.png b/docs/example.png new file mode 100644 index 0000000..9bc8f4e Binary files /dev/null and b/docs/example.png differ diff --git a/docs/syntaxhighlighting.png b/docs/syntaxhighlighting.png deleted file mode 100644 index 8f2166d..0000000 Binary files a/docs/syntaxhighlighting.png and /dev/null differ diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kIsa.kt b/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kIsa.kt index f875fd0..507ed5e 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kIsa.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/asm/M68kIsa.kt @@ -283,7 +283,7 @@ object M68kIsa { ), setOf(AddressMode.REGISTER_LIST, AddressMode.ADDRESS_REGISTER_DIRECT, AddressMode.DATA_REGISTER_DIRECT), OP_SIZE_WL, - modInfo = RWM_READ_OP1_OPSIZE or RWM_SET_OP2_OPSIZE + modInfo = RWM_READ_OP1_OPSIZE or RWM_SET_OP2_L ), // according to Yann, specifying the registers as bitmask is also valid AllowedAdrMode( diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProvider.kt b/src/main/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProvider.kt index 6bf482c..5c77b41 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProvider.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProvider.kt @@ -189,12 +189,12 @@ class M68kRegisterFlowDocumentationProvider : AbstractDocumentationProvider() { private fun rwmToDisplayText(rwm: Int, rn: String) = when (rwm) { - RWM_READ_B -> "reads $rn.b" - RWM_READ_W -> "reads $rn.w" - RWM_READ_L -> "reads $rn.l" - RWM_MODIFY_B -> "modifies $rn.b" - RWM_MODIFY_W -> "modifies $rn.w" - RWM_MODIFY_L -> "modifies $rn.l" + RWM_READ_B -> "uses $rn.b" + RWM_READ_W -> "uses $rn.w" + RWM_READ_L -> "uses $rn.l" + RWM_MODIFY_B -> "changes $rn.b" + RWM_MODIFY_W -> "changes $rn.w" + RWM_MODIFY_L -> "changes $rn.l" RWM_SET_B -> "sets $rn.b" RWM_SET_W -> "sets $rn.w" RWM_SET_L -> "sets $rn.l" diff --git a/src/test/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProviderTest.kt b/src/test/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProviderTest.kt index 2dd5650..a31a9af 100644 --- a/src/test/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProviderTest.kt +++ b/src/test/java/de/platon42/intellij/plugins/m68k/documentation/M68kRegisterFlowDocumentationProviderTest.kt @@ -11,7 +11,7 @@ import org.junit.jupiter.api.extension.ExtendWith internal class M68kRegisterFlowDocumentationProviderTest : AbstractDocumentationProviderTest() { @Test - internal fun check_documentation_for_a_register_in_code_flow(@MyFixture myFixture: CodeInsightTestFixture) { + internal fun check_documentation_for_a_read_register_in_code_flow(@MyFixture myFixture: CodeInsightTestFixture) { myFixture.configureByText( "documentme.asm", """ label @@ -34,7 +34,7 @@ nextlabel assertThat(generateDocumentation(myFixture)) .isEqualToIgnoringWhitespace( """ -
move instruction reads d0.w
+
move instruction uses d0.w
@@ -44,7 +44,7 @@ nextlabel - + @@ -56,7 +56,7 @@ nextlabel - + @@ -66,7 +66,7 @@ nextlabel - + @@ -76,7 +76,7 @@ nextlabel - + @@ -96,7 +96,88 @@ nextlabel
        
         add.w #1,d0 ; modifies d0.w ; changes d0.w
 
         move.w d0,d1 ; reads d0.w ; uses d0.w
        
         addq.b #1,d0 ; modifies d0.b ; changes d0.b
-->
         move.l d0,d2 ; reads d0.l ; uses d0.l
  ; sets d0.l
- """.trimIndent() +""" + ) + } + + + @Test + internal fun check_documentation_for_a_written_register_in_code_flow(@MyFixture myFixture: CodeInsightTestFixture) { + myFixture.configureByText( + "documentme.asm", """ +label + moveq.l #0,d0 + add.w #1,d0 + move.l d1,-(sp) + move.w d0,d1 + move.b d2,d0 + addq.b #1,d0 + move.w d0,d1 + move.l d0,d2 + move.w d1,d2 + clr.b d0 + moveq.l #0,d0 + move.l (sp)+,d1 + rts +nextlabel +""" + ) + assertThat(generateDocumentation(myFixture)) + .isEqualToIgnoringWhitespace( + """ +
move instruction sets d1.w
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
label
        move.l d1,-(sp) ; uses d1.l
        move.w d0,d1 ; sets d1.w
  +
[...]
+
 
-->move.w d0,d1 ; <--
  +
[...]
+
 
        move.w d1,d2 ; uses d1.w
  +
[...]
+
 
        move.l (sp)+,d1 ; sets d1.l
+""" ) } } \ No newline at end of file