1
0
mirror of https://github.com/pfusik/xasm.git synced 2024-12-22 00:29:15 +00:00
xasm/doc/editors.htm
2013-01-07 12:07:31 +01:00

137 lines
6.1 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Configuring editors for xasm</title>
<meta name="Author" content="Piotr Fusik"/>
</head>
<body>
<h2>How to configure a text editor for a convenient use of xasm</h2>
<p>This document describes, how to setup a text editor to:</p>
<ul>
<li>highlight xasm mnemonics</li>
<li>invoke the assembler with a single keystroke</li>
<li>place the cursor where an assembly error occured</li>
</ul>
<p>Of course these features are not available in the <i>Windows Notepad</i>,
so you must pick another text editor. Fortunately there are many
general-purpose text editors for Windows. I'll focus on the following:</p>
<ul>
<li><i>EditPlus</i>
(<a href="http://www.editplus.com">www.editplus.com</a>)</li>
<li><i>ConTEXT</i>
(<a href="http://www.context.cx">www.context.cx</a>)</li>
<li><i>Code-Genie</i>
(<a href="http://www.code-genie.com">www.code-genie.com</a>,
looks like the editor is no longer supported)</li>
<li><i>PSPad</i>
(<a href="http://www.pspad.com">www.pspad.com</a>)</li>
<li><i>Programmers Notepad 2</i>
(<a href="http://www.pnotepad.org">www.pnotepad.org</a>)</li>
<li><i>Crimson Editor</i>
(<a href="http://www.crimsoneditor.com">www.crimsoneditor.com</a>)</li>
<li><i>SciTE</i>
(<a href="http://www.scintilla.org">www.scintilla.org</a>),
also available for Linux</li>
</ul>
<h3>Highlighting xasm mnemonics</h3>
<p>In the <tt>syntax</tt> subdirectory you'll find xasm syntax definitions
for all of these editors.</p>
<ul>
<li><i>EditPlus</i>:
Select <b>Tools/Preferences</b>, then <b>Files/Settings &amp; syntax</b>,
then <b>Add</b>. Type <b>Description</b> (<tt>xasm</tt>),
<b>File extensions</b> (<tt>asx</tt>), click <b>...</b> next to <b>Syntax
file</b> and locate the <tt>xasm.stx</tt> file. Then click
<b>Syntax colors</b> and select your favourite colors.</li>
<li><i>ConTEXT</i>: Just copy <tt>xasm.chl</tt>
to the <tt>Highlighters</tt> subdirectory of the <i>ConTEXT</i>
directory.</li>
<li><i>Code-Genie</i>:
Copy <tt>xasm.cgsyn</tt> to the <tt>syn</tt> subdirectory in the
<i>Code-Genie</i> directory. Edit <tt>cgenie.conf</tt>, you can do it by
selecting <b>View/Settings</b>. Type:<br/>
<tt>DefaultSyntax&nbsp;xasm&nbsp;asx</tt><br/>
near other <tt>DefaultSyntax</tt> lines.</li>
<li><i>PSPad</i>: Copy <tt>xasm.ini</tt> to the
<tt>Syntax</tt> subdirectory of the <i>PSPad</i> directory. Edit
<tt>PSPad.ini</tt>. In the <tt>[Config]</tt> section set:<br/>
<tt>UserHighLighterName=xasm</tt><br/>
In the <tt>[General]</tt> section set:
<pre>Filter=xasm (*.asx)|*.asx
HLTabWidth=0
IndentChar=
UnIndentChar=
Comment=0000800080000005000
Identifier=8000000880000005000
Key=00FF000080000005000
Label=0000000080000005000
Number=8000000880000005000
Preprocessor=0080800080000005010
Reserved word=00FF000080000005000
Space=0080800080000005000
String=0080008080000005000
Symbol=8000000880000005000
</pre></li>
<li><i>Programmers Notepad 2</i>: Copy <tt>xasm.scheme</tt>
to the <tt>schemes</tt> subdirectory of the <i>Programmers Notepad</i>
directory. You have to select the xasm scheme each time you open a source
file, as I don't know how to associate the scheme with the <tt>asx</tt>
extension.</li>
<li><i>Crimson Editor</i>: Copy <tt>xasm.key</tt>
and <tt>xasm.spc</tt> to the <tt>spec</tt> subdirectory
of the <i>Crimson Editor</i>. Copy <tt>extension.asx</tt> to the <tt>link</tt>
subdirecory of the <i>Crimson Editor</i>.</li>
<li><i>SciTE</i>: Copy <tt>xasm.properties</tt> to the <i>SciTE</i> directory.
Add the following line to <tt>menu.language</tt> in <tt>SciTEGlobal.properties</tt>:
<pre>xasm|asx||\
</pre>
Add the following line at the end of <tt>SciTEGlobal.properties</tt>:
<pre>import xasm
</pre></li>
</ul>
<h3>Single-keystroke assembly</h3>
<ul>
<li><i>EditPlus</i>: Select <b>Tools/Configure User Tools</b>.
Then click <b>Add Tool</b>, type <b>Menu text</b> (<tt>xasm</tt>),
<b>command</b> (path to <tt>xasm.exe</tt>), <b>Argument</b>
(<tt>$(FilePath)</tt>) and <b>Initial directory</b>
(<tt>$(FileDir)</tt>). Check <b>Capture output</b>.</li>
<li> <i>ConTEXT</i>: Select <b>Options/Environment Options</b>, then
the <b>Execute Keys</b> tab. Click <b>Add</b>, type <tt>asx</tt>, click
e.g. <b>F9</b>, locate <tt>xasm.exe</tt> by pressing the <tt>...</tt> button
in the top-right corner. Type <b>Start in</b> (<tt>%p</tt>)
and <b>parameters</b> (<tt>%n</tt>). Check <b>Use short DOS names</b>
and <b>Capture console output</b>.
Type <b>Compiler output parser rule</b> (<tt>%n (%l)</tt>).</li>
<li><i>Code-Genie</i>: Select <b>View/Settings</b>, type:<br/>
<tt>AddUserTool&nbsp;xasm&nbsp;xasm.exe&nbsp;/p\s$FP&nbsp;CaptureOutput&nbsp;$FD</tt><br/>
near other <tt>AddUserTool</tt> lines (if <tt>xasm.exe</tt> is not on your
<tt>PATH</tt>, then you must type full path to it).</li>
<li><i>PSPad</i>: Edit the <tt>[General]</tt> section of <tt>PSPad.ini</tt>:
<pre>Compilator File=C:\U\XASM.EXE
Compilator Param=/q /o:%Dir%%Name%.xex %File%
Compilator LOG=
Compilator Run=C:\Atari\a800win\Atari800Win.exe -run %Dir%%Name%.xex
Compilator Help=
Compilator SaveAll=1
Compilator ParsLog=%F (%L) *
Compilator Capture=1
</pre>
(replace the paths to xasm and the emulator).</li>
<li> <i>Programmers Notepad 2</i>: Select <b>Tools/Add tools</b>. Select
<b>Scheme</b>: <tt>xasm</tt>. Click <b>Add</b>. Fill: <b>Name</b>,
<b>Command</b>, <b>Folder</b> (<tt>%d</tt>) and <b>Parameters</b> (<tt>%f</tt>).
For error parsing, you should fill a custom pattern on the <b>Console I/O</b>
tab. However, PN 2.0.5.48 <b>crashes</b> when entering <tt>"("</tt> !</li>
<li> <i>Crimson Editor</i>: Select <b>Tools/Conf. User Tools</b>. Select
an empty slot, fill <b>Menu Text</b>, <b>Command</b>, <b>Argument</b>
and <b>Initial Dir</b>. Check <b>Capture output</b>.</li>
<li> <i>SciTE</i>: The configuration is already in <tt>xasm.properties</tt>.</li>
</ul>
<h3>Placing the cursor where an assembly error occured</h3>
<p>This works same for all these editors: just double-click the line
with the error message.</p>
</body>
</html>