How to configure a text editor for convenient use of X-Assembler
This document describes, how to setup a text editor to:
- highlight X-Assembler mnemonics
- invoke the assembler with a single keystroke
- place the cursor where an assembly error occured
Of course these features are not available in Windows Notepad, so you must
pick another text editor. Fortunately there are many general-purpose text
editors for Windows. I'll fucus on three:
All of these have similar features. EditPlus is very good, unfortunately it is
shareware (you have to pay $30). The other editors are freeware. Personally
I prefer Code-Genie, which offers unique feature of editing binary files.
Highlighting X-Assembler mnemonics
In the syntax subdirectory you'll find X-Assembler syntax definitions for all
these editors.
- Installation for EditPlus:
Select Tools/Preferences, then Files/Settings & syntax,
then Add. Type Description (X-Assembler), File extensions
(asx), click ... next to Syntax file and locate
the xasm.stx file. Then click Syntax colors and select your
favourite colors.
- Installation for ConTEXT: Just copy X-Assembler.chl
to Highlighters subdirectory in the ConTEXT directory.
- Installation for Code-Genie:
Copy X-Assembler.cgsyn to syn subdirectory in the Code-Genie
directory. Edit cgenie.conf, you can do it by selecting
View/Settings. Type:
DefaultSyntax x-assembler asx
near other DefaultSyntax lines.
Single-keystroke assembly
- EditPlus: Select Tools/Configure User Tools.
Then click Add Tool, type Menu text (xasm), command
(path to xasm.exe), Argument ($(FilePath)) and Initial directory
($(FileDir)). Check Capture output.
- ConTEXT: Select Options/Environment Options, then
the Execute Keys tab. Click Add, type asx, click
e.g. F9, locate xasm.exe by pressing the ... button
in the top-right corner. Type Start in (%p)
and parameters (%n). Check Use short DOS names
and Capture console output.
Type Compiler output parser rule (%n (%l)).
- Code-Genie: Select View/Settings, type:
AddUserTool xasm xasm.exe /p\s$FP CaptureOutput $FD
near other AddUserTool lines (if xasm.exe is not on your
PATH, then you must type full path to it).
Placing the cursor where an assembly error occured
This works same for all these three editors: just double-click the line
with the error message.
Back