doinkythederp / nasm-language-support

Visual Studio Code extension offering language features for NASM Assembly
https://marketplace.visualstudio.com/items?itemName=doinkythederp.nasm-language-support
ISC License
7 stars 2 forks source link

Update REGEX and add AVX instructions and Registers #17

Open GabrielFrigo4 opened 2 months ago

GabrielFrigo4 commented 2 months ago

Instruction Set Advanced Vector Extensions AVX Registers

In this PL I basically improved the regex, added the instructions that I saw were missing and added the registers AVX512 xmm0...31 ymm0...31 zmm0...31

GabrielFrigo4 commented 2 months ago

Just to make sure that we are not inserting a flaw in the parser (at line 19), that would not flag errors in syntax.

Does the assembler language support mixed lower and upper case letter for instructions ? I could not find any references besides some for software developers using all Caps or all lowercases instructions syntax.

Is it possible to simulate the previous behaviors of All Caps or All Lowercases with a shortcut regex syntax ?

Or should we let this because it seems to greatly simplified the parser regex.

I simply created an assembly file with commands like "MoV" or "dB" and it just worked :)

doinkythederp commented 2 months ago

I'm not available to do a real review/merge right now, but can you confirm whether these changes work with instructions that begin with the name of another instruction (e.g. orpd)?

GabrielFrigo4 commented 2 months ago

I'm not available to do a real review/merge right now, but can you confirm whether these changes work with instructions that begin with the name of another instruction (e.g. orpd)?

It's really not well documented, but these 3 links to me already show that in terms of instruction, registes, macros... are not case sensitive When to use Capitalized Letters NASM Is Case-Sensitive -> Only label Basic Elements of NASM Assembler

And in the case of orpd, it also doesn't change the final result if it's orpd, orpD, oRpd...

GabrielFrigo4 commented 2 months ago

In the NASM repository, there are these files that have all the instructions, logs, macros that NASM supports ... nasm/x86/insns.dat -> Instructions nasm/x86/regs.dat -> Registers nasm/asm/directiv.dat -> Directives nasm/asm/pptok.dat -> Tokens 1.0? nasm/asm/tokens.dat -> Tokens 2.0?

I discovered these files recently. I plan to make a new PR following their information... If you want to cancel this PR or accept it, it would be cool... Since I don't know if it will be interesting to add more commits for this PR (it might get confused by several changes)