[Geany] filedefs.asm for mips isa

Jason Oster parasytic at xxxxx
Fri Oct 10 15:01:55 UTC 2008


Enrico Tröger wrote:
...snip...
>> So is $a0 a register (MIPS) or a hex number (MOS 6502/6581)? I think 
>> these need to be made more generic, too. ;)
> 
> How?
> No idea what MOS 6502/6581 is but it is widely used? I think in
> general it doesn't make much sense to support every single minor ASM
> dialect in the lexer. Providing support for the main variants should be
> good enough, IMO.
> And in particular, I assume Neil thinks similar about this.

6502 is the 8-bit CPU used in Nintendo NES, Commodore 64, and several 
Atari systems. 65816 was the 16-bit upgrade used in SNES. ;) It's not 
used today outside of hobbyist projects like emulators and homebrew games.

As for how to differentiate between a 6502 numeric hex value and a MIPS 
register? The ASM lexer already supports register keywords; just add $a0 
etc to it. That takes care of the MIPS case. I think a preference for 
specifying valid number characters is a very simple way to handle the 
6502 case.

Default: lex.asm.numerals = "0123456789-."

The lexer would then parse "words" on whitespace and check that they 
only contain (in this example) numbers, hyphen (negative) and period 
(decimal points). If it matches, it's styled as a number. To support hex:

lex.asm.numerals = "0123456789abcdefxh-."

And for 6502, you just have to add $ to the hex example. This level of 
configurability I think is not too difficult to achieve. I have been 
thinking about such problems with the ASM lexer for many months, now. ;)

I wanted to use Scintilla for a project of my own, at one point. I'm now 
looking into getting similar functionality out of XULRunner; the Mozilla 
platform which Firefox is built on. (But that's another topic!) It's 
still possible to embed Scintilla into XULRunner (Komodo does this) so 
I'm still interested in discussing possibilities of improving Scintilla.

> And further more, this discusion should move to the Scintilla list/bug
> tracker as this not directly Geany-specific but more an issue of the
> Scintilla ASM lexer.

I agree, here! I'll start an initial post on scintilla-interest for the 
ASM lexer. But I hope it gets more attention than the CSS thread! :P

Jay



More information about the Users mailing list