mirror of
https://github.com/pfusik/xasm.git
synced 2024-06-11 23:29:28 +00:00
106 lines
4.0 KiB
HTML
106 lines
4.0 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!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">
|
|
<head>
|
|
<title>xasm</title>
|
|
<meta name="Description" content="xasm is a 6502 cross-assembler for Windows and Linux." />
|
|
<meta name="Keywords" content="xasm,6502,cross-assembler,atari,8-bit" />
|
|
<meta name="Author" content="Piotr Fusik" />
|
|
<style type="text/css">
|
|
body { background-color: #f8f8f8; color: black; font-family: sans-serif; }
|
|
h1 { color: #20a0a0; border-bottom: solid 3px #d0d0d0; }
|
|
h2 { color: #20a0a0; border-bottom: solid 2px #d0d0d0; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>xasm - 6502 cross-assembler</h1>
|
|
<p>xasm is a free tool for programming old 8-bit computers based on the 6502 processor.</p>
|
|
<h2>History</h2>
|
|
<p>First version of xasm was written in 1998. I needed a cross-assembler
|
|
that could understand the syntax of Quick Assembler
|
|
which I used for 8-bit Atari programming before I got a PC.
|
|
Initially xasm supported the syntax of QA and nothing more.
|
|
I quickly realized that I could extend the syntax to make it more expressive.
|
|
This led to xasm 2.0, still in 1998. I added some more features
|
|
next year. In 2002 I released many versions which contained
|
|
mostly bugfixes. In 2005 there were some minor enhancements and bug fixes,
|
|
as well as the whole assembler was rewritten from the x86 assembly language
|
|
it was initially written in to the
|
|
<a href="http://www.digitalmars.com/d">D programming language</a>.
|
|
The rewrite introduced a bug, hopefully fixed in version 3.0.1
|
|
released 22nd April 2007.</p>
|
|
<h2>Syntax</h2>
|
|
<p>6502 assembler code is usually full of LDA, STA, LDA, STA sequences.
|
|
With xasm you can use MVA as a shortcut for LDA/STA pair
|
|
or even MWA for 16-bit transfers. You can avoid defining labels
|
|
when you need short jumps, thanks to conditional skip
|
|
and repeat pseudo-instructions. You can put two instructions
|
|
that share their argument in one line.
|
|
These are just some of the features that help you program
|
|
in a more concise way. Let's look at typical 6502 code
|
|
(which is valid in xasm):</p>
|
|
<pre>
|
|
lda #<dest
|
|
sta ptr
|
|
lda #>dest
|
|
sta ptr+1
|
|
ldx #192
|
|
do_line
|
|
ldy #39
|
|
do_byte
|
|
lda pattern,y
|
|
sta (ptr),y
|
|
dey
|
|
bpl do_byte
|
|
lda #40
|
|
clc
|
|
adc ptr
|
|
sta ptr
|
|
bcc skip
|
|
inc ptr+1
|
|
skip
|
|
dex
|
|
bne do_line
|
|
</pre>
|
|
<p>Using xasm features this code can be rewritten to:</p>
|
|
<pre>
|
|
mwa #dest ptr
|
|
ldx #192
|
|
do_line
|
|
ldy #39
|
|
mva:rpl pattern,y (ptr),y-
|
|
lda #40
|
|
add:sta ptr
|
|
scc:inc ptr+1
|
|
dex:bne do_line
|
|
</pre>
|
|
<h2>Usage</h2>
|
|
<p>xasm is a command-line tool so you additionally need a general-purpose text editor.
|
|
I use <a href="http://www.scintilla.org/SciTE.html">SciTE</a>.
|
|
Syntax highlighting definition for it is included with xasm.
|
|
To install it, copy <em>xasm.properties</em> to the SciTE directory,
|
|
select <em>Options / Open Global Options File</em>, type <kbd>import xasm</kbd>
|
|
at the end and save the global configuration file.</p>
|
|
<p><img src="scite.png" alt="xasm code in SciTE" /></p>
|
|
<h2>Download</h2>
|
|
<ul>
|
|
<li><a href="xasm-3.0.1-win32.zip">xasm 3.0.1 for Windows</a></li>
|
|
<li><a href="xasm-3.0.1-src.zip">xasm 3.0.1 source code</a></li>
|
|
<li><a href="xasm261.zip">xasm 2.6.1 for DOS/Windows</a></li>
|
|
</ul>
|
|
<p>For other systems, such as GNU/Linux and MacOS X, install the latest D compiler
|
|
and compile xasm from source code.</p>
|
|
<h2>Inflate</h2>
|
|
<p>Need a good decompression routine for 6502?
|
|
See my <a href="inflate.html">inflate routine</a>.</p>
|
|
<h2>Links</h2>
|
|
<ul>
|
|
<li><a href="http://atari800.sourceforge.net/">Atari800 emulator</a></li>
|
|
<li><a href="http://sources.pigwa.net/">Atari XL/XE Source Archive</a></li>
|
|
<li><a href="http://www.cc65.org/">cc65 cross-compiler</a></li>
|
|
<li><a href="http://epi.atari8.info/hcasm.php">HardCore Assembler</a></li>
|
|
<li><a href="http://mads.atari8.info/">Mad-Assembler</a></li>
|
|
</ul>
|
|
</body>
|
|
</html>
|