1
0
mirror of https://github.com/pfusik/xasm.git synced 2024-12-21 09:29:39 +00:00
xasm/README.md

113 lines
3.5 KiB
Markdown
Raw Normal View History

2021-06-16 07:11:04 +00:00
[![Build Status](https://travis-ci.com/pfusik/xasm.svg?branch=master)](https://travis-ci.com/github/pfusik/xasm)
2019-10-06 15:35:21 +00:00
2013-05-10 18:14:56 +00:00
xasm
====
xasm is a 6502 cross-assembler with original syntax extensions.
2014-06-11 10:00:06 +00:00
By default it generates binaries
for [Atari 8-bit computers](http://en.wikipedia.org/wiki/Atari_8-bit_family).
2013-05-10 18:14:56 +00:00
2014-06-11 10:00:06 +00:00
Syntax
------
2013-05-10 18:14:56 +00:00
2017-02-08 18:59:22 +00:00
6502 assembly code is full of LDA, STA, LDA, STA sequences.
2014-06-11 10:00:06 +00:00
With xasm you can use MVA as a shortcut for an LDA/STA pair or even MWA for 16-bit transfers.
2017-02-08 18:59:22 +00:00
Short branches can be replaced with conditional skip and repeat pseudo-instructions.
You can use a pair of instructions with a shared argument.
2014-06-11 10:00:06 +00:00
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 also valid in xasm):
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
Using xasm's features this code can be rewritten to:
mwa #dest ptr
ldx #192
do_line
ldy #39
mva:rpl pattern,y (ptr),y-
2017-02-08 18:59:22 +00:00
lda #40
2014-06-11 10:00:06 +00:00
add:sta ptr
scc:inc ptr+1
dex:bne do_line
2017-02-08 18:59:22 +00:00
xasm syntax is an extension of Quick Assembler's (created in 1991 for Atari 8-bit).
Accumulator shifts should be written as in `asl @`.
2014-06-11 10:00:06 +00:00
Whitespace is important: it is required before the instruction
and disallowed in the operands, because it separates a comment from the operand, e.g.
lda #0 this is a comment, no need for a semicolon
This may look weird at first, but it enables nice features such as instruction pairs
and two-argument pseudo-instructions.
Usage
-----
xasm is a command-line tool.
Therefore you additionally need a programmer's text editor.
I use [SciTE](http://www.scintilla.org/SciTE.html).
To install xasm syntax highlighting and single-keystroke compilation,
copy `xasm.properties` to the SciTE directory.
2014-06-11 10:00:06 +00:00
For single source file programs, press Ctrl+F7 to compile.
You can double-click error messages to go to the incorrect line.
Press F5 to run the program in the emulator.
For larger projects, I use GNU Make. Press F7 to build (and possibly run)
a project as described in the `Makefile`. You can find my Makefiles in
[my repositories](https://github.com/pfusik?tab=repositories) on GitHub.
2014-06-11 10:00:06 +00:00
2014-07-22 08:22:17 +00:00
If you prefer VIM, see a link below.
2017-07-28 19:36:10 +00:00
Poetic License
--------------
This work 'as-is' we provide.
No warranty express or implied.
We've done our best,
to debug and test.
Liability for damages denied.
Permission is granted hereby,
to copy, share, and modify.
Use as is fit,
free or for profit.
These rights, on this notice, rely.
2014-06-11 10:00:06 +00:00
Download
--------
2019-11-20 16:43:51 +00:00
[xasm 3.1.1](https://github.com/pfusik/xasm/releases) for Windows, macOS, Ubuntu and Fedora.
2014-06-11 10:00:06 +00:00
Links
-----
2019-03-26 22:34:56 +00:00
* [Atari800](https://atari800.github.io/) - portable emulator of Atari 8-bit computers
2014-06-11 10:00:06 +00:00
* [Atari XL/XE Source Archive](http://sources.pigwa.net/) - source code of Atari demos, utilities and games
2019-03-26 22:34:56 +00:00
* [cc65](https://cc65.github.io/) - C cross-compiler targeting 6502-based systems
2014-06-11 10:00:06 +00:00
* [MADS](http://mads.atari8.info/) - another 6502/65816 cross-assembler, partially supporting xasm's syntax
2014-07-22 08:22:17 +00:00
* [vim-xasm](https://github.com/lybrown/vim-xasm) - VIM syntax highlighting for xasm
2017-02-08 18:59:22 +00:00
* [WUDSN IDE](http://wudsn.com/) - Eclipse plugin, front-end to several 6502 cross-assemblers, including xasm