Menu

#1830 Assembly language omissions

Bug
open
nobody
None
5
2016-05-16
2016-05-14
felix
No

The variables in the asm.properties file contain a number of omissions, causing SciTE to fail to highlight many common (and some less common) x86 mnemonics, registers and directives. There are also a few misplaced mnemonics and registers.

Omissions which are definitely errors:
The segment registers cs, ds, es, ss are not listed at all. The gs register is listed in register_64, despite being available since i386. sp is also not recognised as a register; on the other hand, ebx is listed twice.
The lods, ins and outs families of mnemonics. movsd is erroneously listed in sse_instruction.
Many commonly used instructions: among them cli, sti, int, iret, rdmsr/wrmsr, in, out, sysenter, sysexit, syscall, sysret.
More obscure instructions, like ud2, clac, clts, clflush, wrfsbase/wrgsbase, arpl, adcx, rsm, vmcall. Neither this or the previous item are exhaustive. (I used http://www.felixcloutier.com/x86/ to look up some of these, but it's not complete either.)
The forms wait, setalc, loopd, loopw, retf and retn which are recognised by some assemblers. (fwait, salc, and plain loop and ret are recognised).
Transactional instruction mnemonics.

Less justifiable items:
The unsuffixed forms of the string instruction mnemonics (literal movs, cmps, scas, etc.) which are used in official Intel documentation. (This omission may be actually helpful; some people may wish not to use them, so not highlighted them will show the mistake.)
Undocumented instructions: icebp, loadall, loadall286, ud1.
* TASM directives if, ifdef, else, endif, extrn, ptr, assume, label, offset, end, ends, title, locals, short. I'm not sure if this list is exhaustive either. (At least short is also a known by NASM.)

Also, should an AT&T-syntax lexer be added, it'd need catch .S, .s and .sx extensions. Right now, only .s is listed in file.patterns.as.

Discussion

  • Kein-Hong Man

    Kein-Hong Man - 2016-05-15

    I am a contributor, well I have updated the properties file in the past, but have not done so for years now. So very few people are actively using asm highlighting. Anyway I think a lot of highlighting code need to be added to support S assembly files without users complaining, the project welcomes contributors for that :-)

    The best path forward would be for you to make the updates to your liking, then contribute it back to the project. You can post a patch or the entire file to this ticket. Fewer people know older 8086 stuff these days, and for fellas like me, most of the details have leaked out of my brain long ago. You can put the mnemonics into sets and collect a suitable default set for out-of-the-box users, that is what I do for Lua, I set a promicuous default set of names and nobody has complained yet. :-)

     
  • Neil Hodgson

    Neil Hodgson - 2016-05-16

    There was some work on a GNU as lexer at [feature-requests:#1072].

     

    Related

    Feature Requests: #1072


Log in to post a comment.