X-Assembler 2.2 release.

This commit is contained in:
Piotr Fusik 1999-09-10 01:20:00 +02:00
parent fd5370e7c4
commit 0c019b97d1
25 changed files with 1465 additions and 1075 deletions

BIN
atari.pal

Binary file not shown.

View File

@ -1,34 +0,0 @@
Version 2.1
===========
- ICL-in-last-line bug fixed
- now 1 rather than -1 is true
- line repeating
- op-code extracting
- Unix and Atari eols support
Version 2.0
===========
- truncating name of object bug fixed
- EQU & DTA forward reference bugs fixed
- hex number recognizing bug fixed
- now .OBX is default extension for Atari executables
- assembling options (switches and OPT directive)
- listing generation
- label table generation
- conditional assembling
- user errors
- warnings
- improved headers generation
- improved expressions - 19 operators and brackets, 32-bit arithmetic
- improved signed numbers
- 6 new pseudo commands (memory-to-memory move)
- 8 pseudo addressing modes
- indirect conditional jumps
- Atari floating-point numbers generation
- improved INS: inserting specified part of file
Version 1.2
===========
- first release
===

View File

@ -1,61 +0,0 @@
Display List op-codes
=====================
Blank lines
-----------
$00 - 1 blank line
$10 - 2 blank lines
$20 - 3 blank lines
$30 - 4 blank lines
$40 - 5 blank lines
$50 - 6 blank lines
$60 - 7 blank lines
$70 - 8 blank lines
Jumps
-----
$01 $ll $hh - JMP $hhll - Jump & generate 1 blank line
$41 $ll $hh - JVB $hhll - Jump after vertical blank
Modes
-----
Most popular combinations of ANTIC modes with GTIA modes:
ANTIC mode | GTIA mode | OS mode | screen | font | bytes/line
----------------------------------------------------------------------
$2 | %00 | $0 | 40* 30* 2 | 128*8*8* 2 | 40
$2 | %01 | - | 40* 30*16 | 128*2*8*16 | 40
$2 | %10 | - | 40* 30* 9 | 128*2*8* 9 | 40
$2 | %11 | - | 40* 30*16 | 128*2*8*16 | 40
$3 | %00 | - | 40* 24* 2 | 128*8*8* 2 | 40
$4 | %00 | $c | 40* 30* 5 | 128*4*8* 4 | 40
$5 | %00 | $d | 40* 15* 5 | 128*4*8* 4 | 40
$6 | %00 | $1 | 20* 30* 5 | 64*8*8* 2 | 20
$7 | %00 | $3 | 20* 15* 5 | 64*8*8* 2 | 20
$8 | %00 | $3 | 40* 30* 4 | - | 10
$9 | %00 | $4 | 80* 60* 2 | - | 10
$a | %00 | $5 | 80* 60* 4 | - | 20
$b | %00 | $6 | 160*120* 2 | - | 20
$c | %00 | $e | 160*240* 2 | - | 20
$d | %00 | $7 | 160*120* 4 | - | 40
$e | %00 | $f | 160*240* 4 | - | 40
$f | %00 | $8 | 320*240* 2 | - | 40
$f | %01 | $9 | 80*240*16 | - | 40
$f | %10 | $a | 80*240* 9 | - | 40
$f | %11 | $b | 80*240*16 | - | 40
screen: columns*rows*colors
font: chars*sizex*sizey*colors
+$10 - Horizontal Scroll
+$20 - Vertical Scroll
+$40 $ll $hh - Load Screen Pointer $hhll
For all op-codes
----------------
+$80 - Display List Interrupt after getting all data for this line
When placing Display List in memory, remember it cannot cross 1 kB boundary.
Similarly, screen memory cannot cross 4 kB boundary.
===

BIN
doc/6502proc.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

View File

@ -1,4 +1,4 @@
* This program examines 6502 bugs!
* This program detects 6502 bugs.
* Please read text after program first.
icmd equ $342
@ -21,7 +21,7 @@ start lda #11 Clear screen
lda #$99 BCD 99+01=00
add #1
cld
beq *+4 Z flag set: no bug
seq Z flag set: no bug
lda #$ff
ldx <adctxt
jsr print
@ -36,10 +36,9 @@ start lda #11 Clear screen
irq brk BRK interrupt - infinite loop, so...
nmi inc ^31 NMI always occurs on BRK
cli
pla
pla
pla:pla
sub <irq
beq *+4 Return adr points BRK: no bug
seq Return adr points BRK: no bug
lda #$ff
ldx <brktxt
jsr print
@ -57,7 +56,7 @@ print pha Save A
jsr callio
ldx <nobtxt
pla Restore A
beq *+4 A=0: X=<nobtxt
seq A=0: X=<nobtxt
ldx <bugtxt A<>0: X=<bugtxt
lda #9 CIO write_to_eol command
ldy #$ff Limit of printed characters
@ -76,7 +75,7 @@ jmptxt dta c'JMP'
bugtxt dta c' bug detected!',b($9b)
nobtxt dta c' bug NOT detected.',b($9b)
ert *>*|$ff Program should fit on one page
ert *>start|$ff Program should fit on one page
org *|$ff
jmpptr dta a(jmp1)
@ -86,7 +85,7 @@ jmp1 lda #0 JMP bug not detected
run start
end
The program above checks 3 bugs:
The program above detects 3 bugs:
- 'ADC bug'
Flags N,V,Z are not properly set after ADC or SBC in decimal mode.
You can't rely on these flags after BCD operation.
@ -95,8 +94,6 @@ If an interrupt occurs on a BRK, it is executed with BRK-like values on stack.
This means a BRK is simply passed-by if a NMI occurs.
Beware of using BRK with other interrupts.
- 'JMP bug' - JMP ($xxff) fetches address from $xxff and $xx00.
X-Asm 2.0 warns you of using such a jump.
X-Asm warns you of using such a jump.
All these bugs are supposedly fixed in CMOS chips.
===

51
doc/gr0.htm Normal file
View File

@ -0,0 +1,51 @@
<HTML>
<HEAD>
<TITLE>GR0 1.1 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>GR0 version 1.1</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
</CENTER>
<H2>INTRODUCTION</H2>
GR0 is a simple tool that can change colors and font of DOS screen.
It can setup it to look similar to Atari text mode.
<H3>CHANGES</H3>
<H4>Version 1.1</H4>
<UL>
<LI> first release
</UL>
<HR>
<H2>USAGE</H2>
You can run GR0 without any parameters to see available options. They are:
<DL>
<DT><TT>/a</TT>
<DD>Set Atari scheme. It is equivalent to options <TT>/b:1 /c:7 /n /l /x</TT><P>
<DT><TT>/b:nn</TT>
<DD>Set background color nn, where nn is decimal number of range 0-15<P>
<DT><TT>/c:nn</TT>
<DD>Set foreground (letters) color nn, where nn is decimal number of range 0-15<P>
<DT><TT>/d</TT>
<DD>Set default PC font. Resets all characters.<P>
<DT><TT>/f:fname</TT>
<DD>Set external Atari font. Reads characters 0-127 from standard Atari font file
(8*8*128). In 25 lines mode, font is resized. Default extension .FNT will be added
to filename, if none given.<P>
<DT><TT>/i</TT>
<DD>Set characters 128-255 to inverse of 0-127.
<TT>/i</TT> can only be used with <TT>/a</TT>, <TT>/f</TT> or <TT>/x</TT>.<P>
<DT><TT>/l</TT>
<DD>Select 50 lines font. Without this option, 25 lines font is selected.<P>
<DT><TT>/n</TT>
<DD>Initialize text mode. Clears screen and restores default font and colors.<P>
<DT><TT>/x</TT>
<DD>Set Atari built-in font. Sets characters 0-127 to standard Atari font.
It looks better with /l option.<P>
</DL>
In Windows, font changes only in full-screen mode. Colors and number of lines change
also in a window.
</BODY>
</HTML>

221
doc/gtia.htm Normal file
View File

@ -0,0 +1,221 @@
<HTML>
<HEAD>
<TITLE>GTIA Documentation</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>GTIA Documentation</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
<P>
<H2>Registers</H2>
<TABLE BORDER>
<TR>
<TD><I>&nbsp;Address&nbsp;</I></TD><TD><I>&nbsp;Read register&nbsp;</I></TD><TD><I>&nbsp;Write register&nbsp;</I></TD>
<TD><I>&nbsp;Address&nbsp;</I></TD><TD><I>&nbsp;Read register&nbsp;</I></TD><TD><I>&nbsp;Write register&nbsp;</I></TD>
</TR><TR>
<TD ALIGN=center><TT>^00</TT></TD><TD><A HREF="#kolmxpf">KOLM0PF</A></TD><TD><A HREF="#hpospx">HPOSP0</A></TD>
<TD ALIGN=center><TT>^10</TT></TD><TD><A HREF="#trigx">TRIG0</A></TD><TD><A HREF="#grafpx">GRAFP3</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^01</TT></TD><TD><A HREF="#kolmxpf">KOLM1PF</A></TD><TD><A HREF="#hpospx">HPOSP1</A></TD>
<TD ALIGN=center><TT>^11</TT></TD><TD><A HREF="#trigx">TRIG1</A></TD><TD><A HREF="#grafm">GRAFPM</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^02</TT></TD><TD><A HREF="#kolmxpf">KOLM2PF</A></TD><TD><A HREF="#hpospx">HPOSP2</A></TD>
<TD ALIGN=center><TT>^12</TT></TD><TD>unused</TD><TD><A HREF="#colpmx">COLPM0</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^03</TT></TD><TD><A HREF="#kolmxpf">KOLM3PF</A></TD><TD><A HREF="#hpospx">HPOSP3</A></TD>
<TD ALIGN=center><TT>^13</TT></TD><TD><A HREF="#trigx">TRIG3</A></TD><TD><A HREF="#colpmx">COLPM1</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^04</TT></TD><TD><A HREF="#kolpxpf">KOLP0PF</A></TD><TD><A HREF="#hposmx">HPOSM0</A></TD>
<TD ALIGN=center><TT>^14</TT></TD><TD><A HREF="#pal">PAL</A></TD><TD><A HREF="#colpmx">COLPM2</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^05</TT></TD><TD><A HREF="#kolpxpf">KOLP1PF</A></TD><TD><A HREF="#hposmx">HPOSM1</A></TD>
<TD ALIGN=center><TT>^15</TT></TD><TD>unused</TD><TD><A HREF="#colpmx">COLPM3</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^06</TT></TD><TD><A HREF="#kolpxpf">KOLP2PF</A></TD><TD><A HREF="#hposmx">HPOSM2</A></TD>
<TD ALIGN=center><TT>^16</TT></TD><TD>unused</TD><TD><A HREF="#colpfx">COLPF0</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^07</TT></TD><TD><A HREF="#kolpxpf">KOLP3PF</A></TD><TD><A HREF="#hposmx">HPOSM3</A></TD>
<TD ALIGN=center><TT>^17</TT></TD><TD>unused</TD><TD><A HREF="#colpfx">COLPF1</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^08</TT></TD><TD><A HREF="#kolmxp">KOLM0P</A></TD><TD><A HREF="#sizepx">SIZEP0</A></TD>
<TD ALIGN=center><TT>^18</TT></TD><TD>unused</TD><TD><A HREF="#colpfx">COLPF2</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^09</TT></TD><TD><A HREF="#kolmxp">KOLM1P</A></TD><TD><A HREF="#sizepx">SIZEP1</A></TD>
<TD ALIGN=center><TT>^19</TT></TD><TD>unused</TD><TD><A HREF="#colpfx">COLPF3</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0A</TT></TD><TD><A HREF="#kolmxp">KOLM2P</A></TD><TD><A HREF="#sizepx">SIZEP2</A></TD>
<TD ALIGN=center><TT>^1A</TT></TD><TD>unused</TD><TD><A HREF="#colbak">COLBAK</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0B</TT></TD><TD><A HREF="#kolmxp">KOLM3P</A></TD><TD><A HREF="#sizepx">SIZEP3</A></TD>
<TD ALIGN=center><TT>^1B</TT></TD><TD>unused</TD><TD><A HREF="#gtiactl">GTIACTL</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0C</TT></TD><TD><A HREF="#kolpxp">KOLP0P</A></TD><TD><A HREF="#sizem">SIZEM</A></TD>
<TD ALIGN=center><TT>^1C</TT></TD><TD>unused</TD><TD><A HREF="#vdelay">VDELAY</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0D</TT></TD><TD><A HREF="#kolpxp">KOLP1P</A></TD><TD><A HREF="#grafpx">GRAFP0</A></TD>
<TD ALIGN=center><TT>^1D</TT></TD><TD>unused</TD><TD><A HREF="#pmcntl">PMCNTL</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0E</TT></TD><TD><A HREF="#kolpxp">KOLP2P</A></TD><TD><A HREF="#grafpx">GRAFP1</A></TD>
<TD ALIGN=center><TT>^1E</TT></TD><TD>unused</TD><TD><A HREF="#hitclr">HITCLR</A></TD>
</TR><TR>
<TD ALIGN=center><TT>^0F</TT></TD><TD><A HREF="#kolpxp">KOLP3P</A></TD><TD><A HREF="#grafpx">GRAFP2</A></TD>
<TD ALIGN=center><TT>^1F</TT></TD><TD><A HREF="#consol">CONSOL</A></TD><TD><A HREF="#consol">CONSOL</A></TD>
</TR>
</TABLE>
<P>
<HR>
<P>
<H2>Description</H2>
</CENTER>
<A NAME="colbak"><U>COLBAK</U>
- <B>Color of background</B><BR>
bit 0 - unused<BR>
bits 3-1 - luminace<BR>
bits 7-4 - hue<P>
<A NAME="colpfx"><U>COLPF0</U> <U>COLPF1</U> <U>COLPF2</U> <U>COLPF3</U>
- <B>Colors of player field</B><BR>
bit 0 - unused<BR>
bits 3-1 - luminace<BR>
bits 7-4 - hue<P>
<A NAME="colpmx"><U>COLPM0</U> <U>COLPM1</U> <U>COLPM2</U> <U>COLPM3</U>
- <B>Colors of players and missiles</B><BR>
bit 0 - unused<BR>
bits 3-1 - luminace<BR>
bits 7-4 - hue<P>
<A NAME="consol"><U>CONSOL</U>
- <B>Consol keys</B><BR>
This is the only read/write register in GTIA.
Value written is negated on read. Bits 0-2 are ANDed
with keys status. Reset bit means key pressed.<BR>
bit 0 - START key<BR>
bit 1 - SELECT key<BR>
bit 2 - OPTION key<BR>
bit 3 - click sound<BR>
bits 4-7 - unused (=0)<P>
<A NAME="grafm"><U>GRAFM</U>
- <B>Graphics of missiles</B><BR>
bits 1,0 - graphics of missile 0<BR>
bits 3,2 - graphics of missile 1<BR>
bits 5,4 - graphics of missile 2<BR>
bits 7,6 - graphics of missile 3<P>
<A NAME="grafpx"><U>GRAFP0</U> <U>GRAFP1</U> <U>GRAFP2</U> <U>GRAFP3</U>
- <B>Graphics of players</B><P>
<A NAME="gtiactl"><U>GTIACTL</U>
- <B>GTIA control</B><BR>
bits 3-0 - priorities of players and missiles<BR>
0001 - P0, P1, P2, P3, PF0, PF1, PF2, PF3, BAK<BR>
0010 - P0, P1, PF0, PF1, PF2, PF3, P2, P3, BAK<BR>
0100 - PF0, PF1, PF2, PF3, P0, P1, P2, P3, BAK<BR>
1000 - PF0, PF1, P0, P1, P2, P3, PF2, PF3, BAK<BR>
Players/missiles and playfields are mentioned from highest to lowest priority.<BR>
Other combinations of bits 3-0 cause strange side effects.<BR>
bit 4 - set all missiles color to COLPF3<BR>
bit 5 - enable ORing colors P0 with P1 and P2 with P3 on common areas<BR>
bits 7,6 - GTIA extra graphics mode<BR>
00 - off<BR>
01 - 16 luminaces<BR>
10 - 9 colors<BR>
11 - 16 hues<P>
<A NAME="hitclr"><U>HITCLR</U>
- <B>Clear collision registers</B><BR>
Any value written to this register causes collision registers to be reset.<P>
<A NAME="hposmx"><U>HPOSM0</U> <U>HPOSM1</U> <U>HPOSM2</U> <U>HPOSM3</U>
- <B>Horizontal positions of missiles</B><P>
<A NAME="hpospx"><U>HPOSP0</U> <U>HPOSP1</U> <U>HPOSP2</U> <U>HPOSP3</U>
- <B>Horizontal positions of players</B><P>
<A NAME="kolmxp"><U>KOLM0P</U> <U>KOLM1P</U> <U>KOLM2P</U> <U>KOLM3P</U>
- <B>Collisions of missiles with players</B><BR>
bit 0 - collision with player 0<BR>
bit 1 - collision with player 1<BR>
bit 2 - collision with player 2<BR>
bit 3 - collision with player 3<BR>
bits 4-7 - unused (=0)<P>
<A NAME="kolmxpf"><U>KOLM0PF</U> <U>KOLM1PF</U> <U>KOLM2PF</U> <U>KOLM3PF</U>
- <B>Collisions of missiles with playfield</B><BR>
bit 0 - collision with playfield 0<BR>
bit 1 - collision with playfield 1<BR>
bit 2 - collision with playfield 2<BR>
bit 3 - collision with playfield 3<BR>
bits 4-7 - unused (=0)<P>
<A NAME="kolpxp"><U>KOLP0P</U> <U>KOLP1P</U> <U>KOLP2P</U> <U>KOLP3P</U>
- <B>Collisions of players with players</B><BR>
bit 0 - collision with player 0<BR>
bit 1 - collision with player 1<BR>
bit 2 - collision with player 2<BR>
bit 3 - collision with player 3<BR>
bits 4-7 - unused (=0)<P>
<A NAME="kolpxpf"><U>KOLP0PF</U> <U>KOLP1PF</U> <U>KOLP2PF</U> <U>KOLP3PF</U>
- <B>Collisions of players with playfield</B><BR>
bit 0 - collision with playfield 0<BR>
bit 1 - collision with playfield 1<BR>
bit 2 - collision with playfield 2<BR>
bit 3 - collision with playfield 3<BR>
bits 4-7 - unused (=0)<P>
<A NAME="pal"><U>PAL</U>
- <B>PAL system flag</B><BR>
bit 0 - unused<BR>
bits 1-3 - 000 if TV system is PAL. Else it is NTSC<BR>
bits 4-7 - unused (=0)<P>
<A NAME="pmctl"><U>PMCTL</U>
- <B>Player/Missile Control</B><BR>
bit 0 - get missiles data from ANTIC<BR>
bit 1 - get players data from ANTIC<BR>
bit 2 - lock triggers when pressed<BR>
bits 3-7 - unused<P>
<A NAME="sizem"><U>SIZEM</U>
- <B>Sizes of missiles</B><BR>
Two bits set size of each missile:<BR>
00 - single size<BR>
01 - double size<BR>
10 - single size<BR>
11 - quad size<BR>
bits 1,0 - size of missile 0<BR>
bits 3,2 - size of missile 1<BR>
bits 5,4 - size of missile 2<BR>
bits 7,6 - size of missile 3<P>
<A NAME="sizepx"><U>SIZEP0</U> <U>SIZEP1</U> <U>SIZEP2</U> <U>SIZEP3</U>
- <B>Sizes of players</B><BR>
bits 1,0 - size of player (see <A HREF="#sizem">SIZEM</A>)<BR>
bits 2-7 - unused<P>
<A NAME="trigx"><U>TRIG0</U> <U>TRIG1</U> <U>TRIG3</U>
- <B>Triggers</B><BR>
TRIG0 and TRIG1 contain trigger status of two joysticks.
TRIG3 contains presence of cartridge.<BR>
bit 0 - reset if trigger pressed<BR>
bits 1-7 - unused (=0)<P>
<A NAME="vdelay"><U>VDELAY</U>
- <B>Vertical delay of players and missiles</B><BR>
Causes players and missiles to be displayed one scanline lower.
Works only in two-line resolution.<BR>
bit 0 - delay missile 0<BR>
bit 1 - delay missile 1<BR>
bit 2 - delay missile 2<BR>
bit 3 - delay missile 3<BR>
bit 4 - delay player 0<BR>
bit 5 - delay player 1<BR>
bit 6 - delay player 2<BR>
bit 7 - delay player 3<P>
</BODY>
</HTML>

33
doc/index.htm Normal file
View File

@ -0,0 +1,33 @@
<HTML>
<HEAD>
<TITLE>X-ASM 2.2 Package Documentation</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>X-ASM Package version 2.2</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
<P>
Manuals of utilities:<P>
<TABLE>
<TR><TD><A HREF="xasm.htm">X-Assembler</A></TD><TD>6502 cross-assembler</TD></TR>
<TR><TD><A HREF="xboot.htm">X-BOOT</A></TD><TD>Atari executable -&gt; disk image converter</TD></TR>
<TR><TD><A HREF="xhead.htm">X-HEAD</A></TD><TD>Simple Atari executable analyzer</TD></TR>
<TR><TD><A HREF="xload.htm">X-LOAD</A></TD><TD>SIO2PC interface Atari executable loader</TD></TR>
<TR><TD><A HREF="gr0.htm">GR0</A></TD><TD>DOS screen adjuster</TD></TR>
</TABLE>
<P>
<HR>
<P>
Atari XL/XE documentation (under construction):<P>
<TABLE>
<TR><TD><A HREF="gtia.htm">GTIA</A></TD><TD>GTIA chip documentation</TD></TR>
<TR><TD><A HREF="cpubugs.asx">CPUBUGS.ASX</A></TD><TD>6502 bugs detector source</TD</TR>
</TABLE>
<P>
<HR>
<P>
All programs are <I>freeware</I>. Copyright (c) Taquart 1999.
</CENTER>
</BODY>
</HTML>

714
doc/xasm.htm Normal file
View File

@ -0,0 +1,714 @@
<HTML>
<HEAD>
<TITLE>X-Assembler 2.2 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>X-Assembler version 2.2</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
</CENTER>
<HR></P><A NAME="intro">
<H2>INTRODUCTION
&nbsp;<A HREF="#usage">USAGE</A>
&nbsp;<A HREF="#syntax">SYNTAX</A>
&nbsp;<A HREF="#faq">FAQ</A>
&nbsp;<A HREF="index.htm">BACK</A>
</H2>
The X-Assembler is an cross-assembler, which generates code for the 6502 processor.
It is 99% compatible with Quick Assembler on 8-bit Atari.
<BR>
<H3>CHANGES</H3>
<H4>Version 2.2</H4>
<UL>
<LI> invalid absolute <TT>CPX</TT> and <TT>CPY</TT> op-codes bug fixed
<LI> branch addressing mode not checking bug fixed
<LI> <TT>ICL</TT> in last line bug fixed
<LI> <TT>OPT H-H+</TT> bug fixed
<LI> first <TT>ORG *</TT> bug fixed
<LI> origin setting not required until not used
<LI> Unix ($0a), Macintosh ($0d) and Atari ($9b) EOLs allowed in source
<LI> value of 'true' changed to 1
<LI> <A HREF="#new_environment">
setting environment variables on error option</A>
<LI> <A HREF="#new_newer">
assembling only if source newer than object option</A>
<LI> <A HREF="#new_opcode">op-code extracting</A>
<LI> <A HREF="#new_linerep">line repeating</A>
<LI> <A HREF="#new_pairing">instructions pairing</A>
<LI> <A HREF="#new_repskip">conditional repeat and skip pseudo commands</A>
<LI> <A HREF="#new_adrmodes">
<TT>(),0+</TT> and <TT>(),0-</TT> pseudo addressing modes</A>
</UL>
<H4>Version 2.0</H4>
<UL>
<LI> truncating name of object bug fixed
<LI> <TT>EQU</TT> and <TT>DTA</TT> forward reference bugs fixed
<LI> hex number recognizing bug fixed
<LI> now <TT>.OBX</TT> is default extension for Atari executables
<LI> assembling options (switches and <TT>OPT</TT> directive)
<LI> listing generation
<LI> label table generation
<LI> conditional assembling
<LI> user errors
<LI> warnings
<LI> improved headers generation
<LI> improved expressions - 19 operators and brackets, 32-bit arithmetic
<LI> improved signed numbers
<LI> 6 new pseudo commands (memory-to-memory move)
<LI> 8 pseudo addressing modes
<LI> indirect conditional jumps
<LI> Atari floating-point numbers generation
<LI> improved <TT>INS</TT>: inserting specified part of file
</UL>
<H4>Version 1.2</H4>
<UL>
<LI> first release
</UL>
<HR></P><A NAME="usage">
<H2><A HREF="#intro">INTRODUCTION</A>
&nbsp;USAGE
&nbsp;<A HREF="#syntax">SYNTAX</A>
&nbsp;<A HREF="#faq">FAQ</A>
&nbsp;<A HREF="index.htm">BACK</A>
</H2>
<H3>System requirements</H3>
<UL>
<LI> a PC compatible computer with 386 or better CPU
<LI> a MS-DOS compatible OS
<LI> a numeric coprocessor for generating sinus tables.
Your CPU probably has a built-in coprocessor.
</UL>
<H3>Creating a source program</H3>
Source file should be plain ASCII file. Although different EOLs are supported,
you would probably prefer CR/LF EOLs because of text editor.<BR>
Single line of source should not be longer than 256 characters.
There is no limitation on the length of the file.<BR>
Source may contain tabulators, which are treated as spaces.<BR>
Assembler is not case-sensitive.
<BR>
<H3>Converting Quick Assembler files</H3>
You must convert Atari text file into PC text file (EOL's from $9b to $0d/$0a),
ATASCII 0-31 and 128-255 characters should be replaced with standard ASCII
characters, using QAsm expressions.<BR>
You also have to change all <TT>OPT</TT> directives,
but usually you needn't them at all.
<BR>
<H3>Assembling a source program</H3>
You run assembler from DOS prompt with following syntax:<BR>
<PRE>XASM source [options]
</PRE><TT>source</TT> is name of source file.
If no extension given, the .ASX is added by default.<P>
Optional options are:
<DL>
<DT><TT>/c</TT>
<DD>Enable listing false conditionals.<BR>
By default lines skipped because of false condition are not listed.<P>
<A NAME="new_environment">
<DT><TT>/e</TT>
<DD>Enable setting environment variables when error occurs.<BR>
With this option, X-Asm sets two environment variables: ERRFILE and ERRLINE.
They may be used in a batch file to locate error and set editor on it.
For example, in my batch file I use such construction:
<PRE>XASM %1 /e
IF NOT ERRORLEVEL 1 GOTO ok
NCE +%ERRLINE% %ERRFILE%
</PRE>
NCE stands for Norton Classic Editor.<P>
If there was no error, variables point at last warning.
If no warning occured, they are removed from the environment.<P>
<DT><TT>/i</TT>
<DD>Disable listing included source.<BR>
Only main source file will be listed.<P>
<DT><TT>/l[:fname]</TT>
<DD>Enable generating listing.
If no <TT>fname</TT> given, listing is written to <TT>source.lst.</TT><P>
<A NAME="new_newer">
<DT><TT>/n</TT>
<DD>Check source and object modification times and assemble only
if source is newer than object file. X-Asm does NOT check included
nor inserted files but only main source, so be careful with this option.<P>
<DT><TT>/o:fname</TT>
<DD>Specify object name. Default is <TT>source.obx</TT>.<P>
<DT><TT>/s</TT>
<DD>Disable converting spaces to tabs in listing.
Using tabs makes listing file shorter.<BR>
Tab stops are assumed to be every 8 characters.<P>
<DT><TT>/t[:fname]</TT>
<DD>List label table.
If no <TT>fname</TT> given, table is written at the end of listing.<P>
</DL>
If source is incorrect, X-Asm stops on first encountered error.<P>
Errorlevels returned by X-Asm:<BR>
3 = bad parameters, assembling not started<BR>
2 = error occured<BR>
1 = warning(s) only<BR>
0 = no errors, no warnings<BR>
<H3>Listing structure</H3>
Line of listing includes:
<UL>
<LI> decimal number of line of source file (if source is different than in
previous listed line, appropriate message line is generated)
<LI> hexadecimal origin
<LI> hexadecimal bytes written to object file<BR>
Listed are also generated headers. A <TT>xxxx-yyyy&gt;</TT> in place of origin
represents generated header: <TT>$xxxx</TT> is the first and <TT>$yyyy</TT>
is the last byte of the block.
A <TT>FFFF&gt;</TT> represents two $ff bytes written as a header prefix.<BR>
A plus sign placed after hex numbers stands for more bytes written to object
in this line, not listed through lack of space.
<LI> remaining part of listing line is a copy of source line
</UL>
<H3>Label table structure</H3>
Line of label table includes:
<UL>
<LI> some label attributes:<BR>
<TT>n</TT> - label defined but not used elsewhere<BR>
<TT>2</TT> - label value known in pass 2 only (label definition uses forward
reference and thus you can't do forward references to that label)
<LI> hexadecimal value of the label
<LI> name of the label
</UL>
<HR></P><A NAME="syntax">
<H2><A HREF="#intro">INTRODUCTION</A>
&nbsp;<A HREF="#usage">USAGE</A>
&nbsp;SYNTAX
&nbsp;<A HREF="#faq">FAQ</A>
&nbsp;<A HREF="index.htm">BACK</A>
</H2>
Lines of source code may be:
<UL>
<LI> empty lines - ignored, of course
<LI> comments - ignored, too
<LI> statements - not ignored :-)
</UL>
Comment lines must have one of the following characters in the FIRST column
of the line: <TT>* ; |</TT>
</P><A NAME="expressions">
<H3>Expressions &nbsp;<A HREF="#statements">Statements</A></H3>
Expressions are numbers combined with operators and brackets.
You should use square brackets, because parentheses are reserved
for 6502 indirect addressing.
<H4>Numbers</H4>
Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff.
A number can be:
<TABLE>
<TR><TD WIDTH=300><UL><LI> a decimal number</TD><TD><TT>-12345</TT></TD></TR>
<TR><TD><UL><LI> a hexadedecimal number</TD><TD><TT>$abcd</TT></TD></TR>
<TR><TD><UL><LI> a binary number</TD><TD><TT>%10100101</TT></TD></TR>
<TR><TD><UL><LI> an ASCII character</TD><TD><TT>'a'</TT> or <TT>"a"</TT></TD></TR>
<TR><TD><UL><LI> an origin counter</TD><TD><TT>*</TT></TD></TR>
<TR><TD><UL><LI> a hardware register</TD><TD><TT>^31</TT></TD></TR>
</UL></TABLE>
<DIV STYLE="MARGIN-LEFT: 54">
An abbreviation of Atari hardware register:<BR>
<TT>^0x</TT> means <TT>$d00x</TT><BR>
<TT>^1x</TT> means <TT>$d01x</TT><BR>
<TT>^2x</TT> means <TT>$d20x</TT><BR>
<TT>^3x</TT> means <TT>$d30x</TT><BR>
<TT>^4x</TT> means <TT>$d40x</TT><BR>
where x is a hexadecimal digit.
</DIV>
<A NAME="new_opcode">
<TABLE>
<TR><TD WIDTH=300><UL><LI> an op-code</TD><TD><TT>{lda #0}</TT></TD></TR>
</UL></TABLE>
<DIV STYLE="MARGIN-LEFT: 54">
Byte op-code of instruction inside braces. Operand is discarded
and is necessary only for identifying addressing mode.
Instruction should begin right after left brace and right brace should
immediately follow the operand or the command in implied addressing mode.
</DIV>
<P>
<H4>Operators</H4>
Currently there are 19 operators:<P>
<TABLE>
<TR><TD><TT>+ </TT></TD><TD>Addition</TD></TR>
<TR><TD><TT>- </TT></TD><TD>Subtraction</TD></TR>
<TR><TD><TT>* </TT></TD><TD>Multiplication</TD></TR>
<TR><TD><TT>/ </TT></TD><TD>Division</TD></TR>
<TR><TD><TT>% </TT></TD><TD>Remainder</TD></TR>
<TR><TD><TT>& </TT></TD><TD>Bitwise and</TD></TR>
<TR><TD><TT>| </TT></TD><TD>Bitwise or</TD></TR>
<TR><TD><TT>^ </TT></TD><TD>Bitwise xor</TD></TR>
<TR><TD><TT>&lt;&lt; </TT></TD><TD>Arithmetic shift left</TD></TR>
<TR><TD><TT>&gt;&gt; </TT></TD><TD>Arithmetic shift right</TD></TR>
<TR><TD><TT>= </TT></TD><TD>Equal</TD></TR>
<TR><TD><TT>&lt;&gt; </TT></TD><TD>Not equal</TD></TR>
<TR><TD><TT>!= </TT></TD><TD>Not equal (same as <TT>&lt;&gt;</TT>)</TD></TR>
<TR><TD><TT>&lt; </TT></TD><TD>Less than</TD></TR>
<TR><TD><TT>&gt; </TT></TD><TD>Greater than</TD></TR>
<TR><TD><TT>&lt;= </TT></TD><TD>Less or equal</TD></TR>
<TR><TD><TT>&gt;= </TT></TD><TD>Greater or equal</TD></TR>
<TR><TD><TT>&& </TT></TD><TD>Logical and</TD></TR>
<TR><TD><TT>|| </TT></TD><TD>Logical or</TD></TR>
</TABLE>
<P>
Operator precedence:
<TABLE>
<TR><TD>first</TD><TD><TT>[]</TT></TD></TR>
<TR><TD> </TD><TD><TT>* / % & &lt;&lt; &gt;&gt;</TT></TD></TR>
<TR><TD> </TD><TD><TT>+ - | ^</TT></TD></TR>
<TR><TD> </TD><TD><TT>= &lt;&gt; != &lt; &gt; &lt;= &gt;=</TT></TD></TR>
<TR><TD> </TD><TD><TT>&&</TT></TD></TR>
<TR><TD>last </TD><TD><TT>||</TT></TD></TR>
</TABLE>
<P>
Compare and logical operators assume that zero is false and non-zero is true.
They return 1 for true.<P>
When calculating expression, 32-bit arithmetic is used. When range of 32 bits
is exceeded, <TT>'Arithmetic overflow'</TT> error is generated.<P>
</P><A NAME="statements">
<H3><A HREF="#expressions">Expressions</A> &nbsp;Statements</H3>
A statement is divided into fields:
<UL>
<LI> <A HREF="#label">label field</A>
<LI> <A HREF="#operation">operation field</A>
<LI> <A HREF="#operand">one or two operand fields</A>
<LI> <A HREF="#comment">comment field</A>
</UL>
There should be at least one space between every two fields
and there can't be any space within a field excluding strings.
</P><A NAME="label"><H4>Label field</H4>
This field is optional. It starts from first character of line, without
any blank characters before. It has two applications:
<UL>
<LI> Defining a label.<BR>
Label is a symbol representing an integer of range -$ffff..$ffff.<BR>
Name of a label can contain letters, digits and underscores (<TT>_</TT>).
Digit can't be label's first character.
Name of a label can be as long as you want and all the characters
are meaningful. In Quick Assembler only 6 leading characters were recognized
and some programs may not compile under X-Asm for this reason.<BR>
Defining a label without using <TT>EQU</TT> makes it equal to current value
of the origin counter.<BR>
Label can't be redefined.<P>
<A NAME="new_linerep">
<LI> Repeating the line.<BR>
Repeating means assembling single line several times as if
there were several identical lines. Note it is not just duplicating
bytes written to object.<BR>
Repeat count, which can be any valid expression, has to be preceded
with a colon.<BR>
Examples:
<PRE>:4 asl @
:2 dta a(*)
</PRE>
In the latter example each <TT>DTA</TT> has different operand value.<BR>
If repeat count equals zero, remaining part of line is not assembled.
This allows conditional assembly on single line to be more compact.
</UL>
You can not define a label in line which you repeat.<P>
<A NAME="new_pairing">
</P><A NAME="operation"><H4>Operation field</H4>
Operation field is the only field which is always required.
You have to put one or more spaces or tab characters between label
and operation field. If no label is defined, line must start with a blank
character. Operation field consists of one or two instructions.
The latter case is called instructions pairing, because a pair
of instructions have shared operand. You separate instructions
with a colon.<BR>
Example:
<PRE> adc:sta $80
</PRE>is equivalent to
<PRE> adc $80
sta $80
</PRE>
Single instruction always consists of 3 letters. It can be:
<OL TYPE=a>
<LI><I> 6502 command</I><BR>
One of 56 well known processor commands.<BR><BR>
<LI><I> compiler directive</I><BR>
One of the following:<P>
<DL>
<DT><TT><B>EQU</B></TT> - assign a value of expression to the label
<DD>Note that label represents a number, not a text macro.<BR>
Examples:
<PRE>five equ 5
here equ *
</PRE>
<DT><TT><B>OPT</B></TT> - set assembling options
<DD>Currently there are two options: listing generating and headers generating.
You can turn any of these on or off.<BR>
Default (if no <TT>OPT</TT> specified) is <TT>opt l+h+</TT>.<BR>
Examples:
<PRE> opt l- listing off
opt h- headers off
opt l+h- listing on, headers off
</PRE>
<DT><TT><B>ORG</B></TT> - set new origin counter
<DD>You can set some options applied to new header (if headers are on):
<UL>
<LI><TT>a:</TT> tells X-Asm to always make a header, even it is unnecessary,
like in <TT>ORG *</TT>.
<LI><TT>f:</TT> works same as <TT>a:</TT>, but additionally tells to generate
a $ff,$ff prefix before header. X-Asm adds it to the first header in file
by default, so use this option only if you want the $ff's somewhere inside.<BR>
</UL>
Examples:
<PRE> org $600
org f:$700
table org *+100
</PRE>
In the latter example <TT>table</TT> points to 100 bytes
of uninitialized data (note label is assigned to <TT>*</TT>
before <TT>ORG</TT> directive is executed).<P>
<DT><TT><B>DTA</B></TT> - define data
<DD>There are various data types:
<UL>
<LI> numbers
<UL>
<LI> bytes: <TT>b(200)</TT>
<LI> words: <TT>a(10000)</TT>
<LI> low bytes of words: <TT>l(511)</TT> defines byte 255
<LI> high bytes of words: <TT>h(511)</TT> defines byte 1<BR>
You may enter many expressions in parentheses and combine different types
of data in single line, separating things with commas.<BR>
You may also define a sinus table. Syntax is:<BR>
<TT>sin(centre,amp,size,first,last)</TT><BR>
where:
<UL>
<LI> <TT>centre</TT> is a number which is added to every sinus value
<LI> <TT>amp</TT> is the amplitude of sinus
<LI> <TT>size</TT> is the period of sinus
<LI> <TT>first,last</TT> define range of values in the table.
They are optional. Default are <TT>0,size-1</TT>.
</UL>
Example: <TT>dta a(sin(0,1000,256,0,63))</TT> defines table of 64 words
representing a quarter of sinus with amplitude of 1000.<P>
<LI> real numbers: <TT>r(-1.23456e12)</TT><BR>
Real numbers are written in 6-byte Atari Floating-Point format. You can't
combine reals with operators, as you can integers.<P>
</UL>
<LI> text strings
<UL>
<LI> ASCII strings: <TT>c'Text'</TT> or <TT>c"Text"</TT>
<LI> ANTIC strings: <TT>d'Text'</TT> or <TT>d"Text"</TT>
</UL>
A character string consists of any of characters surrounded by quotation
marks. Within a string, a single quotation mark character is
represented by two succesive quotation marks.<BR>
Placing a <TT>*</TT> character after a string inverts
high bit in every byte of string.<P>
</UL>
Examples of <TT>DTA</TT>:
<PRE>
dta b(2,5),a(1000,-1),l(12345,sin(0,127,256))
dta d"ANTIC"*,c'It''s a string',b(155)
</PRE>
<DT><TT><B>ICL</B></TT> - include another source file
<DD>Specifies another file to be included in the assembly as if the contests of
the referenced file appeared in place of the <TT>ICL</TT> statement.
The included file may contain other <TT>ICL</TT> statements.
The <TT>.ASX</TT> extension is added if none given.<P>
Examples:
<PRE>
icl 'macros.asx'
icl 'c:\atari\xasm\fileio'
</PRE>
<DT><TT><B>END</B></TT> - end assembling file
<DD>Remaining part of the file is not assembled. If this statement does
not occur, assembler stops assembling when encounters end of file.<BR>
Example:
<PRE>
end
</PRE>
<DT><TT><B>INS</B></TT> - insert contents of file
<DD>Copies every byte of specified file into object file and moves origin
counter, as if these bytes were defined with <TT>DTA</TT>.<BR>
You may specify range of inserted file. Syntax is:
<PRE>
ins 'file'[,offset[,length]]
</PRE>
First byte in file has offset 0.<BR>
If offset is negative, it is counted from the end of file.<BR>
Examples:
<PRE>
ins 'picture.raw'
ins 'file',-256 insert last 256 bytes of file
ins 'file',10,10 insert bytes 10..19 of file
</PRE>
<DT><TT><B>RUN</B></TT> - generate run address
<DD>The Atari executable program should have run address specified.
A program may be loaded in many areas of memory and started from any address.
<PRE> run addr
</PRE>
is equivalent to:
<PRE> org $2e0
dta a(addr)
</PRE>
Examples:
<PRE> run start
run program
</PRE>
<DT><TT><B>INI</B></TT> - generate init address
<DD>The Atari executable program may have some routines which are executed
during loading process. There may be many init blocks in one file.<BR>
Examples:
<PRE> ini init
ini showpic
</PRE>
<DT><TT><B>ERT</B></TT> - generate error if expression is true
<DD>Examples:
<PRE> ert *&gt;$c000
ert len1&gt;$ff||len2&gt;$ff
</PRE>
<DT><TT><B>IFT</B></TT> - assemble if expression is true<BR>
<TT><B>ELS</B></TT> - else<BR>
<TT><B>EIF</B></TT> - end if<BR>
<DD>With these directives you can construct fragments which
are assembled when a condition is met.
Conditional constructions can be nested.<BR>
Example:
<PRE>noscr equ 1
ift noscr
lda #0
els
lda #$22
eif
sta $22f
</PRE>
Above example can be rewritten using line repeating feature:
<PRE>noscr equ 1
:noscr<>0 lda #0
:noscr=0 lda #$22
sta $22f
</PRE>
</DL>
<LI><I> pseudo-command</I><BR>
It is something like built-in macro.
Note that it is not an illegal instruction and works on typical 6502.<P>
<DL>
<DT><TT><B>ADD</B></TT> - addition without carry
<DD>If you ever programmed 6502, you must have noticed that you had
to use a <TT>CLC</TT> before <TT>ADC</TT> for every simple addition.<BR>
X-Asm can do it for you. <TT>ADD</TT> replaces two instructions:
<TT>CLC</TT> and <TT>ADC</TT>.<P>
<DT><TT><B>SUB</B></TT> - subtraction
<DD>It is <TT>SEC</TT> and <TT>SBC</TT>.<P>
<A NAME="new_repskip">
<DT><TT><B>RCC, RCS, REQ, RMI, RNE, RPL, RVC, RVS</B></TT> - conditional repeat
<DD>They are branches to the previous instruction.
They take no operand, because the branch target
is the address of previously assembled instruction.<BR>
Example:
<PRE> ldx #0
mva:rne $500,x $600,x+
</PRE>
The example code copies memory $500-$5ff to $600-$6ff.
With standard 6502 commands only it would be:
<PRE> ldx #0
loop lda $500,x
sta $600,x
inx
bne loop
</PRE>
<DT><TT><B>SCC, SCS, SEQ, SMI, SNE, SPL, SVC, SVS</B></TT> - conditional skip
<DD>They are branches over the next instructions. No operand is required,
because the target is the address of instruction following
the next instruction.<BR>
Example:
<PRE> lda #40
add:sta $80
scc:inc $81
</PRE>
In the above example word variable $80 is incremented by 40.<BR>
Nor conditional repeat nor skip pseudo-commands require operand,
thus they can be paired with any other command.<P>
<DT><TT><B>JCC, JCS, JEQ, JMI, JNE, JPL, JVC, JVS</B></TT> - conditional jumps
<DD>They are a kind of 'long' branches. While standard branches
(<TT>BNE, BEQ</TT>) have range of -128..+127, these jumps have range
of all 64 kB.<BR>
Example:
<PRE> jne dest
</PRE>is equivalent to:
<PRE> seq:jmp dest
</PRE>
<DT><TT><B>INW</B></TT> - increment word
<DD>It is a 16-bit memory increment command.<BR>
Example:
<PRE> inw dest
</PRE>is equivalent to:
<PRE> inc dest
sne:inc dest+1
</PRE>
<DT><TT><B>MVA, MVX, MVY</B></TT> - move byte using accumulator, X or Y
<DD>Any of these pseudo-commands requires two operands
and substitutes two commands:
<PRE> mva source dest = lda source : sta dest
mvx source dest = ldx source : stx dest
mvy source dest = ldy source : sty dest
</PRE>
<DT><TT><B>MWA, MWX, MWY</B></TT> - move word using accumulator, X or Y
<DD>They also require two operands
and are combinations of two <TT>MV*</TT>'s:
one to move low byte, and the other to move high byte.<BR>
You can't use indirect nor pseudo addressing modes with <TT>MW*</TT>.
Destination must be absolute address (indexed or not).<BR>
When source is also absolute, a <TT>MW* SOURCE DEST</TT> will be:
<PRE> mv* source dest
mv* source+1 dest+1
</PRE>
When source is immediate, a <TT>MW* #IMMED DEST</TT> will be:
<PRE> mv* &lt;immed dest
mv* &gt;immed dest+1
</PRE>
When <TT>&lt;immed</TT> equals <TT>&gt;immed</TT> and <TT>immed</TT>
is not forward-referenced, X-Asm uses optimization:
<PRE> mv* &lt;immed dest
st* dest+1
</PRE>
</DL>
</OL>
</P><A NAME="operand"><H4>Operand</H4>
It depends on the operation field. Some statements don't need any operand,
other need two operands.<P>
6502 commands require operand depending on the addressing mode.
Addressing modes should be entered in standard convention except
the accumulator addressing mode, which should be marked with a
<TT>@</TT> character (as in Quick Assembler).<P>
There are two extra immediate addressing modes:
<TT>&lt;</TT> and <TT>&gt;</TT>,
which use low/high byte of word rather than byte value.<P>
In absolute addressing modes, X-Asm examines expression and uses zero-page
addressing mode if it thinks it is possible to do it. You may override it
with <TT>a:</TT> and <TT>z:</TT> prefixes.<P>
Examples:
<PRE>
nop
asl @
lda &gt;$1234 assembles to lda #$12
lda $100,x
lda a:0 generates 16-bit address
jmp ($0a)
lda ($80),y
</PRE>
There are also pseudo addressing modes, which are similar to
pseudo-commands. You may use them as standard addressing modes
in all 6502 commands and pseudo-commands excluding
<TT>MWA</TT>, <TT>MWX</TT> and <TT>MWY</TT> only:
<PRE> cmd a,x+ = cmd a,x : inx
cmd a,x- = cmd a,x : dex
cmd a,y+ = cmd a,y : iny
cmd a,y- = cmd a,y : dey
cmd (z),y+ = cmd (z),y : iny
cmd (z),y- = cmd (z),y : dey
cmd (z,0) = ldx #0 : cmd (z,x)
cmd (z),0 = ldy #0 : cmd (z),y
<A NAME="new_adrmodes"> cmd (z),0+ = ldy #0 : cmd (z),y : iny
cmd (z),0- = ldy #0 : cmd (z),y : dey
</PRE>
</P><A NAME="comment"><H4>Comment</H4>
Comment in a statement does not start from any special character
like <TT>;</TT> for example. Comment field is implied when appropriate
number of operands was taken.<P>
<HR></P><A NAME="faq">
<H2><A HREF="#intro">INTRODUCTION</A>
&nbsp;<A HREF="#usage">USAGE</A>
&nbsp;<A HREF="#syntax">SYNTAX</A>
&nbsp;FAQ
&nbsp;<A HREF="index.htm">BACK</A>
</H2>
<UL>
<LI><B>Q:</B> Why does X-Asm ignore <TT>+2</TT> in following line?
<PRE>label equ 1 +2
</PRE>
<B>A:</B> X-Asm treats space as operand terminator. Remaining part of line
is a comment. You should write <TT>1+2</TT> without any spaces.<P>
<LI><B>Q:</B> Why does <TT>lda #&lt;table</TT> not work?<P>
<B>A:</B> <TT>&lt;</TT> and <TT>&gt;</TT> represent addressing modes
rather than LOW and HIGH operators.<BR>
You specify <TT>lda &lt;table</TT>, not <TT>lda #&lt;table</TT>
like in most 6502 assemblers.<P>
<LI><B>Q:</B> What's wrong with <TT>asl a</TT> ?<P>
<B>A:</B> You should use <TT>@</TT> for accumulator addressing mode.<P>
<LI><B>Q:</B> What's wrong in following line?
<PRE>label: lda #0
</PRE>
<B>A:</B> Label definition can not include a colon.<P>
<LI><B>Q:</B> I wrote <TT>end start</TT>, where <TT>start</TT> points
to program beginning, but program seems not to start there. Why?<P>
<B>A:</B> You should have explicit run address specified.
Use <TT>run start</TT> directive. <TT>end</TT> takes no operand.<P>
<LI><B>Q:</B> Why this construction does not work:
<PRE>three equ one+two
two equ one+one
one equ 1
</PRE>
while this does:
<PRE>
two equ one+one
one equ 1
</PRE>
<B>A:</B> X-Asm reads source twice (in pass 1 and pass 2)
from the beginning until the end.<BR>
This allows forward references, but not too complex.<BR>
Keep in mind that assembler should know all the values in second pass.<P>
Example:
<PRE>two equ one+one This value is known in 2nd pass only
one equ 1 This value is known as early as in 1st pass
</PRE>
These values can be fixed in two passes.<BR>
If you insert following statement as first line:
<PRE>three equ one+two
</PRE>
X-Asm will generate an error because it can't fix
the value of <TT>three</TT> in second pass.<P>
<LI><B>Q:</B> X-Asm displayed single error while assembling my program.
When I fixed it, another error appeared. Why?<P>
<B>A:</B> X-Asm displays only first error.<BR>
When you were assembling for the first time, both errors might exist,
but X-Asm stopped assembling on the first one.<P>
<LI> If you have other questions/problems,
<A HREF=mailto:pfusik@elka.pw.edu.pl>write to me</A>.
</UL>
</BODY>
</HTML>

68
doc/xboot.htm Normal file
View File

@ -0,0 +1,68 @@
<HTML>
<HEAD>
<TITLE>X-BOOT 4.0 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>X-BOOT version 4.0</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
</CENTER>
<H2>INTRODUCTION</H2>
This tool converts Atari executable file (.OBX) into Atari disk image (.ATR),
which can be used in emulator. For loading executable into real Atari
you need no .ATR, try using <A HREF="xload.htm">X-LOAD</A>.
<H3>CHANGES</H3>
<H4>Version 4.0</H4>
<UL>
<LI> wildcards support - now you can convert a set of files
<LI> .ATR name not required - name can be taken from executable
<LI> no length limit - files longer than 60k allowed
<LI> truncated executables handling
<LI> checking for memory conflicts
<LI> better errors handling
</UL>
<H4>Version 3.2</H4>
<UL>
<LI> .OBX is default extension of Atari executable
</UL>
<H4>Version 3.1</H4>
<UL>
<LI> first release
</UL>
<HR>
<H2>USAGE</H2>
There are two ways of running X-BOOT:
<UL>
<LI><TT>XBOOT [/p] obxfile [atrfile]</TT>
<LI><TT>XBOOT [/p] obxfiles [atrpath]</TT>
</UL>
The former converts single file, the latter a set of files.<P>
Parameters in brackets are optional.<P>
<TT>/p</TT> switch forces writing 'professional loader', which allows you to load
code/data under ROM and disables ROM and interrupts while starting program.
By default, standard loader is used, which can load any Atari executable
not demanding DOS or any special loader.<P>
Both loaders disable Atari Basic, so you needn't hold OPTION key while
booting.<P>
<HR>
<H2>DETAILS</H2>
Produced ATR is single density and as short as possible.
Loader occupies one boot sector.<P>
X-BOOT does not write executable in ATR as Atari file.
You can't read it from DOS or extract it somehow or other.
You can only run it by booting.<P>
For more details, view sources of loaders:
<UL>
<LI>Standard: <A HREF="xbootstd.asx">XBOOTSTD.ASX</A>
<LI>Professional: <A HREF="xbootpro.asx">XBOOTPRO.ASX</A>
</UL>
Loaders are so simple that they even do not detect end of file. Instead,
they are modified when end of file is reached: disk image contains one
additional block, which doesn't belong to executable file, but changes
loader to run program instead of initializing.
</BODY>
</HTML>

64
doc/xbootpro.asx Normal file
View File

@ -0,0 +1,64 @@
* Boot executable file loader coded by Fox/Taquart
* Reads file from ATR prepared with X-BOOT.
* Professional version - can load file under ROM.
* Interrupts and ROM are disabled when running loaded program.
opt h-
org $480
bufr equ $400 128-byte buffer
tp equ $43 Temporary byte
vc equ $44 Start and end vectors (4 bytes)
* Boot code
boot dta b(0,1),a(boot,$e477) Boot header
mva #0 $22f Make screen blank...
mva #$52 $2c8 ... and pink ;)
lda 20 Wait for VBLK
cmp:req 20
mwa #rts $2e0 Set default run vector
dta b({lda a:0}) Skip two bytes
secrts sec Return with error
rts rts
mva:pha >rts $2e3 Set init address...
mva:pha <rts $2e2 ... and put return address on stack
ldx #-5 Load header
hput sta vc+4,x+ Store byte of header
stx tp
next inc bufx Increment buffer index
bpl getx Branch if within buffer
inw $30a Increment sector number
mva #$ff ^31 Turn ROM on
lsr ^4e Enable NMI interrupts
cli Enable IRQ interrupts
jsr $e453 Read sector
bmi secrts Exit on error
sei Disable IRQ interrupts
inc ^4e Disable NMI interrupts
dec ^31 Turn ROM off
asl bufx Change $80 to $00
getx lda bufr+$7f Get byte from buffer
bufx equ *-2 Buffer index
ldx tp Check if header or block data
bne hput Branch to store header
sta (vc,x) Store block data
inw vc Increment vector
lda vc+2 Check if end of block reached
cmp vc
lda vc+3
sbc vc+1
bcs next No: read next byte
mva #3 ^2f Yes: Reset POKEY...
init jmp ($2e2) ... and call init routine
dta c'4.0p' Unused boot sector space
ert *<>boot+$80 Exactly 128 bytes should be used
* X-BOOT adds this block at the end of loaded file
* It changes jmp ($2e2) to jmp ($2e0)
opt h+
org init+1
dta l($2e0)
end

63
doc/xbootstd.asx Normal file
View File

@ -0,0 +1,63 @@
* Boot executable file loader coded by Fox/Taquart
* Reads file from ATR prepared with X-BOOT.
* Standard loader - ROM and interrupts enabled.
opt h-
org $780
bufr equ $700 128-byte buffer
tp equ $43 Temporary byte
vc equ $44 Start and end vectors (4 bytes)
* Boot code
boot dta b(0,1),a(boot,$e477) Boot header
txtpos equ 215
ldy #txtpos Print text
print mva text-txtpos,y ($58),y+
cpy #txtpos+txtlen
bcc print
mwa #rts $2e0 Set default run vector
mva >bufr $305 Set buffer address
mva #$ff ^31 Turn BASIC off
dta b({lda a:0}) Skip two bytes
secrts sec Return with error
rts rts
mva:pha >rts $2e3 Set init address...
mva:pha <rts $2e2 ... and put return address on stack
ldx #-5 Load header
hput sta vc+4,x+ Store byte of header
stx tp
next inc bufx Increment buffer index
bpl getx Branch if within buffer
inw $30a Increment sector number
jsr $e453 Read sector
bmi secrts Exit on error
asl bufx Change $80 to $00
getx lda bufr+$7f Get byte from buffer
bufx equ *-2 Buffer index
ldx tp Check if header or block data
bne hput Branch to store header
sta (vc,x) Store block data
inw vc Increment vector
lda vc+2 Check if end of block reached
cmp vc
lda vc+3
sbc vc+1
bcs next No: read next byte
mva #3 ^2f Yes: Reset POKEY...
init jmp ($2e2) ... and call init routine
text dta d'Loading... '
txtlen equ *-text
dta c'4.0' Unused boot sector space
ert *<>boot+$80 Exactly 128 bytes should be used
* X-BOOT adds this block at the end of loaded file
* It changes jmp ($2e2) to jmp ($2e0)
opt h+
org init+1
dta l($2e0)
end

42
doc/xhead.htm Normal file
View File

@ -0,0 +1,42 @@
<HTML>
<HEAD>
<TITLE>X-HEAD 1.1 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>X-HEAD version 1.1</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
</CENTER>
<H2>INTRODUCTION</H2>
This tool prints headers of Atari executable.
You can examine which memory locations file loads into.
X-HEAD also shows init and run addresses.
<H3>CHANGES</H3>
<H4>Version 1.1</H4>
<UL>
<LI> .OBX is default extension of Atari executable
</UL>
<H4>Version 1.0</H4>
<UL>
<LI> first release
</UL>
<HR>
<H2>USAGE</H2>
Simply run X-HEAD with executable filename. No options are supported yet.<P>
X-HEAD will read the file and display its headers in following format:
<PRE> bbbb-eeee xxxx</PRE>
where <TT>bbbb</TT> is the begin, <TT>eeee</TT> - the end of the block,
and <TT>xxxx</TT> is the execution address (init or run vector).<P>
The summary includes:<BR>
<TT>xxxx bytes</TT> - length of file, including headers<BR>
<TT>xxxx blocks</TT> - number of headers<BR>
<TT>xxxx inits</TT> - number of init blocks (<TT>02e2-02e3</TT>)<BR>
<TT>xxxx modules</TT> - number of <TT>FFFF</TT> headers (one at the beginning is required)<P>
All displayed numbers are hexadecimal, of course.<P>
You can redirect output to a file, for example:
<PRE>XHEAD TEST &gt;TEST.HDR
</BODY>
</HTML>

81
doc/xload.htm Normal file
View File

@ -0,0 +1,81 @@
<HTML>
<HEAD>
<TITLE>X-LOAD 1.0 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502proc.gif">
<CENTER>
<H1>X-LOAD version 1.0</H1>
by <A HREF="mailto:pfusik@elka.pw.edu.pl">Fox/Taquart</A><P>
<HR>
</CENTER>
<H2>INTRODUCTION</H2>
This tool can be used for loading executable files from PC into real
Atari computer via SIO2PC interface. Only input and output lines are
used, so that X-LOAD should work with all types of interface.<P>
However, it is experimental version. I'm not sure if it will work
with every hardware. I've noticed it is not stable and sometimes
transmission can hang or distortions in loaded data may appear.
The reason is that there is no error-checking, while transmission is
fast (57.6 kbits/sec).<P>
<H3>CHANGES</H3>
<H4>Version 1.0</H4>
<UL>
<LI> first release
</UL>
<HR>
<H2>USAGE</H2>
You run X-LOAD from DOS prompt with executable filename and optional
options:<P>
<DL>
<DT><TT>/1</TT> - <TT>/4</TT>
<DD>Specify COM port number, which interface is attached to.
Default is COM2.<P>
<DT><TT>/p</TT>
<DD>Force using 'professional loader', which allows you to load
code/data under ROM and disables ROM and interrupts while starting program.
By default, standard loader is used, which can load any Atari executable
not demanding DOS or any special loader.<P>
</DL>
After you run X-LOAD, you only have to boot your Atari and the program
will be loaded and run.<P>
While loading, you can watch on your PC memory locations, which program
loads to.<P>
After program was loaded and run, X-LOAD terminates. You may exit it
earlier at any time by pressing ESC key.<P>
<HR>
<H2>DETAILS</H2>
First X-LOAD sends a byte to Atari and then waits until Atari is booted.
That byte can be used to detect from Atari, that PC is ready for transmission.
When you are testing your program, you may code periodic checking
if a byte was received, and performing cold reset in that case.
So that you needn't touch your Atari to run program on it.<P>
While booting, X-LOAD accepts two commands for disk drive 1:<P>
<UL>
<LI> <TT>'S'</TT> - read status. Used for checking presence of disk drive.
<LI> <TT>'R'</TT> - read sector (only first). Used for reading boot program.
</UL>
After Atari receives and runs its loader, the transmission runs at 57600
bits/sec. You can not hear any transmission sound, because the frequency
is too high for a human.<P>
Transmission protocol is very simple: Atari sends a byte to inform that
it is ready for receiving data. Then PC sends a 3-byte header and a block
of data. First two bytes of header are high and low byte of address
of last block byte minus $ff. Third byte equals low byte of
($100-block_length). Then come block data, which are loaded directly
into their memory location.
For more details, view sources of loaders:
<UL>
<LI>Standard: <A HREF="xloadstd.asx">XLOADSTD.ASX</A>
<LI>Professional: <A HREF="xloadpro.asx">XLOADPRO.ASX</A>
</UL>
You may have noticed that X-LOAD is somehow similar to X-BOOT, which also
has two loaders. The main difference is that X-BOOT loaders use system
routines to get sectors at regular speed of 19200 bits/sec.
They use sector buffer and require some low memory locations not to be changed
because of operating system. In this respect X-LOAD loaders are better, because
allow loading into whole memory except for loader code.
</BODY>
</HTML>

60
doc/xloadpro.asx Normal file
View File

@ -0,0 +1,60 @@
* Boot executable file loader coded by Fox/Taquart
* Receives file from X-LOAD via SIO2PC interface.
* Professional version - can load file under ROM.
* Interrupts and ROM are disabled when running loaded program.
opt h-
org $400
* Boot code
boot dta b(0,1),a(boot) Boot header
arts dta a(rts)
dta b({lda #$60}) Skip rts
rts rts
sei Disable interrupts
inc ^4e
inc ^40 Make screen blank
mva #$08 ^24 Set transmission speed
mva #$00 ^26
mva #$28 ^28
sta ^29 Reset counters
mva #$23 ^2f Send enable
sta ^2d Send a byte
wait sta ^4a Wait until sent
asl @
bcc wait
mva #$13 ^2f Receive enable
ldy #2
head jsr get Receive address (high/low byte)
sta stor,y
mva arts-1,y $2e2-1,y Set init address
pha Put return address on stack
dey
bne head
jsr get Receive length (one byte)
tax
load jsr get Receive data
stor sta a:0,x+ Store in memory
bne load
mva $10 ^2e Reset POKEY
mva #3 ^2f
init jmp ($2e2) Call init routine
get lda #$20 Function: Receive one byte
sta ^2e Enable receive interrupt
bit:rne ^2e Wait for interrupt request
sty ^2e Disable receive interrupt
lda ^2d Get byte
rts
:boot+$80-* dta b(0) Padd with zeros to full sector
* X-LOAD adds this block at the end of loaded file
* It changes jmp ($2e2) to jmp ($2e0)
opt h+
org init+1
dta l($2e0)
end

60
doc/xloadstd.asx Normal file
View File

@ -0,0 +1,60 @@
* Boot executable file loader coded by Fox/Taquart
* Receives file from X-LOAD via SIO2PC interface.
* Standard loader - ROM and interrupts enabled while running loaded program.
opt h-
org $700
* Boot code
boot dta b(0,1),a(boot) Boot header
arts dta a(rts)
dta b({lda #$60}) Skip rts
rts rts
sei Disable interrupts
inc ^4e
mva #$08 ^24 Set transmission speed
mva #$00 ^26
mva #$28 ^28
sta ^29 Reset counters
mva #$23 ^2f Send enable
sta ^2d Send a byte
wait sta ^4a Wait until sent
asl @
bcc wait
mva #$13 ^2f Receive enable
ldy #2
head jsr get Receive address (high/low byte)
sta stor,y
mva arts-1,y $2e2-1,y Set init address
pha Put return address on stack
dey
bne head
jsr get Receive length (one byte)
tax
load jsr get Receive data
stor sta a:0,x+ Store in memory
bne load
mva $10 ^2e Reset POKEY
mva #3 ^2f
lsr ^4e Enable interrupts
cli
init jmp ($2e2) Call init routine
get lda #$20 Function: Receive one byte
sta ^2e Enable receive interrupt
bit:rne ^2e Wait for interrupt request
sty ^2e Disable receive interrupt
lda ^2d Get byte
rts
:boot+$80-* dta b(0) Padd with zeros to full sector
* X-LOAD adds this block at the end of loaded file
* It changes jmp ($2e2) to jmp ($2e0)
opt h+
org init+1
dta l($2e0)
end

View File

@ -1,7 +0,0 @@
\/
/\ - Assembler 2.0
--------------------------
by Fox/Taquart
--------------------------
8-bit Atari 6502 assembler
for PC 386+ / MS-DOS

View File

@ -1,107 +0,0 @@
*** GTIA
HPOSP0 equ ^00 (w) Horizontal POSition of Player 0
KOLM0PF equ ^00 (r) KOLlision Missile 0 to Play Field
HPOSP1 equ ^01 (w) Horizontal POSition of Player 1
KOLM1PF equ ^01 (r) KOLlision Missile 1 to Play Field
HPOSP2 equ ^02 (w) Horizontal POSition of Player 2
KOLM2PF equ ^02 (r) KOLlision Missile 2 to Play Field
HPOSP3 equ ^03 (w) Horizontal POSition of Player 3
KOLM3PF equ ^03 (r) KOLlision Missile 3 to Play Field
HPOSM0 equ ^04 (w) Horizontal POSition of Missile 0
KOLP0PF equ ^04 (r) KOLlision Player 0 to Play Field
HPOSM1 equ ^05 (w) Horizontal POSition of Missile 1
KOLP1PF equ ^05 (r) KOLlision Player 1 to Play Field
HPOSM2 equ ^06 (w) Horizontal POSition of Missile 2
KOLP2PF equ ^06 (r) KOLlision Player 2 to Play Field
HPOSM3 equ ^07 (w) Horizontal POSition of Missile 3
KOLP3PF equ ^07 (r) KOLlision Player 3 to Play Field
SIZEP0 equ ^08 (w) SIZE of Player 0
KOLM0P equ ^08 (r) KOLlision Missile 0 to Players
SIZEP1 equ ^09 (w) SIZE of Player 1
KOLM1P equ ^09 (r) KOLlision Missile 1 to Players
SIZEP2 equ ^0a (w) SIZE of Player 2
KOLM2P equ ^0a (r) KOLlision Missile 2 to Players
SIZEP3 equ ^0b (w) SIZE of Player 3
KOLM3P equ ^0b (r) KOLlision Missile 3 to Players
SIZEM equ ^0c (w) SIZE of Missiles
KOLP0P equ ^0c (r) KOLlision Player 0 to Players
GRAFP0 equ ^0d (w) GRAphic oF Player 0
KOLP1P equ ^0d (r) KOLlision Player 1 to Players
GRAFP1 equ ^0e (w) GRAphic oF Player 1
KOLP2P equ ^0e (r) KOLlision Player 2 to Players
GRAFP2 equ ^0f (w) GRAphic oF Player 2
KOLP3P equ ^0f (r) KOLlision Player 3 to Players
GRAFP3 equ ^10 (w) GRAphic oF Player 3
TRIG0 equ ^10 (r) TRIGger 0
GRAFM equ ^11 (w) GRAphic oF Missiles
TRIG1 equ ^11 (r) TRIGger 1
COLPM0 equ ^12 (w) COLor of Player/Missile 0
COLPM1 equ ^13 (w) COLor of Player/Missile 1
TRIG3 equ ^13 (r) TRIGger 3
COLPM2 equ ^14 (w) COLor of Player/Missile 2
PAL equ ^14 (r) PAL flag
COLPM3 equ ^15 (w) COLor of Player/Missile 3
COLPF0 equ ^16 (w) COLor of Play Field 0
COLPF1 equ ^17 (w) COLor of Play Field 1
COLPF2 equ ^18 (w) COLor of Play Field 2
COLPF3 equ ^19 (w) COLor of Play Field 3
COLBAK equ ^1a (w) COLor of BAcKground
GTIACTL equ ^1b (w) GTIA ConTroL
VDELAY equ ^1c (w) Vertical DELAY
PMCNTL equ ^1d (w) Player/Missile CoNTroL
HITCLR equ ^1e (w) HIT CLeaR
CONSOL equ ^1f (r/w) CONSOL
*** POKEY
AUDF1 equ ^20 (w) AUDio Frequency 1
POT0 equ ^20 (r) POTentiometr 0
AUDC1 equ ^21 (w) AUDio Control 1
POT1 equ ^21 (r) POTentiometr 1
AUDF2 equ ^22 (w) AUDio Frequency 2
POT2 equ ^22 (r) POTentiometr 2
AUDC2 equ ^23 (w) AUDio Control 2
POT3 equ ^23 (r) POTentiometr 3
AUDF3 equ ^24 (w) AUDio Frequency 3
AUDC3 equ ^25 (w) AUDio Control 3
AUDF4 equ ^26 (w) AUDio Frequency 4
AUDC4 equ ^27 (w) AUDio Control 4
AUDCTL equ ^28 (w) AUDio ConTroL
POTST equ ^28 (r) POTentiomers STatus
KBCODE equ ^29 (r) KeyBoard CODE
SKTRES equ ^2a (w) Serial and Keyboard RESet
RANDOM equ ^2a (r) RANDOM
POTGO equ ^2b (w) POTentiometr GOes
SEROUT equ ^2d (w) SERial OUT
SERIN equ ^2d (r) SERial IN
IRQEN equ ^2e (w) Interrupt ReQuest ENable
IRQST equ ^2e (r) Interrupt ReQuest STatus
SKCTL equ ^2f (w) Serial and Keyboard ConTroL
SKSTAT equ ^2f (r) Serial and Keyboard STATus
*** PIA
PORTA equ ^30 (r/w) PORT A
PORTB equ ^31 (r/w) PORT B
PACTL equ ^32 (r/w) Port A ConTroL
PBCTL equ ^33 (r/w) Port B ConTroL
*** ANTIC
DMACTL equ ^40 (w) Direct Memory Access ConTroL
CHRCTL equ ^41 (w) CHaRacters ConTroL
DLPTR equ ^42 (w) Display List PoinTeR
HSCROL equ ^44 (w) Horizontal SCROLl
VSCROL equ ^45 (w) Vertical SCROLl
PMBASE equ ^47 (w) Player/Missile BASE
CHBASE equ ^49 (w) CHaracter BASE
WSYNC equ ^4a (w) Wait for SYNChronisation
VCOUNT equ ^4b (r) Vertical COUNT
LPENH equ ^4c (r) Light PEN Horizontal
LPENV equ ^4d (r) Light PEN Vertical
NMIEN equ ^4e (w) Non-Maskable Interrupt ENable
NMIST equ ^4f (r) Non-Maskable Interrupt STatus
*** CPU
NMIVEC equ $fffa Non-Maskable Interrupt VECtor
RESETVC equ $fffc RESET VeCtor
IRQVEC equ $fffe Interrupt ReQuest VECtor
end

View File

@ -1,99 +0,0 @@
X-ASM 2.0 QUICK REFERENCE
=========================
6502 commands
-------------
ADC - add with carry
AND - and
ASL - arithmetic shift left
BCC - branch if carry clear
BCS - branch if carry set
BEQ - branch if equal
BIT - test bits
BMI - branch if minus
BNE - branch if not equal
BPL - branch if plus
BRK - break
BVC - branch if overflow clear
BVS - branch if overflow set
CLC - clear carry
CLD - clear decimal
CLI - clear interrupts
CLV - clear overflow
CMP - compare
CPX - compare with X
CPY - compare with Y
DEC - decrement
DEX - decrement X
DEY - decrement Y
EOR - exclusive or
INC - increment
INX - increment X
INY - increment Y
JMP - jump
JSR - jump to subroutine
LDA - load accumulator
LDX - load X
LDY - load Y
LSR - logical shift right
NOP - no operation
ORA - or accumulator
PHA - push accumulator
PHP - push flags
PLA - pull accumulator
PLP - pull flags
ROL - rotate left
ROR - rotate right
RTI - return from interrupt
RTS - return from subroutine
SBC - subtract with carry
SEC - set carry
SED - set decimal
SEI - set interrupts
STA - store accumulator
STX - store X
STY - store Y
TAX - transfer accumulator to X
TAY - transfer accumulator to Y
TSX - transfer stack pointer to X
TXA - transfer X to accumulator
TXS - transfer X to stack pointer
TYA - transfer Y to accumulator
X-Asm 2.0 pseudo-commands
-------------------------
ADD - add
INW - increment word
JCC - jump if carry clear
JCS - jump if carry set
JEQ - jump if equal
JMI - jump if minus
JNE - jump if not equal
JPL - jump if plus
JVC - jump if overflow clear
JVS - jump if overflow set
MVA - move byte using accumulator
MVX - move byte using X
MVY - move byte using Y
MWA - move word using accumulator
MWX - move word using X
MWY - move word using Y
SUB - subtract
X-Asm 2.0 directives
--------------------
DTA - define data
EIF - end if
ELS - else
END - end
EQU - equal
ERT - error if true
ICL - include
IFT - if true
INI - init
INS - insert
OPT - options
ORG - origin
RUN - run
===

View File

@ -1,75 +0,0 @@
||| X-Assembler version 2.0 for MS-DOS |||
||| A powerful ATARI XL/XE software development tool on PC |||
/ | \ designed and coded by Fox/Taquart / | \
ÜÜÜÜÜÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÜÜÜÜ
ÜÜÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
ÜÜÜÛÛÛÛÛÛÛÛÛÛßßßßßß ßßßßßßßÛÛÛÛ
ÜÜÛÛÛÛÛÛÛßßß ÜÛÛÜ ÜÜÜÜ ß
ÜÛÛÛÛÛÛßß ÛÛÛÛ ÛÛÛÛÛÛÛÛÜÜ
ÜÛÛÛÛÛßß ÛÛÛ ÜÜ ßÛÛÛ ßßÛÛÛÛÛÛÛÛÜÜ
ÜÛÛÛÛß ÜÜÜÜÛÛÛÛßßÜÜÜÜÜ ÛÛ ßßßÛÛÛÛÛÜÜ
ÜÛÛÛß ßÛßßßÛÛÛ ÜÛÛ ÜÛ ÛÛ ßßÛÛÛÛÜ
ÜÛÛß ÜÜ ÛÛÜ ÜÜÜ ÛÛÛ ÛÛÜÛß ÛÛ ßÛÛÛÜ
ÛÛß ßß ÛÛÛÛßÛÛÛ ÛÛÛ ÛÛ ÜÜÜ ÛÛÜ ßÛÛÛ
ÛÛß ÛÛÛÜ ÛÛÛ ÛÛÛ ÛÛÛ ßÛÛÛßß ßßß ÜÛÛ ßÛÛÜ
ÛÛß ÛÛÛ ÛÛÛ ßÛÛ ÛÛÛ ÜÜ ÛÛÛ ÜÜÛÛÜ ÛÛÛ
ÛÛ ÛÛÛ ÛÛß ÛÛ ßß ÛÛÛ ÜÜ ßßß ÜÜÛÛÛ ÜÛÛ ÜÛß ÛÛÛ
ÛÛ ÛÛÛ ÜÜÜÜÛÛÛßßßÜÛÛÛ ÛÛÜ ÛÛÛßÛÛÛ ÛÛÜÛß ÛÛß
ÛÛ ßß ßßßßÛÛÛ ÜÛÛßß ÛÛÛ ÛÛÛ ÛÛÛ ÛÛ ÜÜÜ ÛÛß
ÛÛ ÜÜ ÛÛ ÛÛÛ ßÛÛÜ ÛÛÛ ÛÛÛÜÛÛÛÛ ßÛÛÛßß ÛÛß
ßÛÛ ÜÛÛÜÜ ÛÛ ÛÛÜ ÛÛÛ ÛÛÛ ÛÛÛ ßÛÛßßÛÛß ÜÛÛß
ßÛÛÜ ÛÛß ÛÛ ÛÛ ÛÛÛ ÛÛÛ ÜÛÛß ßßß ÜÛÛß
ßÛÛÜÜ ÛÛ ÛÛ ÛÛÜÜÛÛÛ ÛÛÛ ßÛß ÜÛÛÛß
ßÛÛÛÜ ßÛÜÜÛÛß ßÛÛßßßß ÜÜÛÛÛßß
ßßÛÛÛÜÜ ßßßßß ÜÜÜÛÛÛÛßß
ßßÛÛÛÛÛÜÜÜÜ ÜÜÜÜÜÛÛÛÛÛÛÛßß
ßßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛßßß
ßßßßßßßßßßßßßßßßßßß
ÜÜÛÛÛÛÛÛÜÜ ÛÛÛÛÛÛÛÛÛÛÛÛÛ ÜÜÛÛÛÛÛÛÛÜÜ ÜÜÛÛÛÛÛÛÛÛÜÜ
ÛÛÛÛÛß ßßßßß ÛÛÛÛÛ ÜÛÛÛÛÛß ßÛÛÛÛÛÜ ÛÛÛÛß ÛÛÛÛÛÛ
ÛÛÛÛÛÛÜÜÜÜÜÜÜ ÛÛÛÛÛÛÛÛÛÛÜÜÜ ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÜÛÛÛÛÛß
ÛÛÛÛÛÛß ßÛÛÛÛÛÛ ßÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÜÜÛÛÛÛßß
ßÛÛÛÛÛÜ ÜÛÛÛÛÛÛ ÛÛÛÜ ÜÛÛÛÛÛß ßÛÛÛÛÛÜ ÜÛÛÛÛÛß ÜÜÛÛÛÛÛÜÜÜÜÜÜÜ
ßßÛÛÛÛÛÛÛßß ßßÛÛÛÛÛÛßßß ßßÛÛÛÛÛÛßßß ÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
ÜÜÜ ÜÜÜ ÜÜ ÜÜ ÜÜÜ ÜÜ ÜÜ ÜÜ ÜÜÜ
Û Û Û Û Û Û Û ß ÛÜÜ ßÜ ß ßÜ ß Û Û Û Û
Ûßß ÛßßÜ Û Û Û Ü Û Ü ßÜ Ü ßÜ Û Û ÛßßÜ
ß ß ß ßß ßß ßßß ßß ßß ßß ß ß
Copyright
---------
This version of X-Asm is FREEWARE. Feel free to distribute it where you want.
Contests of this package
------------------------
ATARI.PAL Atari palette 256 * RGB * 6 bits
CHANGES.TXT What's new in this version
CPUBUGS.ASX 6502 bugs tester source & bugs description
DLIST.TXT Atari Display List op-codes
FILE_ID.DIZ .DIZ file
HARDWARE.ASX Atari XL/XE hardware addresses
README.TXT This file
QUICKREF.TXT 6502 commands & X-Asm directives quick reference
XASM.COM X-Assembler program
XASM.TXT X-Assembler documentation
XBOOT.COM X-Boot - converts Atari executables into .ATR files
XBOOT.TXT Notes for X-Boot
XBOOTPRO.ASX Source of X-Boot professional loader
XBOOTSTD.ASX Source of X-Boot standard loader
XHEAD.COM X-Head - shows structure of Atari executables
XHEAD.TXT Notes for X-Head
XPAL.COM X-Pal - shows ATARI.PAL
Contact
-------
Author: For swap:
FOX/Taquart SLAVES/Taquart
Piotr Fusik Slawek Sledz
ul. Cicha 9 ul. Pozytywist¢w 2/77
05-300 Minsk Mazowiecki 20-369 Lublin
Poland Poland
e-mail: pfusik@elka.pw.edu.pl e-mail: slaves@pol.pl
===

509
xasm.htm
View File

@ -1,509 +0,0 @@
<HTML>
<HEAD>
<TITLE>X-Assembler 2.0 Manual</TITLE>
</HEAD>
<BODY BACKGROUND="6502PROC.GIF">
<CENTER>
<H1>X-Assembler version 2.0</H1>
coded by Fox/Taquart
<HR>
</CENTER>
<H2>INTRODUCTION</H2>
The X-Assembler is an assembler, which generates code for the 6502 processor.
It is 99% compatible with Quick Assembler on 8-bit Atari.
<BR>
<H3>System requirements</H3>
<UL>
<LI> a PC compatible computer with 386 or better CPU
<LI> a MS-DOS compatible OS
<LI> a numeric coprocessor for generating sinus tables.
Your CPU probably has a built-in coprocessor.
</UL>
<BR>
<H3>Creating a source program</H3>
Source file should be standard text file with IBM-style EOLs: CR/LF. You can
use any text editor on PC to prepare your source code.
Single line of source should not be longer than 256 characters.
There is no limitation on the length of the file.
Source may contain tabulators - there are treated as spaces.
Assembler is NOT case-sensitive.
<BR>
<H3>Converting Quick Assembler files</H3>
You must convert Atari text file into PC text file (EOL's from $9b to $0d/$0a),
ATASCII 0-31 and 128-255 characters should be replaced with standard ASCII
characters, using QAsm expressions.<BR>
You also have to change all OPT directives, but usually you needn't them
at all.
<BR>
<H3>Assembling a source program</H3>
Syntax (parameters in brackets are optional):<BR>
<PRE>XASM source [options]
</PRE><TT>'source'</TT> is name of source file.
If no extension given, the .ASX is added by default.<P>
Options are:
<DL>
<DT><TT>/c</TT>
<DD>Enable listing false conditionals.
<DT><TT>/i</TT>
<DD>Disable listing included source.
<DT><TT>/l[:fname]</TT>
<DD>Enable generating listing. If no <TT>fname</TT> given, listing is written to source.lst.
<DT><TT>/o:fname</TT>
<DD>Specify object name. Default is <TT>source.obx</TT>.
<DT><TT>/s</TT>
<DD>Disable converting spaces to tabs. Using tabs makes listing file shorter.<BR>
Tab stops are assumed to be every 8 characters.
<DT><TT>/t[:fname]</TT>
<DD>List label table. If no fname given, table is written at the end of listing.
</DL>
If source is incorrect, X-Asm displays ONLY FIRST encountered error.<P>
Errorlevels returned by X-Asm:<BR>
3 = bad parameters, assembling not started<BR>
2 = error occured<BR>
1 = warning(s) only<BR>
0 = no errors, no warnings<BR>
<H3>Listing structure</H3>
Line of listing includes:
<UL>
<LI> decimal number of line of source file (if source is different than in
previous listed line, appropriate message line is generated)
<LI> hexadecimal origin
<LI> hexadecimal bytes written to object file
Listed are also generated headers. A <TT>xxxx-yyyy&GT;</TT> in place of origin is
a generated header: <TT>$xxxx</TT> is the first and <TT>$yyyy</TT> is the last byte of block.
A <TT>FFFF&GT;</TT> represents two $ff bytes written as a header prefix.<P>
A plus sign placed after hex numbers stands for more bytes written to object
in this line, not listed through lack of space.
<LI> remaining part of listing line is a copy of source
</UL>
<H3>Label table structure</H3>
Line of label table includes:
<UL>
<LI> some info of label:<BR>
<TT>n</TT> - label not used<BR>
<TT>2</TT> - label value known in pass 2 only (label definition uses forward reference
and thus you can't do forward references to that label)
<LI> hex value of label
<LI> name of label
</UL>
<HR>
<H2>X-ASM LANGUAGE STRUCTURE</H2>
Lines of source code may be:
<UL>
<LI> empty lines - ignored, of course
<LI> comments - ignored, too
<LI> statements - not ignored :-)
</UL>
Comment lines must have one of the following characters in the FIRST column
of the line: <TT>* ; |</TT>
<H3>Numbers</H3>
Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff.
A number can be:
<UL>
<LI> a decimal number <TT>-12345</TT>
<LI> a hexadedecimal number <TT>$abcd</TT>
<LI> a binary number <TT>%10100101</TT>
<LI> a character <TT>'a'</TT> or <TT>"a"</TT> (new in 2.0!)
<LI> a hardware register <TT>^31</TT>
<LI> an origin counter <TT>*</TT>
</UL>
I think only 'a hardware register' should be explained. It is a short way
of accessing Atari hardware registers:<P>
<TT>^0x</TT> means <TT>$d00x</TT><BR>
<TT>^1x</TT> means <TT>$d01x</TT><BR>
<TT>^2x</TT> means <TT>$d20x</TT><BR>
<TT>^3x</TT> means <TT>$d30x</TT><BR>
<TT>^4x</TT> means <TT>$d40x</TT><BR>
where x is a hexadecimal digit.
<H3>Expressions</H3>
Expressions are numbers combined with operators and brackets.
You should use square brackets, because parentheses are reserved
for 6502 indirect addressing. Currently there are 19 operators:<P>
<TT>+ </TT>Addition<BR>
<TT>- </TT>Subtraction<BR>
<TT>* </TT>Multiplication<BR>
<TT>/ </TT>Division<BR>
<TT>% </TT>Remainder<BR>
<TT>& </TT>Bitwise and<BR>
<TT>| </TT>Bitwise or<BR>
<TT>^ </TT>Bitwise xor<BR>
<TT>&LT;&LT; </TT>Arithmetic shift left<BR>
<TT>&GT;&GT; </TT>Arithmetic shift right<BR>
<TT>= </TT>Equal<BR>
<TT>&LT;&GT; </TT>Not equal<BR>
<TT>!= </TT>Not equal (same as &LT;&GT;)<BR>
<TT>&LT; </TT>Less than<BR>
<TT>&GT; </TT>Greater than<BR>
<TT>&LT;= </TT>Less or equal<BR>
<TT>&GT;= </TT>Greater or equal<BR>
<TT>&& </TT>Logical and<BR>
<TT>|| </TT>Logical or<P>
Operator precedence:
<PRE>
first []
* / % & &LT;&LT; &GT;&GT;
+ - | ^
= &LT;&GT; != &LT; &GT; &LT;= &GT;=
&&
last ||
</PRE>
Compare and logical operators assume that zero is false and non-zero is true.
They return -1 for true.<P>
When calculating expression, 32-bit arithmetic is used. When range of 32 bits
is exceeded, <TT>'Arithmetic overflow'</TT> error is generated.<P>
If result of expression has improper size, <TT>'Value out of range'</TT> error occurs.<P>
Note difference beetwen X-Asm 2.0 and QAsm/X-Asm 1.2: in older assemblers,
which used 16-bit arithmetic, a <TT>LDA 0-1</TT> was correct (<TT>LDA $ffff</TT>), but X-Asm 2.0
encounters an error: address can't be negative.<P>
X-Asm recognizes now signed bytes: <TT>LDA #-1</TT> is OK.
<H3>Statements</H3>
A statement is divided into fields: a label field, an operation field,
one or two operand fields, and a comment field. There should be at least
one space between every two fields and there can't be any space within a field
excluding strings.
<H4>Label field</H4>
This field is optional. It is required only by the <TT>EQU</TT> directive.
Specyfying this field definies a label. Defined label represents an integer
of range -$ffff..$ffff.<P>
Name of label must begin in column 1 and can contain letters, digits
and underscores (<TT>_</TT>). Digit can't be label's first character. Name of label
can be as long as you want and all the characters are meaningful.<P>
In Quick Assembler only 6 leading characters were recognized
and some programs may not compile well under X-Asm for this reason.<P>
Defining a label without using <TT>EQU</TT> makes it equal to current value
of the origin counter. Label can't be redefined.
<H4>Operation field</H4>
Operation field is the only field which is always required.
You have to put one or more spaces or tab characters between label
and operation field. If no label is defined, line must start with a blank
character. Operation field is always 3 letters long. It can be:
<OL TYPE=a>
<LI><I> a 6502 processor command</I>
<LI><I> a compiler directive</I>
<LI><I> a pseudo-command</I>
</OL>
<OL TYPE=a>
<LI><I> 6502 command</I><BR>
One of 56 well known processor commands.<BR><BR>
<LI><I> compiler directive</I><BR>
One of the following:
<DL>
<DT><TT><B>EQU</B></TT> - assign a value of expression to the label
<DD>Note that label represents a number, not a text macro.<P>
Examples:
<PRE>five equ 5
ten equ five+five
</PRE>
<DT><TT><B>OPT</B></TT> - set assembling options
<DD>Currently there are two options: listing generating and headers generating.
You can turn any of these on or off.<P>
Examples:
<PRE> opt l- listing off
opt h- headers off
opt l+h- listing on, headers off
</PRE>
Remember not to put a space between options:
<PRE> opt l+ h-
</PRE>
is actually
<PRE> opt l+
</PRE>
because h- is a comment.<P>
Default (if no opt specified) is <TT>opt l+h+</TT>.<P>
<DT><TT><B>ORG</B></TT> - set new origin counter
<DD>Examples:
<PRE> org $600 code will be located starting from $0600
table org *+100 'table' points to 100 bytes of uninitialized data
</PRE>
New! You can set some options applied to new header (if headers are on):
<PRE> org $600
rts
org a:$601
</PRE>
'a:' tells X-Asm to always make a header, even it is unnecessary (as in above).
So by default X-Asm 2.0 does not generate unnecessary headers, distinct from
QAsm and X-Asm 1.2.
<PRE> org f:$700
</PRE>
'f:' works same as 'a:', but additionally tells to generate a $ff,$ff prefix
before header. X-Asm adds it to the first header in file by default, so use
this option only if you want the $ff's somewhere inside.<P>
<DT><TT><B>DTA</B></TT> - define data
<DD>You may define:
<UL>
<LI> numbers
<UL>
<LI> bytes: <TT>b(200)</TT>
<LI> words: <TT>a(10000)</TT>
<LI> low bytes of words: <TT>l(511)</TT> defines byte 255
<LI> high bytes of words: <TT>h(511)</TT> defines byte 1
You may enter many expressions in parentheses and combine different types
of data in single line.<P>
You may also define a sinus table. Enter this expression:<BR>
<TT>sin(centre,amp,size,first,last)</TT><BR>
where:
<UL>
<LI> centre is a number which is added to every value of sinus
<LI> amp is the amplitude of sinus
<LI> size is the period of sinus
<LI> first,last define range of values in the table.
They are optional. Default are 0,size-1.
</UL>
Example: <TT>dta a(sin(0,1000,256,0,63))</TT> defines table of 64 words representing
a quarter of sinus with amplitude of 1000.
<LI> real numbers: <TT>r(-1.23456e12)</TT><BR>
Real numbers are written in 6-byte Atari Floating-Point format. You can't
combine reals with operators, as you can integers.<P>
</UL>
<LI> text strings
<UL>
<LI> ASCII strings: <TT>c'Text'</TT> or <TT>c"Text"</TT>
<LI> ANTIC strings: <TT>d'Text'</TT> or <TT>d"It's something new!"</TT>
</UL>
A character string consists of any of characters surrounded by quotation
marks. Within a string, a single quotation mark character is
represented by two succesive quotation marks.<P>
Placing a '*' character after a string inverts bit 7 in every byte of string.<P>
</UL>
Examples of <TT>DTA</TT>:
<PRE>
dta b(2,5),a(1000,-1),l(12345,sin(0,127,256))
dta d"ANTIC"*,c'It''s a string',b(155)
</PRE>
<DT><TT><B>ICL</B></TT> - include another source file
<DD>Specifies another file to be included in the assembly as if the contests of
the referenced file appeared in place of the <TT>ICL</TT> statement. The included file
may contain other <TT>ICL</TT> statements.<P>
Examples:
<PRE>
icl 'macros.asx'
icl 'c:\atari\xasm\fileio.asx'
</PRE>
<DT><TT><B>END</B></TT> - end assembling of file
<DD>Remaining part of the file is not assembled. If this statement does not occur,
assembler stops assembling when encounters end of file.<BR>
Example:
<PRE>
end
</PRE>
<DT><TT><B>INS</B></TT> - insert contents of file
<DD>Copies every byte of specified file into object file and moves origin counter,
as if these bytes were defined with <TT>DTA</TT>.<P>
Examples:
<PRE>
ins 'picture.raw'
ins 'tables.dat'
</PRE>
New! You may specify range of inserted file. Syntax is:
<PRE>
ins 'file'[,offset[,length]]
</PRE>
First byte in file has offset 0.<P>
If offset is negative, it is counted from the end of file.
<PRE>
ins 'file',-256 inserts last 256 bytes of file
ins 'file',10,10 inserts bytes 10..19 of file
</PRE>
<DT><TT><B>RUN</B></TT> - generate run address
<DD>The Atari executable program should have run address specified. Remember that
a program may be loaded in many areas of memory and started from any address.
<PRE> run addr
</PRE>
is equivalent to:
<PRE> org $2e0
dta a(addr)
</PRE>
Examples:
<PRE> run start
run program
</PRE>
<DT><TT><B>INI</B></TT> - generate init address
<DD>The Atari executable program may have some routines which are executed during
loading process. There may be many init blocks in one file.
Examples:
<PRE> ini init
ini showpic
</PRE>
<DT><TT><B>ERT</B></TT> - generate error if expression is true
<DD>Examples:
<PRE> ert *&GT;$c000
ert len1&GT;$ff||len2&GT;$ff
</PRE>
<DT><TT><B>IFT</B></TT> - assemble if expression is true<BR>
<TT><B>ELS</B></TT> - else<BR>
<TT><B>EIF</B></TT> - end if<BR>
<DD>Example:
<PRE>noscr equ 1
ift noscr
lda #0
els
lda #$22
eif
sta $22f
</PRE>
</DL>
<LI><I> pseudo-command</I><BR>
It is something like built-in macro. It replaces two or more standard
processor commands. Note that it is not an illegal instruction and works
on typical 6502.
<DL>
<DT><TT><B>ADD</B></TT> - addition without carry
<DD>If you ever programmed 6502, you must have noticed that you had to use a <TT>CLC</TT>
before <TT>ADC</TT> for every simple addition.<BR>
X-Asm can do it for you. <TT>ADD</TT> simply replaces two instructions: <TT>CLC</TT> and <TT>ADC</TT>.<P>
<DT><TT><B>SUB</B></TT> - subtraction
<DD>It is <TT>SEC</TT> and <TT>SBC</TT>.<P>
<DT><TT><B>JNE, JEQ, JCC, JCS, JPL, JMI, JVC, JVS</B></TT> - conditional jumps
<DD>They are a kind of 'long' branches. While standard branches (<TT>BNE, BEQ</TT>) have
range of -128..+127, these jumps have range of all 64 kB.<P>
For example: a <TT>JNE DEST</TT> is replaced with:
<PRE> beq *+5
jmp dest
</PRE>
<DT><TT><B>INW</B></TT> - increment word
<DD>It is a 16-bit memory increment command. An <TT>INW DEST</TT> will be replaced by:
<PRE> inc dest
bne _skip
inc dest+1
_skip equ *
</PRE>
The <TT>_skip</TT> label is not declared of course.<P>
<DT><TT><B>MVA, MVX, MVY</B></TT> - move byte using accumulator, X or Y
<DD>These pseudo-commands require two operands.
<PRE> mva source dest = lda source : sta dest
mvx source dest = ldx source : stx dest
mvy source dest = ldy source : sty dest
</PRE>
<DT><TT><B>MWA, MWX, MWY</B></TT> - move word using accumulator, X or Y
<DD>Also require two operands. They are something like combination of two <TT>MV*</TT>'s:
one to move low byte, and the other to move high byte.<P>
You can't use indirect nor pseudo addressing modes with <TT>MW*</TT>.<P>
Destination must be absolute address (indexed or not).<P>
When source is also absolute, a <TT>MW* SOURCE DEST</TT> will be:
<PRE> mv* source dest
mv* source+1 dest+1
</PRE>
When source is immediate, a <TT>MW* #IMMED</TT> dest will be
<PRE> mv* &LT;immed dest
mv* &GT;immed dest+1
</PRE>
but when &LT;IMMED = &GT;IMMED and IMMED is not forward-referenced,
X-Asm uses optimization:
<PRE> mv* &LT;immed dest
st* dest+1
</PRE>
</DL>
</OL>
<H4>Operand</H4>
It depends on the operation field. Some statements don't need an operand
or need two operands.<P>
6502 commands require operand depending on the addressing mode.
Addressing modes should be entered in standard convention except
the accumulator addressing mode, which should be marked with a <TT>@</TT> character
(as in Quick Assembler).<P>
There are two extra immediate addressing modes: &LT; and &GT;, which use low/high
byte of word is used rather than byte value.<P>
In absolute addressing modes, X-Asm examines expression and uses zero-page
addressing mode if it thinks it is possible to do it. You may override it
with <TT>a:</TT> and <TT>z:</TT> prefixes.<P>
Examples:
<PRE>
nop
asl @
lda &GT;$1234 assembles to lda #$12
lda $100,x
lda a:0 generates 16-bit address
jmp ($0a)
lda ($80),y
</PRE>
New! X-Asm 2.0 brings pseudo addressing modes. They are similar to
pseudo-commands and you may use them as standard addressing modes
in all 6502 commands and pseudo-commands, excluding <TT>MW*</TT>:
<PRE> cmd a,x+ = cmd a,x : inx
cmd a,x- = cmd a,x : dex
cmd a,y+ = cmd a,y : iny
cmd a,y- = cmd a,y : dey
cmd (z),y+ = cmd (z),y : iny
cmd (z),y- = cmd (z),y : dey
cmd (z,0) = ldx #0 : cmd (z,x)
cmd (z),0 = ldy #0 : cmd (z),y
</PRE>
<H3>Problems</H3>
These notes may help you solve problems:
<UL>
<LI> No spaces are allowed within a field.
<PRE>label equ 1 + 2
</PRE>
causes label to be equal 1 (<TT>+ 2</TT> is treated as a comment).<P>
<LI> <TT>&LT;</TT> and <TT>&GT;</TT> represent addressing modes rather than LOW and HIGH operators.<P>
You specify <TT>lda &LT;table</TT>, not <TT>lda #&LT;table</TT> like in most 6502 assemblers.<P>
<LI> Label definition does not include a colon
<PRE>label: lda ^4b ERROR - colon after label name
</PRE>
<LI> Exactly one run address should be specified<P>
Remember that unlike in other assemblers
<PRE> end start
</PRE>
does not tell the assembler that <TT>start</TT> is the run address (it is a comment).
You must specify the run address with <TT>RUN</TT> directive.<P>
<LI> X-Asm reads source twice (in pass 1 and pass 2)<BR>
This allows forward references, but not too complex.<P>
Keep in mind that assembler should know all the values in second pass.<P>
Example:
<PRE>two equ one+one This value is known in 2nd pass only
one equ 1 This value is known as early as in 1st pass
</PRE>
These values can be fixed in 2 passes.<P>
But if you insert following statement as first line:
<PRE>three equ one+two
</PRE>
X-Asm will generate an error because it doesn't know the value of <TT>three</TT> in
second pass.<BR>
(sorry for v1.2 users: <TT>EQU</TT> forward reference didn't work at all).<P>
<LI> X-Asm displays only first error<BR>
When you correct one error don't be surpised if you get another one.<P>
<LI> If you encounter X-Asm works improperly, please <A HREF=mailto:pfusik@elka.pw.edu.pl>let me know</A>.
</UL>
</BODY>
</HTML>

View File

@ -1,16 +0,0 @@
X-Boot 3.2 by Fox/Taquart
Some (un)important notes
=========================
The only change from version 3.1: Now .OBX is default extension of executable.
---
This tool converts Atari executable (.OBX) into Atari disk image (.ATR).
Produced ATR is single density and as short as possible. It has a loader
in one boot sector. You can choose one of two built-in loaders:
standard and professional. Professional loader allows you to load code/data
under ROM and disables ROM and interrupts while starting program.
Both loaders disable Atari Basic. For details, view sources of loaders.
X-Boot does not write your program in ATR as Atari file, you can only run it
by booting.
===

View File

@ -1,70 +0,0 @@
* Boot executable file loader coded by Fox/Taquart
* Version for professionals - can load file under ROM.
* Note interrupts and ROM are disabled when running loaded program.
opt h-
org $480
bufr equ $400
tp equ $43
vc equ $44
* Boot header
boot equ *
rts rts
dta b(1),a(boot,$e477)
* Nice blank screen
mva #0 $22f
mva #$52 $2c8
lda 20
cmp 20
beq *-2
* Init run vector
mwa #rts $2e0
ldy #$fe
* Load header
lhead mwa #rts $2e2
ldx <-5
* Store byte of header
hput sta vc+4,x+
stx tp
jmp get
next inw vc
get iny
bpl getx
inw $30a
mva #$ff ^31
lsr ^4e
cli
jsr $e453
sec
bmi rts
sei
mvy #0 ^4e
dec ^31
getx lda bufr,y
ldx tp
bne hput
sta (vc,x)
lda vc
cmp vc+2
bne next
lda vc+1
cmp vc+3
bne next
endseq tya
pha
jsr init
pla
tay
bpl lhead !
init jmp ($2e2)
* This will be added at the end of loaded file
opt h+
org endseq
jmp ($2e0)
end

View File

@ -1,69 +0,0 @@
* Boot executable file loader coded by Fox/Taquart
* Standard loader - ROM and interrupts enabled.
opt h-
org $780
bufr equ $700
tp equ $43
vc equ $44
* Boot header
boot equ *
rts rts
dta b(1),a(boot,$e477)
* Print text
txtpos equ 215
ldy #txtpos
print mva text-txtpos,y ($58),y+
cpy #txtpos+txtlen
bcc print
* Init run vector
mwa #rts $2e0
mva >bufr $305
mvy #$ff ^31
dey #$fe
* Load header
lhead mwa #rts $2e2
ldx <-5
* Store byte of header
hput sta vc+4,x+
stx tp
jmp get
next inw vc
get iny
bpl getx
inw $30a
jsr $e453
sec
bmi rts
ldy #0
getx lda bufr,y
ldx tp
bne hput
sta (vc,x)
lda vc
cmp vc+2
bne next
lda vc+1
cmp vc+3
bne next
endseq tya
pha
jsr init
pla
tay
bpl lhead !
init jmp ($2e2)
text dta d'Loading... '
txtlen equ *-text
* This will be added at the end of loaded file
opt h+
org endseq
jmp ($2e0)
end

View File

@ -1,17 +0,0 @@
X-Head 1.1 by Fox/Taquart
Some (un)important notes
=========================
The only change from version 1.0: Now .OBX is default extension.
---
This tool prints headers of Atari executable.
It also shows program init and run addresses.
Other things displayed:
xxx bytes - length of file, including headers
xxx blocks - number of headers
xxx inits - number of init blocks (02e2-02e3)
xxx modules - number of FFFF headers (one at the beginning is required)
You can redirect output to a file, for example:
XHEAD TEST.COM >TEST.HDR
===