Page 1 of 1

GNU AS (At&t) for Notepad++

Posted: Mon Nov 17, 2014 7:36 pm
by rom1nux
Hello,

I search for long time to get syntax highlighting for GNU Assembler (GAS,AT&T syntax) on Notepad++ and i found nothing...so i begin to write a simple bash script (write with Cygwin) to build a "User Defined Language". This script search into Binutils sources files to retrieve all keywords and generate XML file. This file can be to quickly imported into Notepad++. This is not an ideal solution but more than the original "Assembler" (Intel) provided with Notepad++. This script can build file to handle "i386" and "arm" syntaxe. (arm support is not completed yet).

To quickly add GAS user language file to Notepad++ :
  • Download gnuas_i386.zip or gnuas_arm.zip
  • Unzip the file to get the xml (UDL) file
  • Go to Notepad++ > Language > Define your language > Import
  • Select the xml file
  • Restart Notepad++
To build user language flle yourself from binutils directory :
  • Download npp_gnuas_builder.zip
  • Unzip the file to get the bash script
  • Look at the script header for configuration
  • Run npp_gnuas_builder.sh like

    Code: Select all

    npp_gnuas_builder.sh       # Show script usage
    npp_gnuas_builder.sh all   # Build all language definition
    npp_gnuas_builder.sh i386  # Build i386 language definition
    npp_gnuas_builder.sh arm   # Build arm language definition
    
Here is builder outpout showing the supported keywords count :

Code: Select all

--------------------------------------------------------
  NOTEPAD++ GNU-AS USER DEFINED LANGUAGE BUILDER V0.03
--------------------------------------------------------

      [I386]
-Building registers list...
 281 registers
-Building opcodes list...
 2408 opcodes
-Building directives list...
 195 directives
-Building operators list...
 35 operators
-Building archs list...
 98 archs
-Building preprocessor directives list...
 17 preprocessor directives
-Building xml file...
 File 'gnuas_i386.xml' ready !

      [ARM]
-Building registers list...
 46 registers
-Building opcodes list...
 1352 opcodes
-Building directives list...
 214 directives
-Building operators list...
 35 operators
-Building archs list...
 164 archs
-Building preprocessor directives list...
 17 preprocessor directives
-Building xml file...
 File 'gnuas_arm.xml' ready !
I hope this will be helpful...