mirror of
https://github.com/pfusik/xasm.git
synced 2025-01-13 06:29:44 +00:00
xasm 3.0.1 release.
This commit is contained in:
parent
66501ef2fd
commit
fa25272ccd
136
doc/editors.htm
136
doc/editors.htm
@ -1,136 +0,0 @@
|
|||||||
<!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 & 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 xasm 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 xasm xasm.exe /p\s$FP CaptureOutput $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>
|
|
@ -1,2 +0,0 @@
|
|||||||
LANGSPEC:XASM.SPC
|
|
||||||
KEYWORDS:XASM.KEY
|
|
@ -1,56 +0,0 @@
|
|||||||
# xasm syntax for Code-Genie 3.0 (www.code-genie.com)
|
|
||||||
# written by Piotr Fusik <fox@scene.pl>
|
|
||||||
|
|
||||||
CaseInsensitive true
|
|
||||||
|
|
||||||
FgColor #000000
|
|
||||||
|
|
||||||
BlockStart comment1 *\s
|
|
||||||
BlockEnd comment1 \n
|
|
||||||
Format comment1 b
|
|
||||||
FgColor comment1 #009300
|
|
||||||
|
|
||||||
BlockStart comment2 ;
|
|
||||||
BlockEnd comment2 \n
|
|
||||||
FgColor comment2 #009300
|
|
||||||
|
|
||||||
BlockStart comment3 |\s
|
|
||||||
BlockEnd comment3 \n
|
|
||||||
FgColor comment3 #009300
|
|
||||||
|
|
||||||
BlockStart string1 '
|
|
||||||
BlockEnd string1 \n
|
|
||||||
BlockEnd string1 '
|
|
||||||
BlockNotEnd string1 ''
|
|
||||||
FgColor string1 #800080
|
|
||||||
|
|
||||||
BlockStart string2 "
|
|
||||||
BlockEnd string2 \n
|
|
||||||
BlockEnd string2 "
|
|
||||||
BlockNotEnd string2 ""
|
|
||||||
FgColor string2 #800080
|
|
||||||
|
|
||||||
KeywordGroup keywords
|
|
||||||
adc add and asl bcc bcs beq bit
|
|
||||||
bmi bne bpl brk bvc bvs clc cld
|
|
||||||
cli clv cmp cpx cpy dec dex dey
|
|
||||||
dta eif eli els end eor equ ert
|
|
||||||
icl ift inc ini ins inw inx iny
|
|
||||||
jcc jcs jeq jmi jmp jne jpl jsr
|
|
||||||
jvc jvs lda ldx ldy lsr mva mvx
|
|
||||||
mvy mwa mwx mwy nop opt ora org
|
|
||||||
pha php pla plp rcc rcs req rmi
|
|
||||||
rne rol ror rpl rti rts run rvc
|
|
||||||
rvs sbc scc scs sec sed sei seq
|
|
||||||
smi sne spl sta stx sty sub svc
|
|
||||||
svs tax tay tsx txa txs tya
|
|
||||||
FgColor keywords #0000ff
|
|
||||||
|
|
||||||
Nest comment1
|
|
||||||
Nest comment2
|
|
||||||
Nest comment3
|
|
||||||
Nest string1
|
|
||||||
Nest string2
|
|
||||||
Nest keywords
|
|
||||||
|
|
||||||
# eof
|
|
@ -1,55 +0,0 @@
|
|||||||
// xasm highlighter for ConTEXT v0.97.1 (www.fixedsys.com/context)
|
|
||||||
// written by Piotr Fusik <fox@scene.pl>
|
|
||||||
|
|
||||||
Language: xasm
|
|
||||||
Filter: xasm files (*.asx)|*.asx
|
|
||||||
HelpFile:
|
|
||||||
|
|
||||||
CaseSensitive: 0
|
|
||||||
|
|
||||||
LineComment: ;
|
|
||||||
BlockCommentBeg:
|
|
||||||
BlockCommentEnd:
|
|
||||||
|
|
||||||
IdentifierBegChars: a..z A..Z _
|
|
||||||
IdentifierChars: a..z A..Z _ 0..9
|
|
||||||
|
|
||||||
NumConstBegChars: 0..9
|
|
||||||
NumConstChars: 0..9 abcdefABCDEF
|
|
||||||
|
|
||||||
EscapeChar:
|
|
||||||
|
|
||||||
KeyWords1: adc add and asl bcc bcs beq bit
|
|
||||||
bmi bne bpl brk bvc bvs clc cld
|
|
||||||
cli clv cmp cpx cpy dec dex dey
|
|
||||||
dta eif eli els end eor equ ert
|
|
||||||
icl ift inc ini ins inw inx iny
|
|
||||||
jcc jcs jeq jmi jmp jne jpl jsr
|
|
||||||
jvc jvs lda ldx ldy lsr mva mvx
|
|
||||||
mvy mwa mwx mwy nop opt ora org
|
|
||||||
pha php pla plp rcc rcs req rmi
|
|
||||||
rne rol ror rpl rti rts run rvc
|
|
||||||
rvs sbc scc scs sec sed sei seq
|
|
||||||
smi sne spl sta stx sty sub svc
|
|
||||||
svs tax tay tsx txa txs tya
|
|
||||||
|
|
||||||
StringBegChar: '
|
|
||||||
StringEndChar: '
|
|
||||||
MultilineStrings: 0
|
|
||||||
|
|
||||||
UsePreprocessor: 0
|
|
||||||
|
|
||||||
CurrLineHighlighted: 0
|
|
||||||
|
|
||||||
SpaceCol: clWindowText clWindow
|
|
||||||
Keyword1Col: clBlue clWindow
|
|
||||||
Keyword2Col: clBlue clWindow
|
|
||||||
Keyword3Col: clBlue clWindow
|
|
||||||
IdentifierCol: clWindowText clWindow
|
|
||||||
CommentCol: clGreen clWindow
|
|
||||||
NumberCol: clWindowText clWindow
|
|
||||||
StringCol: clPurple clWindow
|
|
||||||
SymbolCol: clWindowText clWindow
|
|
||||||
PreprocessorCol: clWindowText clWindow
|
|
||||||
SelectionCol: clWhite clNavy
|
|
||||||
CurrentLineCol: clBlack clYellow
|
|
134
syntax/xasm.ini
134
syntax/xasm.ini
@ -1,134 +0,0 @@
|
|||||||
# xasm highlighter for PSPad 4.2.1 (pspad.zde.cz)
|
|
||||||
# written by Piotr Fusik <fox@scene.pl>
|
|
||||||
[Settings]
|
|
||||||
Name=xasm
|
|
||||||
HTMLGroup=0
|
|
||||||
FileType=*.asx
|
|
||||||
CommentString=
|
|
||||||
ANSIComment=0
|
|
||||||
PasComment=0
|
|
||||||
SlashComment=0
|
|
||||||
CComment=0
|
|
||||||
SpecComment=0
|
|
||||||
BasComment=1
|
|
||||||
FoxComment=0
|
|
||||||
REMComment=0
|
|
||||||
ExclComment=0
|
|
||||||
ByComment=0
|
|
||||||
SharpComment=0
|
|
||||||
SlashComment=0
|
|
||||||
PerCentComment=0
|
|
||||||
SinglQComment=0
|
|
||||||
DblQComment=0
|
|
||||||
SQLComment=0
|
|
||||||
SingleQuote=1
|
|
||||||
DoubleQuote=1
|
|
||||||
Preprocessors=0
|
|
||||||
IndentChar=
|
|
||||||
UnIndentChar=
|
|
||||||
TabWidth=0
|
|
||||||
[KeyWords]
|
|
||||||
ADC=
|
|
||||||
ADD=
|
|
||||||
AND=
|
|
||||||
ASL=
|
|
||||||
BCC=
|
|
||||||
BCS=
|
|
||||||
BEQ=
|
|
||||||
BIT=
|
|
||||||
BMI=
|
|
||||||
BNE=
|
|
||||||
BPL=
|
|
||||||
BRK=
|
|
||||||
BVC=
|
|
||||||
BVS=
|
|
||||||
CLC=
|
|
||||||
CLD=
|
|
||||||
CLI=
|
|
||||||
CLV=
|
|
||||||
CMP=
|
|
||||||
CPX=
|
|
||||||
CPY=
|
|
||||||
DEC=
|
|
||||||
DEX=
|
|
||||||
DEY=
|
|
||||||
EOR=
|
|
||||||
INC=
|
|
||||||
INW=
|
|
||||||
INX=
|
|
||||||
INY=
|
|
||||||
JCC=
|
|
||||||
JCS=
|
|
||||||
JEQ=
|
|
||||||
JMI=
|
|
||||||
JMP=
|
|
||||||
JNE=
|
|
||||||
JPL=
|
|
||||||
JSR=
|
|
||||||
JVC=
|
|
||||||
JVS=
|
|
||||||
LDA=
|
|
||||||
LDX=
|
|
||||||
LDY=
|
|
||||||
LSR=
|
|
||||||
MVA=
|
|
||||||
MVX=
|
|
||||||
MVY=
|
|
||||||
MWA=
|
|
||||||
MWX=
|
|
||||||
MWY=
|
|
||||||
NOP=
|
|
||||||
ORA=
|
|
||||||
PHA=
|
|
||||||
PHP=
|
|
||||||
PLA=
|
|
||||||
PLP=
|
|
||||||
RCC=
|
|
||||||
RCS=
|
|
||||||
REQ=
|
|
||||||
RMI=
|
|
||||||
RNE=
|
|
||||||
ROL=
|
|
||||||
ROR=
|
|
||||||
RPL=
|
|
||||||
RTI=
|
|
||||||
RTS=
|
|
||||||
RVC=
|
|
||||||
RVS=
|
|
||||||
SBC=
|
|
||||||
SCC=
|
|
||||||
SCS=
|
|
||||||
SEC=
|
|
||||||
SED=
|
|
||||||
SEI=
|
|
||||||
SEQ=
|
|
||||||
SMI=
|
|
||||||
SNE=
|
|
||||||
SPL=
|
|
||||||
STA=
|
|
||||||
STX=
|
|
||||||
STY=
|
|
||||||
SUB=
|
|
||||||
SVC=
|
|
||||||
SVS=
|
|
||||||
TAX=
|
|
||||||
TAY=
|
|
||||||
TSX=
|
|
||||||
TXA=
|
|
||||||
TXS=
|
|
||||||
TYA=
|
|
||||||
[ReservedWords]
|
|
||||||
DTA=
|
|
||||||
EIF=
|
|
||||||
ELI=
|
|
||||||
ELS=
|
|
||||||
END=
|
|
||||||
EQU=
|
|
||||||
ERT=
|
|
||||||
ICL=
|
|
||||||
IFT=
|
|
||||||
INI=
|
|
||||||
INS=
|
|
||||||
OPT=
|
|
||||||
ORG=
|
|
||||||
RUN=
|
|
@ -1,17 +0,0 @@
|
|||||||
[-COMMENT-:GLOBAL]
|
|
||||||
# xasm keyword file for Crimson Editor (www.crimsoneditor.com)
|
|
||||||
# written by Piotr Fusik <fox@scene.pl>
|
|
||||||
[KEYWORDS0:GLOBAL]
|
|
||||||
adc add and asl bcc bcs beq bit
|
|
||||||
bmi bne bpl brk bvc bvs clc cld
|
|
||||||
cli clv cmp cpx cpy dec dex dey
|
|
||||||
dta eif eli els end eor equ ert
|
|
||||||
icl ift inc ini ins inw inx iny
|
|
||||||
jcc jcs jeq jmi jmp jne jpl jsr
|
|
||||||
jvc jvs lda ldx ldy lsr mva mvx
|
|
||||||
mvy mwa mwx mwy nop opt ora org
|
|
||||||
pha php pla plp rcc rcs req rmi
|
|
||||||
rne rol ror rpl rti rts run rvc
|
|
||||||
rvs sbc scc scs sec sed sei seq
|
|
||||||
smi sne spl sta stx sty sub svc
|
|
||||||
svs tax tay tsx txa txs tya
|
|
@ -1,38 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- xasm scheme for Programmers Notepad 2 (http://www.pnotepad.org)
|
|
||||||
Written by Piotr Fusik <fox@scene.pl>
|
|
||||||
-->
|
|
||||||
<Scheme>
|
|
||||||
<keyword-classes>
|
|
||||||
<keyword-class name="xasm">
|
|
||||||
adc add and asl bcc bcs beq bit
|
|
||||||
bmi bne bpl brk bvc bvs clc cld
|
|
||||||
cli clv cmp cpx cpy dec dex dey
|
|
||||||
dta eif eli els end eor equ ert
|
|
||||||
icl ift inc ini ins inw inx iny
|
|
||||||
jcc jcs jeq jmi jmp jne jpl jsr
|
|
||||||
jvc jvs lda ldx ldy lsr mva mvx
|
|
||||||
mvy mwa mwx mwy nop opt ora org
|
|
||||||
pha php pla plp rcc rcs req rmi
|
|
||||||
rne rol ror rpl rti rts run rvc
|
|
||||||
rvs sbc scc scs sec sed sei seq
|
|
||||||
smi sne spl sta stx sty sub svc
|
|
||||||
svs tax tay tsx txa txs tya
|
|
||||||
</keyword-class>
|
|
||||||
</keyword-classes>
|
|
||||||
<language name="xasm" title="xasm">
|
|
||||||
<lexer name="asm"/>
|
|
||||||
<use-keywords>
|
|
||||||
<keyword key="0" name="Keywords" class="xasm"/>
|
|
||||||
</use-keywords>
|
|
||||||
<use-styles>
|
|
||||||
<style name="Default" key="32" font="font.monospace"/>
|
|
||||||
<style name="Comment" key="1" class="comment"/>
|
|
||||||
<style name="String" key="3" class="string"/>
|
|
||||||
<style name="Operator" key="4" class="operator"/>
|
|
||||||
<style name="Keyword" key="6" class="keyword"/>
|
|
||||||
<style name="Char" key="12" class="char"/>
|
|
||||||
<style name="Error" key="13" class="error"/>
|
|
||||||
</use-styles>
|
|
||||||
</language>
|
|
||||||
</Scheme>
|
|
@ -1,14 +0,0 @@
|
|||||||
# xasm specification file for Crimson Editor (www.crimsoneditor.com)
|
|
||||||
# written by Piotr Fusik <fox@scene.pl>
|
|
||||||
|
|
||||||
$CASESENSITIVE=NO
|
|
||||||
$DELIMITERS=~`!@#$%^&*()+=|{}[]:;"',.<>/?
|
|
||||||
$QUOTATIONMARK1="
|
|
||||||
$QUOTATIONMARK2='
|
|
||||||
$LINECOMMENT=;
|
|
||||||
$LINECOMMENT2=*
|
|
||||||
$INDENTATIONON=
|
|
||||||
$INDENTATIONOFF=
|
|
||||||
$PAIRS1=()
|
|
||||||
$PAIRS2=[]
|
|
||||||
$PAIRS3={}
|
|
133
syntax/xasm.stx
133
syntax/xasm.stx
@ -1,133 +0,0 @@
|
|||||||
#TITLE=xasm
|
|
||||||
; xasm syntax file for EditPlus 2.11 (www.editplus.com)
|
|
||||||
; written by Piotr Fusik <fox@scene.pl>
|
|
||||||
|
|
||||||
#DELIMITER=+-*/%&|^!~=<>()[]{},:"#
|
|
||||||
#QUOTATION1='
|
|
||||||
#QUOTATION2="
|
|
||||||
#CONTINUE_QUOTE=n
|
|
||||||
#LINECOMMENT=;
|
|
||||||
#LINECOMMENT2=^!*
|
|
||||||
#COMMENTON=
|
|
||||||
#COMMENTOFF=
|
|
||||||
#COMMENTON2=
|
|
||||||
#COMMENTOFF2=
|
|
||||||
#ESCAPE=
|
|
||||||
#CASE=n
|
|
||||||
#PREFIX1=
|
|
||||||
#PREFIX2=
|
|
||||||
#PREFIX3=
|
|
||||||
#PREFIX4=
|
|
||||||
#PREFIX5=
|
|
||||||
#SUFFIX1=
|
|
||||||
#SUFFIX2=
|
|
||||||
#SUFFIX3=
|
|
||||||
#SUFFIX4=
|
|
||||||
#SUFFIX5=
|
|
||||||
|
|
||||||
#KEYWORD=Keywords
|
|
||||||
|
|
||||||
adc
|
|
||||||
add
|
|
||||||
and
|
|
||||||
asl
|
|
||||||
bcc
|
|
||||||
bcs
|
|
||||||
beq
|
|
||||||
bit
|
|
||||||
bmi
|
|
||||||
bne
|
|
||||||
bpl
|
|
||||||
brk
|
|
||||||
bvc
|
|
||||||
bvs
|
|
||||||
clc
|
|
||||||
cld
|
|
||||||
cli
|
|
||||||
clv
|
|
||||||
cmp
|
|
||||||
cpx
|
|
||||||
cpy
|
|
||||||
dec
|
|
||||||
dex
|
|
||||||
dey
|
|
||||||
dta
|
|
||||||
eif
|
|
||||||
eli
|
|
||||||
els
|
|
||||||
end
|
|
||||||
eor
|
|
||||||
equ
|
|
||||||
ert
|
|
||||||
icl
|
|
||||||
ift
|
|
||||||
inc
|
|
||||||
ini
|
|
||||||
ins
|
|
||||||
inw
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
jcc
|
|
||||||
jcs
|
|
||||||
jeq
|
|
||||||
jmi
|
|
||||||
jmp
|
|
||||||
jne
|
|
||||||
jpl
|
|
||||||
jsr
|
|
||||||
jvc
|
|
||||||
jvs
|
|
||||||
lda
|
|
||||||
ldx
|
|
||||||
ldy
|
|
||||||
lsr
|
|
||||||
mva
|
|
||||||
mvx
|
|
||||||
mvy
|
|
||||||
mwa
|
|
||||||
mwx
|
|
||||||
mwy
|
|
||||||
nop
|
|
||||||
opt
|
|
||||||
ora
|
|
||||||
org
|
|
||||||
pha
|
|
||||||
php
|
|
||||||
pla
|
|
||||||
plp
|
|
||||||
rcc
|
|
||||||
rcs
|
|
||||||
req
|
|
||||||
rmi
|
|
||||||
rne
|
|
||||||
rol
|
|
||||||
ror
|
|
||||||
rpl
|
|
||||||
rti
|
|
||||||
rts
|
|
||||||
run
|
|
||||||
rvc
|
|
||||||
rvs
|
|
||||||
sbc
|
|
||||||
scc
|
|
||||||
scs
|
|
||||||
sec
|
|
||||||
sed
|
|
||||||
sei
|
|
||||||
seq
|
|
||||||
smi
|
|
||||||
sne
|
|
||||||
spl
|
|
||||||
sta
|
|
||||||
stx
|
|
||||||
sty
|
|
||||||
sub
|
|
||||||
svc
|
|
||||||
svs
|
|
||||||
tax
|
|
||||||
tay
|
|
||||||
tsx
|
|
||||||
txa
|
|
||||||
txs
|
|
||||||
tya
|
|
||||||
#
|
|
BIN
www/cgenie.gif
BIN
www/cgenie.gif
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
207
www/index.html
207
www/index.html
@ -1,102 +1,105 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>xasm</title>
|
<title>xasm</title>
|
||||||
<meta name="Description" content="xasm is a 6502 cross-assembler for DOS/Windows/Linux."/>
|
<meta name="Description" content="xasm is a 6502 cross-assembler for Windows and Linux." />
|
||||||
<meta name="Keywords" content="xasm,6502,cross-assembler,atari"/>
|
<meta name="Keywords" content="xasm,6502,cross-assembler,atari,8-bit" />
|
||||||
<meta name="Author" content="Piotr Fusik"/>
|
<meta name="Author" content="Piotr Fusik" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body { background-color: #c0f0c0; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; }
|
body { background-color: #f8f8f8; color: black; font-family: sans-serif; }
|
||||||
h1 { background-color: #008080; color: #ffffff; padding-left: 10px; }
|
h1 { color: #20a0a0; border-bottom: solid 3px #d0d0d0; }
|
||||||
h3 { background-color: #008080; color: #ffffff; padding-left: 10px; }
|
h2 { color: #20a0a0; border-bottom: solid 2px #d0d0d0; }
|
||||||
th { background-color: #008080; color: #ffffff; }
|
</style>
|
||||||
table { margin-bottom: 12px; }
|
</head>
|
||||||
td { background-color: #40a090; color: #ffffff; text-align: left; padding-left: 10px; padding-right: 10px; }
|
<body>
|
||||||
td a { color: #ffffff; }
|
<h1>xasm - 6502 cross-assembler</h1>
|
||||||
hr { color: #008080; height: 5px; }
|
<p>xasm is a free tool for programming old 8-bit computers based on the 6502 processor.</p>
|
||||||
</style>
|
<h2>History</h2>
|
||||||
</head>
|
<p>First version of xasm was written in 1998. I needed a cross-assembler
|
||||||
<body>
|
that could understand the syntax of Quick Assembler
|
||||||
<h1>xasm.atari.org</h1>
|
which I used for 8-bit Atari programming before I got a PC.
|
||||||
<p><b>xasm</b> is a 6502 cross-assembler.
|
Initially xasm supported the syntax of QA and nothing more.
|
||||||
It is mainly targeted at Atari 8-bit computers,
|
I quickly realized that I could extend the syntax to make it more expressive.
|
||||||
but it can be also used for programming
|
This led to xasm 2.0, still in 1998. I added some more features
|
||||||
Atari 2600/5200/Lynx, Commodore C64, Apple ][ and others.
|
next year. In 2002 I released many versions which contained
|
||||||
<b>xasm</b> is freeware.</p>
|
mostly bugfixes. In 2005 there were some minor enhancements and bug fixes,
|
||||||
<p>Version 3.0.0 is a complete rewrite from the x86 assembly language
|
as well as the whole assembler was rewritten from the x86 assembly language
|
||||||
to the <a href="http://www.digitalmars.com/d">D programming language</a>.
|
it was initially written in to the
|
||||||
<b>xasm</b> is now available for Linux.</p>
|
<a href="http://www.digitalmars.com/d">D programming language</a>.
|
||||||
<h3>Features</h3>
|
The rewrite introduced a bug, hopefully fixed in version 3.0.1
|
||||||
<p>Although <b>xasm</b> does not support user-defined macros, it has a rich
|
released 22nd April 2007.</p>
|
||||||
set of built-in facilities.</p>
|
<h2>Syntax</h2>
|
||||||
<p>Here is some typical 6502 code (also valid in <b>xasm</b>):</p>
|
<p>6502 assembler code is usually full of LDA, STA, LDA, STA sequences.
|
||||||
<pre>
|
With xasm you can use MVA as a shortcut for LDA/STA pair
|
||||||
lda #<dest
|
or even MWA for 16-bit transfers. You can avoid defining labels
|
||||||
sta ptr
|
when you need short jumps, thanks to conditional skip
|
||||||
lda #>dest
|
and repeat pseudo-instructions. You can put two instructions
|
||||||
sta ptr+1
|
that share their argument in one line.
|
||||||
ldx #192
|
These are just some of the features that help you program
|
||||||
do_line
|
in a more concise way. Let's look at typical 6502 code
|
||||||
ldy #39
|
(which is valid in xasm):</p>
|
||||||
do_byte
|
<pre>
|
||||||
lda pattern,y
|
lda #<dest
|
||||||
sta (ptr),y
|
sta ptr
|
||||||
dey
|
lda #>dest
|
||||||
bpl do_byte
|
sta ptr+1
|
||||||
lda #40
|
ldx #192
|
||||||
clc
|
do_line
|
||||||
adc ptr
|
ldy #39
|
||||||
sta ptr
|
do_byte
|
||||||
bcc skip
|
lda pattern,y
|
||||||
inc ptr+1
|
sta (ptr),y
|
||||||
skip
|
dey
|
||||||
dex
|
bpl do_byte
|
||||||
bne do_line
|
lda #40
|
||||||
</pre>
|
clc
|
||||||
<p>And here is the same code rewritten in a xasm-specific way:</p>
|
adc ptr
|
||||||
<pre>
|
sta ptr
|
||||||
mwa #dest ptr
|
bcc skip
|
||||||
ldx #192
|
inc ptr+1
|
||||||
do_line
|
skip
|
||||||
ldy #39
|
dex
|
||||||
mva:rpl pattern,y (ptr),y-
|
bne do_line
|
||||||
lda #40
|
</pre>
|
||||||
add:sta ptr
|
<p>Using xasm features this code can be rewritten to:</p>
|
||||||
scc:inc ptr+1
|
<pre>
|
||||||
dex:bne do_line
|
mwa #dest ptr
|
||||||
</pre>
|
ldx #192
|
||||||
<h3>Usage</h3>
|
do_line
|
||||||
<p>Although <b>xasm</b> comes with no editor, the documentation
|
ldy #39
|
||||||
describes integration (syntax highlighting and single-keystroke compilation)
|
mva:rpl pattern,y (ptr),y-
|
||||||
with a few general-purpose text editors. Here is a screenshot
|
lda #40
|
||||||
of the Code-Genie editor:</p>
|
add:sta ptr
|
||||||
<p><img src="cgenie.gif" alt="6502 code in Code-Genie"/></p>
|
scc:inc ptr+1
|
||||||
<h3>Download</h3>
|
dex:bne do_line
|
||||||
<div style="text-align: center">
|
</pre>
|
||||||
<table>
|
<h2>Usage</h2>
|
||||||
<tr><th>File</th><th>Size</th><th>Description</th></tr>
|
<p>xasm is a command-line tool so you additionally need a general-purpose text editor.
|
||||||
<tr><td><a href="xasm-3.0.0-win32.zip">xasm-3.0.0-win32.zip</a></td>
|
I use <a href="http://www.scintilla.org/SciTE.html">SciTE</a>.
|
||||||
<td style="text-align: right">98 KB</td><td>xasm 3.0.0 for Windows</td></tr>
|
Syntax highlighting definition for it is included with xasm.
|
||||||
<tr><td><a href="xasm-3.0.0-linux.tar.gz">xasm-3.0.0-linux.tar.gz</a></td>
|
To install it, copy <em>xasm.properties</em> to the SciTE directory,
|
||||||
<td style="text-align: right">128 KB</td><td>xasm 3.0.0 for Linux</td></tr>
|
select <em>Options / Open Global Options File</em>, type <kbd>import xasm</kbd>
|
||||||
<tr><td><a href="xasm-3.0.0-src.zip">xasm-3.0.0-src.zip</a></td>
|
at the end and save the global configuration file.</p>
|
||||||
<td style="text-align: right">16 KB</td><td>xasm 3.0.0 source code</td></tr>
|
<p><img src="scite.png" alt="xasm code in SciTE" /></p>
|
||||||
<tr><td><a href="xasm261.zip">xasm261.zip</a></td>
|
<h2>Download</h2>
|
||||||
<td style="text-align: right">25 KB</td><td>xasm 2.6.1 for DOS/Windows</td></tr>
|
<ul>
|
||||||
<tr><td><a href="xasm252.zip">xasm252.zip</a></td>
|
<li><a href="xasm-3.0.1-win32.zip">xasm 3.0.1 for Windows</a></li>
|
||||||
<td style="text-align: right">38 KB</td><td>xasm 2.5.2 for DOS/Windows (includes
|
<li><a href="xasm-3.0.1-src.zip">xasm 3.0.1 source code</a></li>
|
||||||
X-BOOT, X-LOAD and X-HEAD)</td></tr>
|
<li><a href="xasm261.zip">xasm 2.6.1 for DOS/Windows</a></li>
|
||||||
</table>
|
</ul>
|
||||||
</div>
|
<p>For other systems, such as GNU/Linux and MacOS X, install the latest D compiler
|
||||||
<h3>Links</h3>
|
and compile xasm from source code.</p>
|
||||||
<ul>
|
<h2>Inflate</h2>
|
||||||
<li><a href="http://www.cc65.org">cc65</a></li>
|
<p>Need a good decompression routine for 6502?
|
||||||
<li><a href="http://g2f.atari8.info/mads/">Mad-Assembler</a></li>
|
See my <a href="inflate.html">inflate routine</a>.</p>
|
||||||
<li><a href="http://www.npsnet.com/danf/cbm/cross-development.html">6502
|
<h2>Links</h2>
|
||||||
Cross-Development Languages and Tools List</a></li>
|
<ul>
|
||||||
</ul>
|
<li><a href="http://atari800.sourceforge.net/">Atari800 emulator</a></li>
|
||||||
<hr/>
|
<li><a href="http://sources.pigwa.net/">Atari XL/XE Source Archive</a></li>
|
||||||
<p><i>Hosted by <a href="http://atariarea.histeria.pl">Atari Area</a></i></p>
|
<li><a href="http://www.cc65.org/">cc65 cross-compiler</a></li>
|
||||||
</body>
|
<li><a href="http://epi.atari8.info/hcasm.php">HardCore Assembler</a></li>
|
||||||
</html>
|
<li><a href="http://mads.atari8.info/">Mad-Assembler</a></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
BIN
www/scite.png
Normal file
BIN
www/scite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
83
xasm.d
83
xasm.d
@ -1,11 +1,10 @@
|
|||||||
// xasm 3.0.0 by Piotr Fusik <fox@scene.pl>
|
// xasm 3.0.1 by Piotr Fusik <fox@scene.pl>
|
||||||
// See the homepage at http://xasm.atari.org.
|
// http://xasm.atari.org
|
||||||
// This source code is free, redistributable and modifiable
|
|
||||||
// under the terms of the Artistic License (attached as artistic.txt).
|
|
||||||
|
|
||||||
private import std.math;
|
import std.math;
|
||||||
private import std.stream;
|
import std.stream;
|
||||||
private import std.string;
|
import std.cstream;
|
||||||
|
import std.string;
|
||||||
|
|
||||||
version (Windows) {
|
version (Windows) {
|
||||||
|
|
||||||
@ -32,7 +31,7 @@ version (Windows) {
|
|||||||
const char[] OPTION_P_DESC = "Ignored for compatibility";
|
const char[] OPTION_P_DESC = "Ignored for compatibility";
|
||||||
}
|
}
|
||||||
|
|
||||||
const char[] TITLE = "xasm 3.0.0";
|
const char[] TITLE = "xasm 3.0.1";
|
||||||
|
|
||||||
char[] sourceFilename = null;
|
char[] sourceFilename = null;
|
||||||
|
|
||||||
@ -214,10 +213,10 @@ bit getOption(char letter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void warning(char[] msg) {
|
void warning(char[] msg) {
|
||||||
if (!(line is null)) {
|
if (line !is null) {
|
||||||
stderr.printf("%.*s\n", line);
|
derr.printf("%.*s\n", line);
|
||||||
}
|
}
|
||||||
stderr.printf("%.*s (%d) WARNING: %.*s\n",
|
derr.printf("%.*s (%d) WARNING: %.*s\n",
|
||||||
currentLocation.filename,
|
currentLocation.filename,
|
||||||
currentLocation.lineNo, msg
|
currentLocation.lineNo, msg
|
||||||
);
|
);
|
||||||
@ -310,7 +309,7 @@ char[] readLabel() {
|
|||||||
column--;
|
column--;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return label >= "A" ? label : cast(char[]) null;
|
return label >= "A" ? label : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void readComma() {
|
void readComma() {
|
||||||
@ -835,7 +834,7 @@ debug int testValue(char[] l) {
|
|||||||
line = l;
|
line = l;
|
||||||
column = 0;
|
column = 0;
|
||||||
readValue();
|
readValue();
|
||||||
printf("Value of %.*s is %x\n", line, value);
|
dout.printf("Value of %.*s is %x\n", line, value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1008,8 +1007,8 @@ void readAddrMode() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addrMode = AddrMode.INDIRECT;
|
addrMode = AddrMode.INDIRECT;
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
illegalCharacter();
|
illegalCharacter();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1111,7 +1110,7 @@ debug AddrMode testAddrMode(char[] l) {
|
|||||||
line = l;
|
line = l;
|
||||||
column = 0;
|
column = 0;
|
||||||
readAddrMode();
|
readAddrMode();
|
||||||
printf("Addressing mode of \"%.*s\" is %x\n", line, addrMode);
|
dout.printf("Addressing mode of \"%.*s\" is %x\n", line, addrMode);
|
||||||
return addrMode;
|
return addrMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1195,7 +1194,7 @@ void ensureListingFileOpen(char letter, char[] msg) {
|
|||||||
if (listingStream is null) {
|
if (listingStream is null) {
|
||||||
listingStream = openOutputFile(letter, ".lst");
|
listingStream = openOutputFile(letter, ".lst");
|
||||||
if (!getOption('q')) {
|
if (!getOption('q')) {
|
||||||
printf(msg);
|
dout.printf(msg);
|
||||||
}
|
}
|
||||||
listingStream.printf(TITLE ~ "\r\n");
|
listingStream.printf(TITLE ~ "\r\n");
|
||||||
}
|
}
|
||||||
@ -1258,7 +1257,7 @@ void listCommentLine() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void listLabelTable() {
|
void listLabelTable() {
|
||||||
if (!(optionParameters['t' - 'a'] is null) && !(listingStream is null)) {
|
if (optionParameters['t' - 'a'] !is null && listingStream !is null) {
|
||||||
listingStream.close();
|
listingStream.close();
|
||||||
listingStream = null;
|
listingStream = null;
|
||||||
}
|
}
|
||||||
@ -1292,7 +1291,7 @@ void objectByte(ubyte b) {
|
|||||||
if (objectStream is null) {
|
if (objectStream is null) {
|
||||||
objectStream = openOutputFile('o', ".obx");
|
objectStream = openOutputFile('o', ".obx");
|
||||||
if (!getOption('q')) {
|
if (!getOption('q')) {
|
||||||
printf("Writing object file...\n");
|
dout.printf("Writing object file...\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -1346,7 +1345,8 @@ void putByte(ubyte b) {
|
|||||||
objectByte(b);
|
objectByte(b);
|
||||||
}
|
}
|
||||||
if (pass2) {
|
if (pass2) {
|
||||||
debug; else {
|
debug {
|
||||||
|
}else {
|
||||||
objectByte(b);
|
objectByte(b);
|
||||||
}
|
}
|
||||||
if (listingColumn < 29) {
|
if (listingColumn < 29) {
|
||||||
@ -1357,15 +1357,17 @@ void putByte(ubyte b) {
|
|||||||
listingColumn = 30;
|
listingColumn = 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (origin >= 0) {
|
if (optionHeaders) {
|
||||||
|
if (origin < 0)
|
||||||
|
throw new AssemblyError("No ORG specified");
|
||||||
assert(blockIndex >= 0);
|
assert(blockIndex >= 0);
|
||||||
if (!pass2) {
|
if (!pass2) {
|
||||||
blockEnds[blockIndex] = cast(ushort) loadOrigin;
|
blockEnds[blockIndex] = cast(ushort) loadOrigin;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (origin >= 0) {
|
||||||
origin++;
|
origin++;
|
||||||
loadingOrigin = ++loadOrigin;
|
loadingOrigin = ++loadOrigin;
|
||||||
} else if (optionHeaders) {
|
|
||||||
throw new AssemblyError("No ORG specified");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2074,7 +2076,6 @@ void assemblyDtaNumbers(char letter) {
|
|||||||
case 'r':
|
case 'r':
|
||||||
assemblyDtaReal();
|
assemblyDtaReal();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
switch (readChar()) {
|
switch (readChar()) {
|
||||||
case ')':
|
case ')':
|
||||||
@ -2443,7 +2444,7 @@ void assemblyIns() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void assemblyInstruction(char[] instruction) {
|
void assemblyInstruction(char[] instruction) {
|
||||||
if (!inOpcode && origin < 0 && !(currentLabel is null) && instruction != "EQU") {
|
if (!inOpcode && origin < 0 && currentLabel !is null && instruction != "EQU") {
|
||||||
throw new AssemblyError("No ORG specified");
|
throw new AssemblyError("No ORG specified");
|
||||||
}
|
}
|
||||||
instructionBegin = true;
|
instructionBegin = true;
|
||||||
@ -2768,11 +2769,11 @@ debug ubyte[] testInstruction(char[] l) {
|
|||||||
line = l;
|
line = l;
|
||||||
column = 0;
|
column = 0;
|
||||||
assemblyInstruction(readInstruction());
|
assemblyInstruction(readInstruction());
|
||||||
printf("%.*s assembles to", line);
|
dout.printf("%.*s assembles to", line);
|
||||||
foreach (ubyte b; objectBuffer) {
|
foreach (ubyte b; objectBuffer) {
|
||||||
printf(" %02x", b);
|
dout.printf(" %02x", b);
|
||||||
}
|
}
|
||||||
printf("\n");
|
dout.printf("\n");
|
||||||
return objectBuffer;
|
return objectBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2811,7 +2812,7 @@ void assemblyPair() {
|
|||||||
|
|
||||||
void assemblyLine() {
|
void assemblyLine() {
|
||||||
debug {
|
debug {
|
||||||
printf("%.*s\n", line);
|
dout.printf("%.*s\n", line);
|
||||||
}
|
}
|
||||||
currentLocation.lineNo++;
|
currentLocation.lineNo++;
|
||||||
totalLines++;
|
totalLines++;
|
||||||
@ -2823,7 +2824,7 @@ void assemblyLine() {
|
|||||||
}
|
}
|
||||||
char[] label = readLabel();
|
char[] label = readLabel();
|
||||||
currentLabel = null;
|
currentLabel = null;
|
||||||
if (!(label is null)) {
|
if (label !is null) {
|
||||||
if (!inFalseCondition()) {
|
if (!inFalseCondition()) {
|
||||||
if (!pass2) {
|
if (!pass2) {
|
||||||
if (label in labelTable) {
|
if (label in labelTable) {
|
||||||
@ -2930,7 +2931,7 @@ void assemblyFile(char[] filename) {
|
|||||||
if (filenameExt(filename) < 0) {
|
if (filenameExt(filename) < 0) {
|
||||||
filename ~= ".asx";
|
filename ~= ".asx";
|
||||||
}
|
}
|
||||||
if (!(currentLocation is null)) {
|
if (currentLocation !is null) {
|
||||||
locations ~= currentLocation;
|
locations ~= currentLocation;
|
||||||
}
|
}
|
||||||
if (getOption('p')) {
|
if (getOption('p')) {
|
||||||
@ -3090,7 +3091,7 @@ int main(char[][] args) {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(sourceFilename is null)) {
|
if (sourceFilename !is null) {
|
||||||
exitCode = 3;
|
exitCode = 3;
|
||||||
}
|
}
|
||||||
sourceFilename = arg;
|
sourceFilename = arg;
|
||||||
@ -3099,10 +3100,10 @@ int main(char[][] args) {
|
|||||||
exitCode = 3;
|
exitCode = 3;
|
||||||
}
|
}
|
||||||
if (!getOption('q')) {
|
if (!getOption('q')) {
|
||||||
printf(TITLE ~ "\n");
|
dout.printf(TITLE ~ "\n");
|
||||||
}
|
}
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
printf(
|
dout.printf(
|
||||||
"Syntax: xasm source [options]\n"
|
"Syntax: xasm source [options]\n"
|
||||||
"/c Include false conditionals in listing\n"
|
"/c Include false conditionals in listing\n"
|
||||||
"/d:label=value Define a label\n"
|
"/d:label=value Define a label\n"
|
||||||
@ -3124,25 +3125,25 @@ int main(char[][] args) {
|
|||||||
listLabelTable();
|
listLabelTable();
|
||||||
}
|
}
|
||||||
} catch (AssemblyError e) {
|
} catch (AssemblyError e) {
|
||||||
if (!(line is null)) {
|
if (line !is null) {
|
||||||
stderr.printf("%.*s\n", line);
|
derr.printf("%.*s\n", line);
|
||||||
}
|
}
|
||||||
stderr.printf("%.*s (%d) ERROR: %.*s\n",
|
derr.printf("%.*s (%d) ERROR: %.*s\n",
|
||||||
currentLocation.filename,
|
currentLocation.filename,
|
||||||
currentLocation.lineNo, e.msg
|
currentLocation.lineNo, e.msg
|
||||||
);
|
);
|
||||||
exitCode = 2;
|
exitCode = 2;
|
||||||
}
|
}
|
||||||
if (!(listingStream is null)) {
|
if (listingStream !is null) {
|
||||||
listingStream.close();
|
listingStream.close();
|
||||||
}
|
}
|
||||||
if (!(objectStream is null)) {
|
if (objectStream !is null) {
|
||||||
objectStream.close();
|
objectStream.close();
|
||||||
}
|
}
|
||||||
if (exitCode <= 1 && !getOption('q')) {
|
if (exitCode <= 1 && !getOption('q')) {
|
||||||
printf("%d lines of source assembled\n", totalLines);
|
dout.printf("%d lines of source assembled\n", totalLines);
|
||||||
if (objectBytes > 0) {
|
if (objectBytes > 0) {
|
||||||
printf("%d bytes written to the object file\n", objectBytes);
|
dout.printf("%d bytes written to the object file\n", objectBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return exitCode;
|
return exitCode;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>xasm 3.0.0</title>
|
<title>xasm 3.0.1</title>
|
||||||
<meta name="Author" content="Piotr Fusik"/>
|
<meta name="Author" content="Piotr Fusik"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -20,9 +20,8 @@ the <tt>.obx</tt> extension.</p>
|
|||||||
<h2>OPTIONS</h2>
|
<h2>OPTIONS</h2>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><tt>/c</tt></dt>
|
<dt><tt>/c</tt></dt>
|
||||||
<dd>Enable listing false conditionals.
|
<dd>List lines skipped due to a false condition.</dd>
|
||||||
Lines skipped due to a false condition are not listed by default.</dd>
|
<dt><a id="new_deflabel"/><tt>/d:label=value</tt></dt>
|
||||||
<dt><a name="new_deflabel"/><tt>/d:label=value</tt></dt>
|
|
||||||
<dd>Define a label.
|
<dd>Define a label.
|
||||||
<tt>label</tt> should be a valid label name.
|
<tt>label</tt> should be a valid label name.
|
||||||
<tt>value</tt> may be any expression (it may use forward references
|
<tt>value</tt> may be any expression (it may use forward references
|
||||||
@ -30,49 +29,42 @@ to labels defined in the source file).
|
|||||||
You may use several <tt>/d</tt> options to define many labels
|
You may use several <tt>/d</tt> options to define many labels
|
||||||
from the command line.</dd>
|
from the command line.</dd>
|
||||||
<dt><tt>/i</tt></dt>
|
<dt><tt>/i</tt></dt>
|
||||||
<dd>Disable listing included sources. Only main source file will be
|
<dd>Do not list included files. Only main source file will be listed.</dd>
|
||||||
listed.</dd>
|
|
||||||
<dt><tt>/l[:filename]</tt></dt>
|
<dt><tt>/l[:filename]</tt></dt>
|
||||||
<dd>Enable listing. If no <tt>filename</tt> is given, the listing is written
|
<dd>Generate a listing. If no <tt>filename</tt> is given, the listing is written
|
||||||
to <tt>source.lst</tt>, where <tt>source</tt> is the name of the source file
|
to <tt>source.lst</tt>, where <tt>source</tt> is the name of the source file
|
||||||
(without the extension).</dd>
|
without the extension.</dd>
|
||||||
<dt><tt>/o:filename</tt></dt>
|
<dt><tt>/o:filename</tt></dt>
|
||||||
<dd>Specify object file name. The default is <tt>source.obx</tt>.
|
<dd>Set object file name. The default is <tt>source.obx</tt>.
|
||||||
You may use the null device (<tt>/o:nul</tt>) to generate no object file.</dd>
|
You may use the null device (<tt>/o:nul</tt>) to generate no object file.</dd>
|
||||||
<dt><a name="new_fullpaths"/><tt>/p</tt></dt>
|
<dt><a id="new_fullpaths"/><tt>/p</tt></dt>
|
||||||
<dd>Print fully qualified file names in listing and error messages.
|
<dd>Print fully qualified file names in listing and error messages.
|
||||||
This option is useful for the Code-Genie editor, which can jump to the error
|
This option works only on Windows and is silently ignored on other platforms.</dd>
|
||||||
location only if the full path is given.
|
<dt><a id="new_quiet"/><tt>/q</tt></dt>
|
||||||
This option works only on Windows and is silently ignored on Linux.</dd>
|
|
||||||
<dt><a name="new_quiet"/><tt>/q</tt></dt>
|
|
||||||
<dd>Suppress info messages.
|
<dd>Suppress info messages.
|
||||||
Prevents <b>xasm</b> from printing its name and the summary (how many lines
|
Quiet mode. Prevents <b>xasm</b> from printing the logo and the summary.</dd>
|
||||||
assembled and bytes written). Good if you are building a project from many
|
|
||||||
source files and don't want tons of messages.</dd>
|
|
||||||
<dt><tt>/t[:filename]</tt></dt>
|
<dt><tt>/t[:filename]</tt></dt>
|
||||||
<dd>List label table. If no <tt>filename</tt> given, the table is appended
|
<dd>List label table. If <tt>filename</tt> is omitted then the table is appended
|
||||||
to the listing.</dd>
|
to the listing.</dd>
|
||||||
<dt><a name="new_unlabels"/><tt>/u</tt></dt>
|
<dt><a id="new_unlabels"/><tt>/u</tt></dt>
|
||||||
<dd>Warn of unused labels. A warning message will be issued for each label,
|
<dd>Issue a warning message for each label whose value is unused.</dd>
|
||||||
whose value is never used.</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
<p>Alternatively, you may use Unix-style options, for example:</p>
|
<p>Alternatively, you may use Unix-style options, for example:</p>
|
||||||
<pre>xasm -i -d DEBUG=1 -l listing.lst source.asx
|
<pre>xasm -i -d DEBUG=1 -l listing.lst source.asx
|
||||||
</pre>
|
</pre>
|
||||||
<h2>SYNTAX</h2>
|
<h2>SYNTAX</h2>
|
||||||
<p>Source files should be plain ASCII files. Supported are LF, CR, CR/LF
|
<p>Source files should be plain ASCII files. LF, CR, CR/LF and Atari line terminators
|
||||||
and Atari line terminators. <b>xasm</b> is not case-sensitive, so you can mix
|
are supported. Labels and instructions are case-insensitive.</p>
|
||||||
upper- and lower-case for labels and instructions.</p>
|
|
||||||
<p><b>xasm</b> is backward compatible with Quick Assembler.
|
<p><b>xasm</b> is backward compatible with Quick Assembler.
|
||||||
If you want to assembly QA sources with <b>xasm</b>, simply replace ATASCII
|
To compile QA sources with <b>xasm</b>, simply replace ATASCII-specific characters
|
||||||
specific characters with their integer representation. You also have to change
|
with their integer codes. You also have to change all <tt>OPT</tt> directives,
|
||||||
all <tt>OPT</tt> directives, but usually you only need to remove them.</p>
|
but usually you can simply remove them.</p>
|
||||||
<p>A <i>label</i> is a symbol that represents a 32-bit signed integer.
|
<p>A <i>label</i> is a symbol that represents a 32-bit signed integer.
|
||||||
You can define a label by putting its name at the beginning of a line
|
You can define a label by putting its name at the beginning of a line
|
||||||
(with no spaces before). If you do not use the <tt>EQU</tt> directive,
|
(with no spaces before). Unless you use the <tt>EQU</tt> directive,
|
||||||
the label is assigned the current value of the origin counter.</p>
|
the label is assigned the current value of the origin counter.</p>
|
||||||
<p>Instructions and directives must be preceded with
|
<p>Instructions and directives must be preceded with some whitespace.
|
||||||
whitespace. Note that in <b>xasm</b> you can use instruction and directive
|
Note that in <b>xasm</b> you can use instruction and directive
|
||||||
names as label names. For example</p>
|
names as label names. For example</p>
|
||||||
<pre>nop
|
<pre>nop
|
||||||
</pre><p>defines a label called <tt>nop</tt>, whereas</p>
|
</pre><p>defines a label called <tt>nop</tt>, whereas</p>
|
||||||
@ -85,23 +77,21 @@ of full comment lines:</p>
|
|||||||
* so it is
|
* so it is
|
||||||
label | and this too
|
label | and this too
|
||||||
</pre>
|
</pre>
|
||||||
<p><a name="new_linerep"/>Lines with instructions (and some directives)
|
<p><a id="new_linerep"/>Lines with instructions (and some directives)
|
||||||
may be <i>repeated</i>. A single line may be assembled several times,
|
may be <i>repeated</i>. A single line may be assembled several times,
|
||||||
for example:</p>
|
for example:</p>
|
||||||
<pre>:4 asl @
|
<pre>:4 asl @
|
||||||
table :32*5 dta 5
|
table :32*5 dta 5
|
||||||
</pre>
|
</pre>
|
||||||
<p>In lines with instructions or directives, a comment starts after
|
<p>In lines with instructions or directives, a comment starts immediately
|
||||||
the instruction/directive has been successfully parsed. That is, <b>xasm</b>
|
after the instruction/directive has been successfully parsed.
|
||||||
does not require a special character to start a comment. However,
|
That is, <b>xasm</b> does not require a special character to start a comment.</p>
|
||||||
you still can use one, because it is usually required for correct syntax
|
|
||||||
highlighting in text editors.</p>
|
|
||||||
<pre> lda foo ; this is a comment
|
<pre> lda foo ; this is a comment
|
||||||
sta bar so it is
|
sta bar so it is
|
||||||
tax #0 tax requires no operand, so #0 starts a comment
|
tax #0 tax has no operand, therefore #0 starts this comment
|
||||||
</pre>
|
</pre>
|
||||||
<p><a name="new_pairing"/>You may put two instructions on the same line.
|
<p><a id="new_pairing"/>You may put two instructions in one line
|
||||||
In this case they have the same operand. For example:</p>
|
so they share the operand. For example:</p>
|
||||||
<pre> eor:sta foo
|
<pre> eor:sta foo
|
||||||
</pre>
|
</pre>
|
||||||
<p>is equivalent to</p>
|
<p>is equivalent to</p>
|
||||||
@ -110,29 +100,28 @@ In this case they have the same operand. For example:</p>
|
|||||||
</pre>
|
</pre>
|
||||||
<p>Note that</p>
|
<p>Note that</p>
|
||||||
<pre> lda:tax #0
|
<pre> lda:tax #0
|
||||||
</pre><p>is allowed (<tt>#0</tt> is a comment for <tt>tax</tt>).</p>
|
</pre><p>is allowed because <tt>#0</tt> is treated as a comment for <tt>tax</tt>.</p>
|
||||||
<h2>EXPRESSIONS</h2>
|
<h2>EXPRESSIONS</h2>
|
||||||
<p>Expressions are numbers combined with operators and brackets.
|
<p>Expressions are numbers combined with operators and brackets.
|
||||||
You should use square brackets, because parentheses are reserved
|
You should use square brackets, because parentheses are reserved
|
||||||
for the indirect addressing.</p>
|
for 6502 indirect addressing.</p>
|
||||||
<p>Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff.
|
<p>Numbers can be expressed as:</p>
|
||||||
A number may be:</p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>a decimal number, e.g. <tt>-12345</tt></li>
|
<li>a 32-bit decimal integer, e.g. <tt>-12345</tt></li>
|
||||||
<li>a hexadecimal number, e.g. <tt>$abcd</tt></li>
|
<li>a 32-bit hexadecimal integer, e.g. <tt>$abcd</tt></li>
|
||||||
<li>a binary number, e.g. <tt>%10100101</tt></li>
|
<li>a 32-bit binary integer, e.g. <tt>%10100101</tt></li>
|
||||||
<li>an ASCII character, e.g. <tt>'a'</tt> or <tt>"a"</tt></li>
|
<li>an ASCII character, e.g. <tt>'a'</tt> or <tt>"a"</tt></li>
|
||||||
<li>the origin counter value: <tt>*</tt></li>
|
<li>origin counter: <tt>*</tt></li>
|
||||||
<li>a hardware register, e.g. <tt>^4e</tt></li>
|
<li>a hardware register, e.g. <tt>^4e</tt></li>
|
||||||
<li><a name="new_opcode"/>an op-code, e.g. <tt>{lda #0}</tt> equals
|
<li><a id="new_opcode"/>an op-code, e.g. <tt>{lda #0}</tt> equals
|
||||||
<tt>$a9</tt></li>
|
<tt>$a9</tt></li>
|
||||||
<li><a name="new_linecnt"/>the line repeat counter: <tt>#</tt></li>
|
<li><a id="new_linecnt"/>the line repeat counter: <tt>#</tt></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Abbreviations of Atari hardware registers are provided to save you
|
<p>Abbreviations of Atari hardware registers are provided to save you
|
||||||
the trouble of typing two extra characters (<tt>^4e</tt> vs <tt>$d40e</tt>)
|
the trouble of typing two extra characters (<tt>^4e</tt> vs <tt>$d40e</tt>)
|
||||||
and to ease porting software between Atari 8-bit computers and the Atari 5200
|
and to ease porting software between Atari 8-bit computers and the Atari 5200
|
||||||
console. These are very similar machines, one of the biggest differences is
|
console. These are very similar machines, one of the biggest differences is
|
||||||
different location of hardware registers.</p>
|
the location of hardware registers.</p>
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Syntax</th><th>Chip</th>
|
<tr><th>Syntax</th><th>Chip</th>
|
||||||
<th>Value in the Atari 8-bit<br/>computer mode (<tt>opt g-</tt>)</th>
|
<th>Value in the Atari 8-bit<br/>computer mode (<tt>opt g-</tt>)</th>
|
||||||
@ -150,17 +139,17 @@ different location of hardware registers.</p>
|
|||||||
<td><tt>$D40x</tt></td><td><tt>$D40x</tt></td></tr>
|
<td><tt>$D40x</tt></td><td><tt>$D40x</tt></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>An op-code is the single-byte op-code of the instruction inside braces.
|
<p>An op-code is the single-byte op-code of the instruction inside braces.
|
||||||
The operand of the instruction is discarded and is necessary only for
|
The operand of the instruction is discarded and is necessary only
|
||||||
identifying the addressing mode. The instruction should begin just after
|
to recognize the addressing mode. The instruction should begin right after
|
||||||
the left brace and the right brace should immediately follow the operand
|
the left brace and the right brace should immediately follow the operand
|
||||||
or the instruction.
|
or the instruction.
|
||||||
<a name="new_op_op"/>You can skip the operand if the addressing mode
|
<a id="new_op_op"/>You can skip the operand if the addressing mode
|
||||||
is fixed. Examples:
|
is fixed. Examples:
|
||||||
<tt>{lda #}</tt>, <tt>{jsr}</tt>, <tt>{bne}</tt>, <tt>{jmp ()}</tt>,
|
<tt>{lda #}</tt>, <tt>{jsr}</tt>, <tt>{bne}</tt>, <tt>{jmp ()}</tt>,
|
||||||
<tt>{sta a:,x}</tt>.</p>
|
<tt>{sta a:,x}</tt>.</p>
|
||||||
<p>You can use the line repeat counter (<tt>#</tt>) in the repeated lines.
|
<p>You can use the line repeat counter (<tt>#</tt>) in the repeated lines.
|
||||||
It counts the iterations starting from zero. Examples:</p>
|
It counts the iterations starting from zero. Examples:</p>
|
||||||
<pre>:3 dta # ; generates three bytes: 00, 01, 02.
|
<pre>:3 dta # ; generates three bytes: 0, 1, 2.
|
||||||
line_lo :192 dta l(screen+40*#)
|
line_lo :192 dta l(screen+40*#)
|
||||||
line_hi :192 dta h(screen+40*#)
|
line_hi :192 dta h(screen+40*#)
|
||||||
dl :59 dta $4f,a(screen+40*#),0,$4f,a(screen+40*#),0
|
dl :59 dta $4f,a(screen+40*#),0,$4f,a(screen+40*#),0
|
||||||
@ -188,7 +177,7 @@ dl :59 dta $4f,a(screen+40*#),0,$4f,a(screen+40*#),0
|
|||||||
<li><tt>&&</tt> Logical AND</li>
|
<li><tt>&&</tt> Logical AND</li>
|
||||||
<li><tt>||</tt> Logical OR</li>
|
<li><tt>||</tt> Logical OR</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><a name="new_unary"/>The following unary operators are supported:</p>
|
<p><a id="new_unary"/>The following unary operators are supported:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>+ </tt> Plus (does nothing)</li>
|
<li><tt>+ </tt> Plus (does nothing)</li>
|
||||||
<li><tt>- </tt> Minus (changes the sign)</li>
|
<li><tt>- </tt> Minus (changes the sign)</li>
|
||||||
@ -221,25 +210,24 @@ and Java, their priorities are different than in these languages.</p>
|
|||||||
<p>Compare and logical operators assume that zero is false and a non-zero
|
<p>Compare and logical operators assume that zero is false and a non-zero
|
||||||
is true. They return 1 for true.</p>
|
is true. They return 1 for true.</p>
|
||||||
<p>While calculating an expression, signed 32-bit arithmetic is used.
|
<p>While calculating an expression, signed 32-bit arithmetic is used.
|
||||||
When range of 32 bits is exceeded, the '<tt>Arithmetic overflow</tt>' error
|
When range of 32 bits is exceeded, an '<tt>Arithmetic overflow</tt>' error
|
||||||
is generated.</p>
|
occurs.</p>
|
||||||
<h2>DIRECTIVES</h2>
|
<h2>DIRECTIVES</h2>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><tt><b>EQU</b></tt> - assign a value of an expression to the label</dt>
|
<dt><tt><b>EQU</b></tt> - assign a value of an expression to the label</dt>
|
||||||
<dd>Note that a label represents a number, not a text macro.<br/>
|
<dd>Examples:
|
||||||
Examples:
|
|
||||||
<pre>five equ 5
|
<pre>five equ 5
|
||||||
here equ *
|
here equ *
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><a name="new_opt"/><tt><b>OPT</b></tt> - set assembly options</dt>
|
<dt><a id="new_opt"/><tt><b>OPT</b></tt> - set assembly options</dt>
|
||||||
<dd>Five options are available:
|
<dd>Five options are available:
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>F</tt> - fill the space between <tt>ORG</tt>s
|
<li><tt>F</tt> - fill the space between <tt>ORG</tt>s
|
||||||
with <tt>$FF</tt> bytes</li>
|
with <tt>$FF</tt></li>
|
||||||
<li><tt>G</tt> - Atari 5200 mode for hardware register abbreviations</li>
|
<li><tt>G</tt> - Atari 5200 mode for hardware register abbreviations</li>
|
||||||
<li><tt>H</tt> - generate Atari executable headers</li>
|
<li><tt>H</tt> - generate Atari executable headers</li>
|
||||||
<li><tt>L</tt> - generate listing</li>
|
<li><tt>L</tt> - write to the listing</li>
|
||||||
<li><tt>O</tt> - generate object file</li>
|
<li><tt>O</tt> - write to the object file</li>
|
||||||
</ul>
|
</ul>
|
||||||
You can turn any of these on or off.<br/>
|
You can turn any of these on or off.<br/>
|
||||||
The default (if no <tt>OPT</tt> specified) is <tt>opt f-g-h+l+o+</tt>.<br/>
|
The default (if no <tt>OPT</tt> specified) is <tt>opt f-g-h+l+o+</tt>.<br/>
|
||||||
@ -249,15 +237,13 @@ Examples:
|
|||||||
opt f+g+h- useful for Atari 5200 cartridges - raw output format, 5200 hw regs
|
opt f+g+h- useful for Atari 5200 cartridges - raw output format, 5200 hw regs
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><tt><b>ORG</b></tt> - change value of the origin counter</dt>
|
<dt><tt><b>ORG</b></tt> - change value of the origin counter</dt>
|
||||||
<dd>You can set some options applied to the new header (if headers are
|
<dd>If Atari executable headers are enabled, you can use a prefix:
|
||||||
enabled):
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><tt>a:</tt> tells <b>xasm</b> to always make a header, even it is
|
<li><tt>a:</tt> starts a new block even if it is not necessary because
|
||||||
unnecessary, like in <tt>ORG *</tt>.</li>
|
the new address equals the current address.</li>
|
||||||
<li><tt>f:</tt> works same as <tt>a:</tt>, but additionally tells to generate
|
<li><tt>f:</tt> is same as <tt>a:</tt>, but additionally generates
|
||||||
a <tt>$FF,$FF</tt> prefix before the header. <b>xasm</b> adds it
|
a <tt>$FF,$FF</tt> prefix before the new header. The prefix is automatically
|
||||||
at the beginning of the file by default, so use this option only if you want
|
generated at the beginning of the file.</li>
|
||||||
the <tt>$FF</tt>'s somewhere inside.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
Examples:
|
Examples:
|
||||||
<pre> org $600
|
<pre> org $600
|
||||||
@ -267,13 +253,12 @@ table org *+100
|
|||||||
In the latter example <tt>table</tt> points to 100 bytes
|
In the latter example <tt>table</tt> points to 100 bytes
|
||||||
of uninitialized data (label is assigned to <tt>*</tt>
|
of uninitialized data (label is assigned to <tt>*</tt>
|
||||||
before the <tt>ORG</tt> directive is executed).
|
before the <tt>ORG</tt> directive is executed).
|
||||||
<p><a name="new_orgr"/>Starting with version 2.6.0, <b>xasm</b> supports code
|
<p><a id="new_orgr"/>Starting with version 2.6.0, <b>xasm</b> supports code
|
||||||
that is relocated in the memory at runtime. Let's say you want your code
|
that is relocated in the memory at runtime. Let's say you want your code
|
||||||
to be run at the zero page. Typically you can't load it directly into this
|
to be located on the zero page. You can't normally load it directly into this
|
||||||
place, so you load it at a different address and then move at the runtime.
|
place, so you load it at a different address and then move in your program.
|
||||||
<b>xasm</b> differentiates between the address that it used
|
<tt>org r:</tt> changes the address that it used for code generation
|
||||||
for code generation from the address that is used for generating
|
but not the address used for generating Atari executable headers.
|
||||||
Atari executable headers. <tt>org r:</tt> affects only the former one.
|
|
||||||
Example:</p>
|
Example:</p>
|
||||||
<pre> org $8000
|
<pre> org $8000
|
||||||
ldx #code_length-1
|
ldx #code_length-1
|
||||||
@ -292,8 +277,8 @@ because I think this is not useful. If you really need it, you can
|
|||||||
always type something like:</p>
|
always type something like:</p>
|
||||||
<pre>where_am_i equ *-code_zpage+code_loaded
|
<pre>where_am_i equ *-code_zpage+code_loaded
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><a name="new_dta"/><tt><b>DTA</b></tt> - define data</dt>
|
<dt><a id="new_dta"/><tt><b>DTA</b></tt> - define data</dt>
|
||||||
<dd>There are various data types:
|
<dd>
|
||||||
<ul>
|
<ul>
|
||||||
<li>integers
|
<li>integers
|
||||||
<ul>
|
<ul>
|
||||||
@ -311,21 +296,20 @@ where:
|
|||||||
<li><tt>center</tt> is a number which is added to every sine value</li>
|
<li><tt>center</tt> is a number which is added to every sine value</li>
|
||||||
<li><tt>amp</tt> is the sine amplitude</li>
|
<li><tt>amp</tt> is the sine amplitude</li>
|
||||||
<li><tt>size</tt> is the sine period</li>
|
<li><tt>size</tt> is the sine period</li>
|
||||||
<li><tt>first,last</tt> define range of values in the table.
|
<li><tt>first,last</tt> define the range of sine arguments.
|
||||||
They are optional. The default are <tt>0,size-1</tt>.</li>
|
They are optional. The default are <tt>0,size-1</tt>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
Example: <tt>dta a(sin(0,1000,256,0,63))</tt> defines a table of 64 words
|
Example: <tt>dta a(sin(0,1000,256,0,63))</tt> defines a table of 64 words
|
||||||
representing a quarter of sine with the amplitude of 1000.</li>
|
representing a quarter of sine with the amplitude of 1000.</li>
|
||||||
<li>real numbers: <tt>r(-1.23456e12)</tt><br/>
|
<li>real numbers: <tt>r(-1.23456e12)</tt><br/>
|
||||||
Real numbers are written in the 6-byte Atari Floating-Point format.</li>
|
Real numbers are stored in the 6-byte Atari Floating-Point format.</li>
|
||||||
<li>text strings
|
<li>text strings
|
||||||
<ul>
|
<ul>
|
||||||
<li>ASCII strings: <tt>c'Text'</tt> or <tt>c"Text"</tt></li>
|
<li>ASCII strings: <tt>c'Text'</tt> or <tt>c"Text"</tt></li>
|
||||||
<li>ANTIC strings: <tt>d'Text'</tt> or <tt>d"Text"</tt></li>
|
<li>ANTIC strings: <tt>d'Text'</tt> or <tt>d"Text"</tt></li>
|
||||||
</ul>
|
</ul>
|
||||||
A character string consists of any of characters surrounded by quotation
|
A character string consists of any of characters surrounded by quotation
|
||||||
marks. Within a string, a single quotation mark character is
|
marks. You can include the quotation marks in the string by doubling them.<br/>
|
||||||
represented by two succesive quotation marks.<br/>
|
|
||||||
Placing a <tt>*</tt> character after a string inverts
|
Placing a <tt>*</tt> character after a string inverts
|
||||||
the highest bit in every byte of the string.</li>
|
the highest bit in every byte of the string.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -345,7 +329,7 @@ Examples:
|
|||||||
icl 'lib/fileio'
|
icl 'lib/fileio'
|
||||||
</pre>
|
</pre>
|
||||||
Note: for portability, you should use only relative paths and slash
|
Note: for portability, you should use only relative paths and slash
|
||||||
as the separator. This guarantees that your sources will compile under Windows
|
as the separator. This assures that your sources will compile under Windows
|
||||||
and Linux.</dd>
|
and Linux.</dd>
|
||||||
<dt><tt><b>END</b></tt> - end assembling file</dt>
|
<dt><tt><b>END</b></tt> - end assembling file</dt>
|
||||||
<dd>Remaining part of the file is not assembled. If this statement does
|
<dd>Remaining part of the file is not assembled. If this statement does
|
||||||
@ -358,23 +342,20 @@ Example:
|
|||||||
<dt><tt><b>INS</b></tt> - insert contents of file</dt>
|
<dt><tt><b>INS</b></tt> - insert contents of file</dt>
|
||||||
<dd>Copies every byte of the specified file into the object file and updates
|
<dd>Copies every byte of the specified file into the object file and updates
|
||||||
the origin counter, as if these bytes were defined with <tt>DTA</tt>.<br/>
|
the origin counter, as if these bytes were defined with <tt>DTA</tt>.<br/>
|
||||||
You may specify a range of the inserted file. The syntax is following:
|
You may specify a range of the file to insert. The syntax is:
|
||||||
<pre>
|
<pre>
|
||||||
ins 'file'[,offset[,length]]
|
ins 'file'[,offset[,length]]
|
||||||
</pre>
|
</pre>
|
||||||
The first byte in a file has the offset of zero.<br/>
|
The first byte in a file has the offset of zero.<br/>
|
||||||
If the offset is negative, it is counted from the end of the file.<br/>
|
If the offset is negative, it counts from the end of the file.<br/>
|
||||||
Examples:
|
Examples:
|
||||||
<pre>
|
<pre>
|
||||||
ins 'picture.raw'
|
ins 'picture.raw'
|
||||||
ins 'file',-256 insert last 256 bytes of file
|
ins 'file',-256 insert last 256 bytes of file
|
||||||
ins 'file',10,10 insert bytes 10..19 of file
|
ins 'file',10,10 insert bytes 10..19 of file
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><tt><b>RUN</b></tt> - generate run address</dt>
|
<dt><tt><b>RUN</b></tt> - set run address in the Atari executable format</dt>
|
||||||
<dd>An Atari executable program should specify a run address.
|
<dd><pre> run addr
|
||||||
A program may be loaded in many areas of the memory and started from any
|
|
||||||
address.
|
|
||||||
<pre> run addr
|
|
||||||
</pre>
|
</pre>
|
||||||
is equivalent to:
|
is equivalent to:
|
||||||
<pre> org $2e0
|
<pre> org $2e0
|
||||||
@ -383,18 +364,16 @@ is equivalent to:
|
|||||||
Example:
|
Example:
|
||||||
<pre> run main
|
<pre> run main
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><tt><b>INI</b></tt> - generate init address</dt>
|
<dt><tt><b>INI</b></tt> - set init address in the Atari executable format</dt>
|
||||||
<dd>An Atari executable program may have some routines which are executed
|
<dd>Example:
|
||||||
during the loading process. There may be many init blocks in one file.<br/>
|
|
||||||
Example:
|
|
||||||
<pre> ini showpic
|
<pre> ini showpic
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><tt><b>ERT</b></tt> - generate an error if an expression is true</dt>
|
<dt><tt><b>ERT</b></tt> - generate error if expression evaluates to true</dt>
|
||||||
<dd>Examples:
|
<dd>Examples:
|
||||||
<pre> ert *>$c000
|
<pre> ert *>$c000
|
||||||
ert len1>$ff||len2>$ff
|
ert len1>$ff||len2>$ff
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><a name="new_eli"/><tt><b>IFT</b></tt> - assemble if expression is
|
<dt><a id="new_eli"/><tt><b>IFT</b></tt> - assemble if expression is
|
||||||
true<br/>
|
true<br/>
|
||||||
<tt><b>ELI</b></tt> - else if<br/>
|
<tt><b>ELI</b></tt> - else if<br/>
|
||||||
<tt><b>ELS</b></tt> - else<br/>
|
<tt><b>ELS</b></tt> - else<br/>
|
||||||
@ -433,11 +412,11 @@ to use a <tt>CLC</tt> before <tt>ADC</tt> for every simple addition.<br/>
|
|||||||
<tt>CLC</tt> and <tt>ADC</tt>.</dd>
|
<tt>CLC</tt> and <tt>ADC</tt>.</dd>
|
||||||
<dt><tt><b>SUB</b></tt> - subtraction</dt>
|
<dt><tt><b>SUB</b></tt> - subtraction</dt>
|
||||||
<dd>It is <tt>SEC</tt> and <tt>SBC</tt>.</dd>
|
<dd>It is <tt>SEC</tt> and <tt>SBC</tt>.</dd>
|
||||||
<dt><a name="new_repskip"/><tt><b>RCC, RCS, REQ, RMI, RNE, RPL, RVC,
|
<dt><a id="new_repskip"/><tt><b>RCC, RCS, REQ, RMI, RNE, RPL, RVC,
|
||||||
RVS</b></tt> - conditional repeat</dt>
|
RVS</b></tt> - conditional repeat</dt>
|
||||||
<dd>These are branches to the previous instruction.
|
<dd>These are branches to the previous instruction.
|
||||||
They take no operand, because the branch target
|
They take no operand, because the branch target
|
||||||
is the address of previously assembled instruction.<br/>
|
is the address of the previously assembled instruction.<br/>
|
||||||
Example:
|
Example:
|
||||||
<pre> ldx #0
|
<pre> ldx #0
|
||||||
mva:rne $500,x $600,x+
|
mva:rne $500,x $600,x+
|
||||||
@ -465,7 +444,7 @@ In the above example the word-sized variable $80 is incremented by 40.</dd>
|
|||||||
jumps</dt>
|
jumps</dt>
|
||||||
<dd>These are a kind of 'long' branches. While standard branches
|
<dd>These are a kind of 'long' branches. While standard branches
|
||||||
(such as <tt>BNE</tt>) have range of -128..+127, these jumps have range
|
(such as <tt>BNE</tt>) have range of -128..+127, these jumps have range
|
||||||
of all 64 kB.<br/>
|
of 64 kB.<br/>
|
||||||
Example:
|
Example:
|
||||||
<pre> jne dest
|
<pre> jne dest
|
||||||
</pre>is equivalent to:
|
</pre>is equivalent to:
|
||||||
@ -486,28 +465,28 @@ and substitutes two commands:
|
|||||||
mvx source dest = ldx source : stx dest
|
mvx source dest = ldx source : stx dest
|
||||||
mvy source dest = ldy source : sty dest
|
mvy source dest = ldy source : sty dest
|
||||||
</pre></dd>
|
</pre></dd>
|
||||||
<dt><a name="new_mwinde"/><tt><b>MWA, MWX, MWY</b></tt> - move word using
|
<dt><a id="new_mwinde"/><tt><b>MWA, MWX, MWY</b></tt> - move word using
|
||||||
accumulator, X or Y</dt>
|
accumulator, X or Y</dt>
|
||||||
<dd>These pseudo-commands require two operands
|
<dd>These pseudo-commands require two operands
|
||||||
and are combinations of two <tt>MV*</tt>'s:
|
and are combinations of two <tt>MV*</tt>'s:
|
||||||
one to move the low byte, and the other to move the high byte.<br/>
|
one to move the low byte, and the other to move the high byte.<br/>
|
||||||
You can't use indirect nor pseudo addressing mode with <tt>MW*</tt>.
|
You can't use indirect nor pseudo addressing mode with <tt>MW*</tt>.
|
||||||
Destination must be an absolute address (optionally indexed).<br/>
|
Destination must be an absolute address, optionally indexed.<br/>
|
||||||
When source is also absolute, an <tt>mw* source dest</tt> will be:
|
When source is also an absolute address, an <tt>mw* source dest</tt> expands to:
|
||||||
<pre> mv* source dest
|
<pre> mv* source dest
|
||||||
mv* source+1 dest+1
|
mv* source+1 dest+1
|
||||||
</pre>
|
</pre>
|
||||||
When source is an immediate, an <tt>mw* #immed dest</tt> will be:
|
When source is an immediate value, an <tt>mw* #immed dest</tt> expands to:
|
||||||
<pre> mv* <immed dest
|
<pre> mv* <immed dest
|
||||||
mv* >immed dest+1
|
mv* >immed dest+1
|
||||||
</pre>
|
</pre>
|
||||||
When <tt><immed</tt> equals <tt>>immed</tt> and <tt>immed</tt>
|
When <tt><immed</tt> equals <tt>>immed</tt> and <tt>immed</tt>
|
||||||
is not forward-referenced, <b>xasm</b> uses an optimization:
|
is not forward-referenced, <b>xasm</b> skips the second <tt>LD*</tt>:
|
||||||
<pre> mv* <immed dest
|
<pre> mv* <immed dest
|
||||||
st* dest+1
|
st* dest+1
|
||||||
</pre>
|
</pre>
|
||||||
If possible, <tt>MWX</tt> and <tt>MWY</tt> use increment/decrement
|
If possible, <tt>MWX</tt> and <tt>MWY</tt> use increment/decrement
|
||||||
commands. E.g. <tt>mwx #1 dest</tt> is assembled as:
|
commands. For example, <tt>mwx #1 dest</tt> expands to:
|
||||||
<pre> ldx #1
|
<pre> ldx #1
|
||||||
stx dest
|
stx dest
|
||||||
dex
|
dex
|
||||||
@ -523,24 +502,24 @@ the <tt>@</tt> character (as in Quick Assembler).</p>
|
|||||||
which use the low/high byte of a 16-bit word constant.
|
which use the low/high byte of a 16-bit word constant.
|
||||||
They are for Quick Assembler compatibility.
|
They are for Quick Assembler compatibility.
|
||||||
You can use traditional <tt>#<</tt> and <tt>#></tt>.
|
You can use traditional <tt>#<</tt> and <tt>#></tt>.
|
||||||
Note <tt>lda >$ff+5</tt> loads 1 (<tt>>$104</tt>),
|
Note that <tt>lda >$ff+5</tt> loads 1 (<tt>>$104</tt>),
|
||||||
while <tt>lda #>$ff+5</tt>
|
while <tt>lda #>$ff+5</tt>
|
||||||
loads 5 (<tt>0+5</tt>) to the accumulator, because the unary operator
|
loads 5 (<tt>0+5</tt>) to the accumulator, because the unary operator
|
||||||
<tt>></tt> has a higher priority than the binary plus.</p>
|
<tt>></tt> has a higher priority than the binary plus.</p>
|
||||||
<p>In absolute addressing modes, <b>xasm</b> examines the expression
|
<p>You can explicitly choose absolute (<tt>a:</tt>)
|
||||||
and uses zero-page addressing mode if it supposes it's possible.
|
and zero-page (<tt>z:</tt>) addressing modes.</p>
|
||||||
You may override it with <tt>a:</tt> and <tt>z:</tt> prefixes.</p>
|
|
||||||
<p>Examples:</p>
|
<p>Examples:</p>
|
||||||
<pre>
|
<pre>
|
||||||
nop
|
nop
|
||||||
asl @
|
asl @
|
||||||
lda >$1234 assembles to lda #$12
|
lda >$1234 assembles to lda #$12
|
||||||
lda $100,x
|
lda $100,x
|
||||||
lda a:0 generates 16-bit address
|
lda 0 zero-page (8-bit address)
|
||||||
|
lda a:0 absolute (16-bit address)
|
||||||
jmp ($0a)
|
jmp ($0a)
|
||||||
lda ($80),y
|
lda ($80),y
|
||||||
</pre>
|
</pre>
|
||||||
<p>There are also pseudo addressing modes, which are similar to
|
<p>There are pseudo addressing modes, which are similar to
|
||||||
pseudo-commands. You may use them just like standard addressing modes
|
pseudo-commands. You may use them just like standard addressing modes
|
||||||
in all 6502 commands and pseudo-commands, except for
|
in all 6502 commands and pseudo-commands, except for
|
||||||
<tt>MWA</tt>, <tt>MWX</tt> and <tt>MWY</tt>:</p>
|
<tt>MWA</tt>, <tt>MWX</tt> and <tt>MWY</tt>:</p>
|
||||||
@ -552,10 +531,16 @@ in all 6502 commands and pseudo-commands, except for
|
|||||||
cmd (z),y- = cmd (z),y : dey
|
cmd (z),y- = cmd (z),y : dey
|
||||||
cmd (z,0) = ldx #0 : cmd (z,x)
|
cmd (z,0) = ldx #0 : cmd (z,x)
|
||||||
cmd (z),0 = ldy #0 : cmd (z),y
|
cmd (z),0 = ldy #0 : cmd (z),y
|
||||||
<a name="new_adrmodes"/> cmd (z),0+ = ldy #0 : cmd (z),y : iny
|
<a id="new_adrmodes"/> cmd (z),0+ = ldy #0 : cmd (z),y : iny
|
||||||
cmd (z),0- = ldy #0 : cmd (z),y : dey
|
cmd (z),0- = ldy #0 : cmd (z),y : dey
|
||||||
</pre>
|
</pre>
|
||||||
<h2>CHANGES</h2>
|
<h2>HISTORY</h2>
|
||||||
|
<h3>Version 3.0.1 (2007-04-22)</h3>
|
||||||
|
<ul>
|
||||||
|
<li>fixed a bug in <tt>OPT H-</tt> mode</li>
|
||||||
|
<li>made <b>xasm</b> compilable with the latest D compiler v1.010
|
||||||
|
(there were incompatible changes in the D language and library)</li>
|
||||||
|
</ul>
|
||||||
<h3>Version 3.0.0 (2005-05-22)</h3>
|
<h3>Version 3.0.0 (2005-05-22)</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>rewritten from the x86 assembly language to the
|
<li>rewritten from the x86 assembly language to the
|
||||||
@ -714,8 +699,6 @@ addressing modes</a></li>
|
|||||||
<h2>AUTHOR</h2>
|
<h2>AUTHOR</h2>
|
||||||
<p>Piotr Fusik (<a href="mailto:fox@scene.pl">fox@scene.pl</a>)</p>
|
<p>Piotr Fusik (<a href="mailto:fox@scene.pl">fox@scene.pl</a>)</p>
|
||||||
<h2>SEE ALSO</h2>
|
<h2>SEE ALSO</h2>
|
||||||
<p><a href="editors.htm">How to configure a text editor for a convenient use
|
|
||||||
of xasm</a></p>
|
|
||||||
<p>xasm home page
|
<p>xasm home page
|
||||||
(<a href="http://xasm.atari.org">http://xasm.atari.org</a>)</p>
|
(<a href="http://xasm.atari.org">http://xasm.atari.org</a>)</p>
|
||||||
</body>
|
</body>
|
@ -1,5 +1,4 @@
|
|||||||
# xasm settings for SciTE (www.scintilla.org)
|
# xasm settings for SciTE (http://www.scintilla.org/SciTE.html)
|
||||||
# written by Piotr Fusik <fox@scene.pl>
|
|
||||||
|
|
||||||
file.patterns.asx=*.asx
|
file.patterns.asx=*.asx
|
||||||
filter.asx=xasm (asx)|$(file.patterns.asm)|
|
filter.asx=xasm (asx)|$(file.patterns.asm)|
|
Loading…
x
Reference in New Issue
Block a user