GithubHelp home page GithubHelp logo

georgjz / motorola-68k-assembly Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 0.0 119 KB

A Language Extension for VS Code that adds syntax highlighting for the Motorola 68k and its variants. Supports multiple assemblers.

License: MIT License

vscode-extension assembly-language-programming 68000

motorola-68k-assembly's Introduction

Motorola 68000 Assembly Language Extension for VS Code

This is a Language Extension for Visual Studio Code. It adds syntax highlighting for the Motorola 68000 and its variants.

Supported Assemblers

Currently, this extension supports the following assemblers. In general, the grammar's name takes the form of "68k Assembly (assembler name)":

Planned support for:

  • m68k-elf-as
  • SNASM2
  • Sierra 68000 Assembler

This is not a complete list. If you have a wish or suggestion, please use the issue function of the GitHub repository to submit an assembler. If you provide a link to its documentation, that will speed things up.

Planned Features

  • Some kind of linter that will check for errors for the chosen assembler
  • Customization options for comments (think, ; vs * vs #)
  • Common snippets/macros for faster coding
  • A Z80 assembly injection for Sega Genesis/Mega Drive programming

Please feel free to submit an issue to make a suggestion. They're greatly appreciated.

Known Issues / Bugs

  • Grammars that uses * to mark comments: Arithmetic expressions (e.g., 4 + 6 * 8), that include * as an operator, are wrongly marked as comments.

If you find a bug or error, please submit an issue to this repository. A screenshot and informations about your system (OS, VS code version) will help a lot.

Release Notes

For more detailed changes, see CHANGELOG.md.

0.4.4

Minor bug fixes.

0.4.3

Minor bug fix.

0.4.2

Address size specifiers after symbols/labels and registers are highlighted now.

0.4.1

Bunch of small bug fixes.

0.4.0

Added support for The Macroassembler AS.

0.2.1

Add m68k module directives to vasm grammars. Fix strings and escape command hightlighting in same grammars.

0.2.0

Add support for vasmm68k_std assembler.

0.1.0

Initial release. Only supports vasm.

motorola-68k-assembly's People

Contributors

georgjz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

motorola-68k-assembly's Issues

Choose the default language variant

Hi,
Everytime I open a source file it is identified as "Coldfire 68k Assembly (codewarrior)".
I can switch it to my preferred variant "68k Assembly (vasmm68k_mot)", but I have to do that to every file I open.
Is it possible to add a setting for choosing the default variant, or set the latest selected variant as the default ?
thanks for this great extension
bye,
François

Missing highlighting on a few instructions

I created a large file for AS with the intent of testing the 68k cycle byte counter extension you mentioned in issue #25, and I came across a few instructions that are missing highlighting:

These are missing highlighting on the .l:

bchg.l	d0,d0
bchg.l	#i5,d0

(the other bit instructions highlight it correctly)

The following are not highlighted at all:

shs.b	<ea>	; Alias for scc.b	<ea>
slo.b	<ea>	; Alias for scs.b	<ea>
sbcd.b	d0,d0
sbcd.b	-(a0),-(a0)
divs.w	<ea>,d0

Here, <ea> stands for any addressing mode supported by the instructions (which can be seen in the file above).

All other instructions are highlighted, including abcd and divu.

Autocompletion after suffixed instructions

Hi,
When I type an instruction with a .b, .w, or .l suffix, and then I press [Tab] to type the operands, instead of getting a Tab character vscod[e|ium] consider the suffix is the beginning of a new word and it tries to autocomplete it.
So before being able to insert a tab character I have to press Esc first.
I don't know how to fix this without disabling autocompletion.
Help !
and thanks for that great extension.
François

Support for AS

I would like to suggest adding support for AS. If it helps, there is a z80 extension which supports it, and could be used to speed up writing the grammar and adding z80 support for z80 injection.

From what I understand, it might also be possible to make your extension depend on that extension, and delegate to it in z80 portions, which would make things even simpler. I know that some c++ extensions do that, but I am not well versed in extension development.

Usage of `#` marks text as comment

While using "vasmmot" syntax check and when providing immediate values the whole line is marked as comment like you would see in shell scripting.

Examples showing the behavior:

Captura de pantalla 2020-09-02 a las 12 50 08

Allow for injection of Z80 code

Several assemblers (here, AS) allow to mix 68k and Z80 code in one file. Allow for injection and highlighting of Z80 code.

Things get highlighted inside strings

For example, in this fragment:

    dc.b    "Unhandled trap #0,d0 was triggered"

trap and d0 appear highlighted. This happens for all grammars. I noticed this in my debugger. Size specifiers (.b, .w, .l, .s) are also highlighted inside strings.

Register names are not highlighted correctly

Register names (a0 - a7, d0 - d7, etc.) are not highlighted correctly. Only lower-case names (e.g., a5) are highlighted, but not upper-case name (e.g., A5). This is only correct behavior for Standard Syntax, not Motorola.

The Motorola syntax should highlight both lower- and upper-case register names.

Support for alternate condition code spellings

Several assemblers support a (non-standard) spelling for some condition codes in bCC, dbCC and sCC instructions. Specifically, the following condition codes have alternate spellings:

  • carry set: standard spelling is cs, non-standard is lo ("lower")
  • carry clear: standard spelling is cc, non-standard is hs ("higher or same)

Idea: Cycle/byte counter

I recently came across this extension for z80 which gives a cycle and size counter for z80 code. And I thought it might be a good idea to have something like this for the 68k as well, and it might be a good idea to fold this into the grammar since it has to be able to parse the assembly for colorizing anyway.

If you agree that this is a good idea, a good source for 68k instruction cycle counts is this document, which is more accurate to real hardware than official documentation (fyi, this is not my document, I am just mirroring it).

Highlighting of effective address with size

There are two cases here:

  • Absolute addresses:
    move.l  (Address).w, d1
    move.l  (Address).l, d1
  • Indexed addresses
    move.l  6(a0, d0.w), d1
    move.l  6(a0, d0.l), d1

In both of those, the effective address size specifier is not highlighted. Specifically, what I am asking for is that these get highlighted:

  • the .w and .l in (Address).w or (Address).l in absolute addresses
  • the .w and .l in d0.w or d0.l in indexed effective addresses

Missing instructions

This is a list of missing instructions for 68k and variants:

  • absw that's a macro
  • bhs
  • blo
  • divu
  • bchg

Inconsistent highlighting of bCC.s

Neither of bra.s and bsr.s highlights the .s, whereas (say) bne.s does. In my tests, this happens for all grammars, and all bCC.s highlitght the .s. The grammars do highlight the non-standard bra.b and bsr.b.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.