2021-07-30 14:05:37 +02:00
# MC68000 Assembly Language Plugin [![Build Status](https://travis-ci.com/chrisly42/mc68000-asm-plugin.svg?branch=main)](https://travis-ci.com/chrisly42/mc68000-asm-plugin) [![Coverage Status](https://coveralls.io/repos/github/chrisly42/mc68000-asm-plugin/badge.svg?branch=main&kill_cache=1)](https://coveralls.io/github/chrisly42/mc68000-asm-plugin?branch=main)
2021-07-20 12:54:44 +02:00
_MC68000 Assembly Language Plugin_ is plugin for Jetbrains IDEs (CLion, IntelliJ, etc.).
![Example Syntax Highlighting ](docs/syntaxhighlighting.png "Example Syntax Highlighting" )
## Purpose
This plugin delivers support for MC68000 assembly language files ([VAsm](http://sun.hasenbraten.de/vasm/) / DevPac-Style).
It adds a language parser with syntax highlighting, referencing and refactoring support, and a few more features.
I'm an Amiga retro democoder, and the lack of a plugin for M68k was the motivation to write one. Also, diving deep into custom language plugins has a steep
learning curve.
When I started the plugin in July 2021, I was not aware of the [M68k plugin efforts by Jetbrains employee Yann Cébron ](https://github.com/YannCebron/m68kplugin )
who has been working on the same topic for quite some time. At the time of writing, his plugin however, has not been release yet. Nevertheless, it has a lot of
awesome features and is pretty advanced. Check it out. You can install both plugins at the same time and see what suits you more.
Big kudos to Yann -- a few features were _inspired_ by his code.
2021-08-01 19:51:42 +02:00
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
2021-07-20 12:54:44 +02:00
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
2021-08-01 19:51:42 +02:00
- Inspection for validating the syntax the 68000 ISA.
2021-07-20 12:54:44 +02:00
- Syntax highlighting and Color Settings Page (you should really modify the color settings to your likings!)
- Mnemonics code completion
2021-07-28 08:00:09 +02:00
- Symbols / Labels / Macros code completion
- References / Refactoring support for local and global labels, symbol assignments, and macros.
2021-07-20 12:54:44 +02:00
- Brace matching
- Quote handler
- Goto Symbol support
- Structure view
2021-08-01 19:51:42 +02:00
- Documentation provider for symbol definitions and mnemonics (listing available addressing modes etc.).
2021-07-20 12:54:44 +02:00
## Known issues
2021-07-28 08:00:09 +02:00
- `Find Usages` always shows _"Unclassified"_ though it shouldn't (?)
2021-07-20 12:54:44 +02:00
- Macro invocations are not yet evaluated, thus no referencing to symbols defined via macros (e.g. `STRUCT` ).
- No support for includes. Scoping is for global symbols and labels is currently the whole project.
- No support for register replacement (e.g. registers replaced by `EQUR` or `EQURL` will cause syntax errors)
2021-07-28 08:00:09 +02:00
- While the Lexer supports the -spaces option (where a space introduces a comment), this cannot be configured yet (default is off).
2021-07-20 12:54:44 +02:00
- No support for other processor instructions, FPU or 68020+ address modes.
- Unit Test coverage is not as good as it could be (ahem).
- Missing but planned features:
2021-07-28 08:00:09 +02:00
- Macro evaluation on invocation
2021-07-20 12:54:44 +02:00
- Folding
2021-08-01 10:08:01 +02:00
- Semantic inspections
- Quick fixes
- Formatter + Code Style Settings
2021-07-20 12:54:44 +02:00
- Register use analysis (but this only makes sense after macro evaluation)
2021-07-28 08:00:09 +02:00
- Cycle counting
2021-07-20 12:54:44 +02:00
2021-07-26 10:50:22 +02:00
## Recommendations
Currently, I would suggest using the fabulous [Browse Word at Caret Plugin ](https://plugins.jetbrains.com/plugin/201-browsewordatcaret )
to highlight the same address and data registers while editing (see new `View -> Highlight Word at Caret` menu item).
2021-07-20 12:54:44 +02:00
## Development notice
2021-07-26 10:50:22 +02:00
This plugin has been written in Kotlin 1.5 using Grammar-Kit.
2021-07-20 12:54:44 +02:00
It is probably the only plugin (besides [Cajon ](https://github.com/chrisly42/cajon-plugin ) from the same author) that uses JUnit 5 Jupiter for unit testing so
far (or at least the only one I'm aware of ;) ). The IntelliJ framework actually uses the JUnit 3 TestCase for plugin testing, and it took me quite a while to
make it work with JUnit 5. Feel free to use the code (in package ```de.platon42.intellij.jupiter```) for your projects (with attribution).
## Changelog
2021-07-30 14:05:37 +02:00
### V0.4 (unreleased)
2021-08-01 19:51:42 +02:00
- Notice: Due to major new API use, this plugin no longer works on IDEs >=2019.3.1, but rather requires >=2020.3.
2021-07-30 15:23:08 +02:00
- Enhancement: Added Structure View filters.
2021-07-31 13:56:07 +02:00
- New: Added inspection to validate the correctness of a MC68000 instruction regarding operation size and address modes.
2021-07-31 14:12:58 +02:00
- Bugfix: Added several missing assembler directives (`opt`, `machine` , etc.).
- Bugfix: Uppercase hexadecimal literals were not parsed (JFlex bug?).
2021-08-01 10:08:01 +02:00
- Bugfix: Interpretation of register lists was wrong in BNF.
2021-08-01 19:51:42 +02:00
- New: Added Documentation Provider for symbol definitions (shows assigned declaration).
- New: Added Documentation Provider for mnemonics (simple version, generated out of ISA information).
2021-07-30 14:05:37 +02:00
2021-07-28 08:00:09 +02:00
### V0.3 (28-Jul-21)
2021-07-27 12:42:26 +02:00
2021-07-27 20:00:45 +02:00
- Enhancement: Macro contents are no longer parsed, added syntax highlighting options for macros.
2021-07-27 16:34:49 +02:00
- Enhancement: Macro definitions are now word and stub indexed, macro calls reference to definition.
2021-07-31 13:56:07 +02:00
- New: Macro definition refactoring and find usages support.
2021-07-27 16:34:49 +02:00
- Enhancement: Structural View also shows macro definitions.
- Bugfix: Missing REPT and ENDR assembler directives added.
- Cosmetics: Changed or added some icons at various places.
- Performance: Reference search for global labels and symbols now uses stub index.
2021-07-27 20:00:45 +02:00
- Compatibility: Restored compatibility with IDE versions < 2021.1.
- Performance: Optimized lexer.
2021-07-27 12:42:26 +02:00
2021-07-27 08:01:03 +02:00
### V0.2 (27-Jul-21)
2021-07-26 10:50:22 +02:00
2021-07-26 10:59:40 +02:00
- Cosmetics: Added (same) icon for plugin as for file type.
2021-07-28 08:00:09 +02:00
- Performance: Use Word-Index for global labels and symbols instead of iterating over the file.
- Performance: Use Stub-Index for global labels and symbols.
2021-07-26 19:52:48 +02:00
- Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line.
- Enhancement: Registers are now offered for code completion, making editing less annoying.
2021-07-26 10:50:22 +02:00
2021-07-20 17:19:38 +02:00
### V0.1 (20-Jul-21)
2021-07-20 12:54:44 +02:00
2021-07-20 14:25:41 +02:00
- Initial public release.