From 0c019b97d13add07099ad7df6e0ace0c0ed84000 Mon Sep 17 00:00:00 2001 From: Piotr Fusik Date: Fri, 10 Sep 1999 01:20:00 +0200 Subject: [PATCH] X-Assembler 2.2 release. --- atari.pal | Bin 768 -> 0 bytes changes.txt | 34 -- dlist.txt | 61 --- doc/6502proc.gif | Bin 0 -> 592 bytes cpubugs.asx => doc/cpubugs.asx | 19 +- doc/gr0.htm | 51 +++ doc/gtia.htm | 221 ++++++++++ doc/index.htm | 33 ++ doc/xasm.htm | 714 +++++++++++++++++++++++++++++++++ doc/xboot.htm | 68 ++++ doc/xbootpro.asx | 64 +++ doc/xbootstd.asx | 63 +++ doc/xhead.htm | 42 ++ doc/xload.htm | 81 ++++ doc/xloadpro.asx | 60 +++ doc/xloadstd.asx | 60 +++ file_id.diz | 7 - hardware.asx | 107 ----- quickref.txt | 99 ----- readme.txt | 75 ---- xasm.htm | 509 ----------------------- xboot.txt | 16 - xbootpro.asx | 70 ---- xbootstd.asx | 69 ---- xhead.txt | 17 - 25 files changed, 1465 insertions(+), 1075 deletions(-) delete mode 100644 atari.pal delete mode 100644 changes.txt delete mode 100644 dlist.txt create mode 100644 doc/6502proc.gif rename cpubugs.asx => doc/cpubugs.asx (83%) create mode 100644 doc/gr0.htm create mode 100644 doc/gtia.htm create mode 100644 doc/index.htm create mode 100644 doc/xasm.htm create mode 100644 doc/xboot.htm create mode 100644 doc/xbootpro.asx create mode 100644 doc/xbootstd.asx create mode 100644 doc/xhead.htm create mode 100644 doc/xload.htm create mode 100644 doc/xloadpro.asx create mode 100644 doc/xloadstd.asx delete mode 100644 file_id.diz delete mode 100644 hardware.asx delete mode 100644 quickref.txt delete mode 100644 readme.txt delete mode 100644 xasm.htm delete mode 100644 xboot.txt delete mode 100644 xbootpro.asx delete mode 100644 xbootstd.asx delete mode 100644 xhead.txt diff --git a/atari.pal b/atari.pal deleted file mode 100644 index c22f5bc0bc1c1e3eb3d9865c75bb732483c9f236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 768 zcmV~$iMC@f007V&s+6iF2q8oWVlCBbjd%S2U(LM$fXn5gs;XfamSsT*gCM{dr)kO< zEvs@};rl&8 z6UH+kYnE+{?VKNVeYR}~%viRF;!q7TBj9G(*tmts;HOhamzcdtxzTzr#KF6>89d-2 z8DRwzjbui~OvY{Az^3!NF&yW3Udj5QpI`Ai_;EI;2|`nC3%XY7azxH`b z8d40bJrdo{Ovvn@gi#$NZJ73PKBeW7*K65sRlker=$BJ^1d0=BUTmQB5#>%&dRc{- zz`Q5TM7y~d*Xp^6*WQ1Q>30HGmwoe!tQ&Uk#IrKwGVJptss1K!Kr+LN9bet_=I2IO zm~myL!pVDBj($BOvEqJ9reC@o^kD-BN-$7@NR5(Pk{Ky`8 z^+&gZc{)I*6xnj(DJfEOd@G1v(R))qy4oIE=Q+UT>AzRBZQ;ISUj?Bq#dn2RDs}b3 bzgOrXu+tGZ(qLxc%JJ5aUzZ&NJD=r$Ubb2x diff --git a/changes.txt b/changes.txt deleted file mode 100644 index df4cb2d..0000000 --- a/changes.txt +++ /dev/null @@ -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 - -=== \ No newline at end of file diff --git a/dlist.txt b/dlist.txt deleted file mode 100644 index de958ad..0000000 --- a/dlist.txt +++ /dev/null @@ -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. - -=== \ No newline at end of file diff --git a/doc/6502proc.gif b/doc/6502proc.gif new file mode 100644 index 0000000000000000000000000000000000000000..bfa3cc09b4cfb4c4e4590663990aacb2b90f8ed8 GIT binary patch literal 592 zcmV-W000092gpaAq?GK}z zwAzca-n{z{hEG72rYVBw%C@Q1#xnXw^F7xNUhcB4z-?$iz;6_&B!Mvr(eNxnS;`*5 zRiwhKhhs{+;0DFrW@v?6lE%xhxpT6`$8t1h&cM#s6YwRDZWP^|XmN=`-oMXPGccYMA!PI5h=3#OikHIjeg~L$+FaWlI;x zyUXQk3W5Av8k$?2AvU@kTp241t&GdqDNK30dx@RR%!Zvw{cSF;9!&U3+YMX|4jI=2 zinccGJzlOY2wyINtor%;Ri~FTTE%RoYjXQcRzEUTYN%Sw52- zq5MhuY8XL4SFz3v#PkEqS~gSK;|d3@2R~ozq-Cq)jU>5J7V)?nv@TV=ZuJ7i>o>6A z!GsIPg(-xYS}ai+@9mqz9o@gEm_F1O@T1zLmp8k$BWkRv&W@?t_0~6`+{B+nnuQ_n4$4l|L|w$ExNDfuOCpJqo3M|IkAY~@~jvyGhm5Rb--UB6b`+^}|)WV*$K z=)Gh#tK>0}H*y|j`t|6`k8j`JJp64}f~;bnS15P(_3hs&?~-0|{`DtcfdCSCpn>jT eaLRcX`Lhv1^enhtg%)0jVTKxR$RP#=0029xdLn=T literal 0 HcmV?d00001 diff --git a/cpubugs.asx b/doc/cpubugs.asx similarity index 83% rename from cpubugs.asx rename to doc/cpubugs.asx index 0509487..d78fe8d 100644 --- a/cpubugs.asx +++ b/doc/cpubugs.asx @@ -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 0: X=*|$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. - -=== diff --git a/doc/gr0.htm b/doc/gr0.htm new file mode 100644 index 0000000..f732074 --- /dev/null +++ b/doc/gr0.htm @@ -0,0 +1,51 @@ + + +GR0 1.1 Manual + + +
+

GR0 version 1.1

+by Fox/Taquart

+


+
+ +

INTRODUCTION

+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. +

CHANGES

+

Version 1.1

+
    +
  • first release +
+ +
+

USAGE

+You can run GR0 without any parameters to see available options. They are: +
+
/a +
Set Atari scheme. It is equivalent to options /b:1 /c:7 /n /l /x

+

/b:nn +
Set background color nn, where nn is decimal number of range 0-15

+

/c:nn +
Set foreground (letters) color nn, where nn is decimal number of range 0-15

+

/d +
Set default PC font. Resets all characters.

+

/f:fname +
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.

+

/i +
Set characters 128-255 to inverse of 0-127. +/i can only be used with /a, /f or /x.

+

/l +
Select 50 lines font. Without this option, 25 lines font is selected.

+

/n +
Initialize text mode. Clears screen and restores default font and colors.

+

/x +
Set Atari built-in font. Sets characters 0-127 to standard Atari font. +It looks better with /l option.

+

+In Windows, font changes only in full-screen mode. Colors and number of lines change +also in a window. + + \ No newline at end of file diff --git a/doc/gtia.htm b/doc/gtia.htm new file mode 100644 index 0000000..aa6d80f --- /dev/null +++ b/doc/gtia.htm @@ -0,0 +1,221 @@ + + +GTIA Documentation + + +
+

GTIA Documentation

+by Fox/Taquart

+


+

+

Registers

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Address  Read register  Write register  Address  Read register  Write register 
^00KOLM0PFHPOSP0^10TRIG0GRAFP3
^01KOLM1PFHPOSP1^11TRIG1GRAFPM
^02KOLM2PFHPOSP2^12unusedCOLPM0
^03KOLM3PFHPOSP3^13TRIG3COLPM1
^04KOLP0PFHPOSM0^14PALCOLPM2
^05KOLP1PFHPOSM1^15unusedCOLPM3
^06KOLP2PFHPOSM2^16unusedCOLPF0
^07KOLP3PFHPOSM3^17unusedCOLPF1
^08KOLM0PSIZEP0^18unusedCOLPF2
^09KOLM1PSIZEP1^19unusedCOLPF3
^0AKOLM2PSIZEP2^1AunusedCOLBAK
^0BKOLM3PSIZEP3^1BunusedGTIACTL
^0CKOLP0PSIZEM^1CunusedVDELAY
^0DKOLP1PGRAFP0^1DunusedPMCNTL
^0EKOLP2PGRAFP1^1EunusedHITCLR
^0FKOLP3PGRAFP2^1FCONSOLCONSOL
+

+


+

+

Description

+
+ +COLBAK +- Color of background
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue

+ +COLPF0 COLPF1 COLPF2 COLPF3 +- Colors of player field
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue

+ +COLPM0 COLPM1 COLPM2 COLPM3 +- Colors of players and missiles
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue

+ +CONSOL +- Consol keys
+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.
+bit 0 - START key
+bit 1 - SELECT key
+bit 2 - OPTION key
+bit 3 - click sound
+bits 4-7 - unused (=0)

+ +GRAFM +- Graphics of missiles
+bits 1,0 - graphics of missile 0
+bits 3,2 - graphics of missile 1
+bits 5,4 - graphics of missile 2
+bits 7,6 - graphics of missile 3

+ +GRAFP0 GRAFP1 GRAFP2 GRAFP3 +- Graphics of players

+ +GTIACTL +- GTIA control
+bits 3-0 - priorities of players and missiles
+0001 - P0, P1, P2, P3, PF0, PF1, PF2, PF3, BAK
+0010 - P0, P1, PF0, PF1, PF2, PF3, P2, P3, BAK
+0100 - PF0, PF1, PF2, PF3, P0, P1, P2, P3, BAK
+1000 - PF0, PF1, P0, P1, P2, P3, PF2, PF3, BAK
+Players/missiles and playfields are mentioned from highest to lowest priority.
+Other combinations of bits 3-0 cause strange side effects.
+bit 4 - set all missiles color to COLPF3
+bit 5 - enable ORing colors P0 with P1 and P2 with P3 on common areas
+bits 7,6 - GTIA extra graphics mode
+00 - off
+01 - 16 luminaces
+10 - 9 colors
+11 - 16 hues

+ +HITCLR +- Clear collision registers
+Any value written to this register causes collision registers to be reset.

+ +HPOSM0 HPOSM1 HPOSM2 HPOSM3 +- Horizontal positions of missiles

+ +HPOSP0 HPOSP1 HPOSP2 HPOSP3 +- Horizontal positions of players

+ +KOLM0P KOLM1P KOLM2P KOLM3P +- Collisions of missiles with players
+bit 0 - collision with player 0
+bit 1 - collision with player 1
+bit 2 - collision with player 2
+bit 3 - collision with player 3
+bits 4-7 - unused (=0)

+ +KOLM0PF KOLM1PF KOLM2PF KOLM3PF +- Collisions of missiles with playfield
+bit 0 - collision with playfield 0
+bit 1 - collision with playfield 1
+bit 2 - collision with playfield 2
+bit 3 - collision with playfield 3
+bits 4-7 - unused (=0)

+ +KOLP0P KOLP1P KOLP2P KOLP3P +- Collisions of players with players
+bit 0 - collision with player 0
+bit 1 - collision with player 1
+bit 2 - collision with player 2
+bit 3 - collision with player 3
+bits 4-7 - unused (=0)

+ +KOLP0PF KOLP1PF KOLP2PF KOLP3PF +- Collisions of players with playfield
+bit 0 - collision with playfield 0
+bit 1 - collision with playfield 1
+bit 2 - collision with playfield 2
+bit 3 - collision with playfield 3
+bits 4-7 - unused (=0)

+ +PAL +- PAL system flag
+bit 0 - unused
+bits 1-3 - 000 if TV system is PAL. Else it is NTSC
+bits 4-7 - unused (=0)

+ +PMCTL +- Player/Missile Control
+bit 0 - get missiles data from ANTIC
+bit 1 - get players data from ANTIC
+bit 2 - lock triggers when pressed
+bits 3-7 - unused

+ +SIZEM +- Sizes of missiles
+Two bits set size of each missile:
+00 - single size
+01 - double size
+10 - single size
+11 - quad size
+bits 1,0 - size of missile 0
+bits 3,2 - size of missile 1
+bits 5,4 - size of missile 2
+bits 7,6 - size of missile 3

+ +SIZEP0 SIZEP1 SIZEP2 SIZEP3 +- Sizes of players
+bits 1,0 - size of player (see
SIZEM)
+bits 2-7 - unused

+ +TRIG0 TRIG1 TRIG3 +- Triggers
+TRIG0 and TRIG1 contain trigger status of two joysticks. +TRIG3 contains presence of cartridge.
+bit 0 - reset if trigger pressed
+bits 1-7 - unused (=0)

+ +VDELAY +- Vertical delay of players and missiles
+Causes players and missiles to be displayed one scanline lower. +Works only in two-line resolution.
+bit 0 - delay missile 0
+bit 1 - delay missile 1
+bit 2 - delay missile 2
+bit 3 - delay missile 3
+bit 4 - delay player 0
+bit 5 - delay player 1
+bit 6 - delay player 2
+bit 7 - delay player 3

+ + + \ No newline at end of file diff --git a/doc/index.htm b/doc/index.htm new file mode 100644 index 0000000..f1df23b --- /dev/null +++ b/doc/index.htm @@ -0,0 +1,33 @@ + + +X-ASM 2.2 Package Documentation + + +

+

X-ASM Package version 2.2

+by
Fox/Taquart

+


+

+Manuals of utilities:

+ + + + + + +
X-Assembler6502 cross-assembler
X-BOOTAtari executable -> disk image converter
X-HEADSimple Atari executable analyzer
X-LOADSIO2PC interface Atari executable loader
GR0DOS screen adjuster
+

+


+

+Atari XL/XE documentation (under construction):

+ + +
GTIAGTIA chip documentation
CPUBUGS.ASX6502 bugs detector source +
+

+


+

+All programs are freeware. Copyright (c) Taquart 1999. +

+ + \ No newline at end of file diff --git a/doc/xasm.htm b/doc/xasm.htm new file mode 100644 index 0000000..f69d2df --- /dev/null +++ b/doc/xasm.htm @@ -0,0 +1,714 @@ + + +X-Assembler 2.2 Manual + + +
+

X-Assembler version 2.2

+by Fox/Taquart

+

+ +

+

INTRODUCTION + USAGESYNTAXFAQBACK +

+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. +
+

CHANGES

+

Version 2.2

+ +

Version 2.0

+
    +
  • truncating name of object bug fixed +
  • EQU and 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 +
+ +

+

INTRODUCTION + USAGE + SYNTAXFAQBACK +

+ +

System requirements

+
    +
  • a PC compatible computer with 386 or better CPU +
  • a MS-DOS compatible OS +
  • a numeric coprocessor for generating sinus tables. +Your CPU probably has a built-in coprocessor. +
+

Creating a source program

+Source file should be plain ASCII file. Although different EOLs are supported, +you would probably prefer CR/LF EOLs because of text editor.
+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, which are treated as spaces.
+Assembler is not case-sensitive. +
+

Converting Quick Assembler files

+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.
+You also have to change all OPT directives, +but usually you needn't them at all. +
+

Assembling a source program

+You run assembler from DOS prompt with following syntax:
+
XASM source [options]
+
source is name of source file. +If no extension given, the .ASX is added by default.

+Optional options are: +

+
/c +
Enable listing false conditionals.
+By default lines skipped because of false condition are not listed.

+ +

/e +
Enable setting environment variables when error occurs.
+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: +
XASM %1 /e
+IF NOT ERRORLEVEL 1 GOTO ok
+NCE +%ERRLINE% %ERRFILE%
+
+NCE stands for Norton Classic Editor.

+If there was no error, variables point at last warning. +If no warning occured, they are removed from the environment.

+

/i +
Disable listing included source.
+Only main source file will be listed.

+

/l[:fname] +
Enable generating listing. +If no fname given, listing is written to source.lst.

+ +

/n +
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.

+

/o:fname +
Specify object name. Default is source.obx.

+

/s +
Disable converting spaces to tabs in listing. +Using tabs makes listing file shorter.
+Tab stops are assumed to be every 8 characters.

+

/t[:fname] +
List label table. +If no fname given, table is written at the end of listing.

+

+ +If source is incorrect, X-Asm stops on first encountered error.

+ +Errorlevels returned by X-Asm:
+3 = bad parameters, assembling not started
+2 = error occured
+1 = warning(s) only
+0 = no errors, no warnings
+ +

Listing structure

+Line of listing includes: +
    +
  • decimal number of line of source file (if source is different than in +previous listed line, appropriate message line is generated) +
  • hexadecimal origin +
  • hexadecimal bytes written to object file
    +Listed are also generated headers. A xxxx-yyyy> in place of origin +represents generated header: $xxxx is the first and $yyyy +is the last byte of the block. +A FFFF> represents two $ff bytes written as a header prefix.
    +A plus sign placed after hex numbers stands for more bytes written to object +in this line, not listed through lack of space. +
  • remaining part of listing line is a copy of source line +
+ +

Label table structure

+Line of label table includes: +
    +
  • some label attributes:
    +n - label defined but not used elsewhere
    +2 - label value known in pass 2 only (label definition uses forward +reference and thus you can't do forward references to that label) +
  • hexadecimal value of the label +
  • name of the label +
+ +

+

INTRODUCTIONUSAGE + SYNTAX + FAQBACK +

+Lines of source code may be: +
    +
  • empty lines - ignored, of course +
  • comments - ignored, too +
  • statements - not ignored :-) +
+Comment lines must have one of the following characters in the FIRST column +of the line: * ; | + +

+

Expressions  Statements

+Expressions are numbers combined with operators and brackets. +You should use square brackets, because parentheses are reserved +for 6502 indirect addressing. + +

Numbers

+Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff. +A number can be: + + + + + + + +
  • a decimal number
-12345
  • a hexadedecimal number
$abcd
  • a binary number
%10100101
  • an ASCII character
'a' or "a"
  • an origin counter
*
  • a hardware register
^31
+
+An abbreviation of Atari hardware register:
+^0x means $d00x
+^1x means $d01x
+^2x means $d20x
+^3x means $d30x
+^4x means $d40x
+where x is a hexadecimal digit. +
+ + + +
  • an op-code
{lda #0}
+
+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. +
+

+ +

Operators

+Currently there are 19 operators:

+ + + + + + + + + + + + + + + + + + + + + +
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder
& Bitwise and
| Bitwise or
^ Bitwise xor
<< Arithmetic shift left
>> Arithmetic shift right
= Equal
<> Not equal
!= Not equal (same as <>)
< Less than
> Greater than
<= Less or equal
>= Greater or equal
&& Logical and
|| Logical or
+

+Operator precedence: + + + + + + + +
first[]
* / % & << >>
+ - | ^
= <> != < > <= >=
&&
last ||
+

+Compare and logical operators assume that zero is false and non-zero is true. +They return 1 for true.

+When calculating expression, 32-bit arithmetic is used. When range of 32 bits +is exceeded, 'Arithmetic overflow' error is generated.

+ +

+

Expressions  Statements

+A statement is divided into fields: + +There should be at least one space between every two fields +and there can't be any space within a field excluding strings. + +

Label field

+This field is optional. It starts from first character of line, without +any blank characters before. It has two applications: +
+You can not define a label in line which you repeat.

+ + +

Operation field

+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.
+Example: +
 adc:sta $80
+
is equivalent to +
 adc $80
+ sta $80
+
+Single instruction always consists of 3 letters. It can be: +
    +
  1. 6502 command
    +One of 56 well known processor commands.

    + +
  2. compiler directive
    +One of the following:

    +

    +
    EQU - assign a value of expression to the label +
    Note that label represents a number, not a text macro.
    +Examples: +
    five equ 5
    +here equ *
    +
    + +
    OPT - set assembling options +
    Currently there are two options: listing generating and headers generating. +You can turn any of these on or off.
    +Default (if no OPT specified) is opt l+h+.
    +Examples: +
     opt l-    listing off
    + opt h-    headers off
    + opt l+h-  listing on, headers off
    +
    + +
    ORG - set new origin counter +
    You can set some options applied to new header (if headers are on): +
      +
    • a: tells X-Asm to always make a header, even it is unnecessary, +like in ORG *. +
    • 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.
      +
    +Examples: +
     org $600
    + org f:$700
    +table org *+100
    +
    +In the latter example table points to 100 bytes +of uninitialized data (note label is assigned to * +before ORG directive is executed).

    + +

    DTA - define data +
    There are various data types: +
      +
    • numbers +
        +
      • bytes: b(200) +
      • words: a(10000) +
      • low bytes of words: l(511) defines byte 255 +
      • high bytes of words: h(511) defines byte 1
        +You may enter many expressions in parentheses and combine different types +of data in single line, separating things with commas.
        +You may also define a sinus table. Syntax is:
        +sin(centre,amp,size,first,last)
        +where: +
          +
        • centre is a number which is added to every sinus value +
        • amp is the amplitude of sinus +
        • size is the period of sinus +
        • first,last define range of values in the table. +They are optional. Default are 0,size-1. +
        +Example: dta a(sin(0,1000,256,0,63)) defines table of 64 words +representing a quarter of sinus with amplitude of 1000.

        +

      • real numbers: r(-1.23456e12)
        +Real numbers are written in 6-byte Atari Floating-Point format. You can't +combine reals with operators, as you can integers.

        +

      +
    • text strings +
        +
      • ASCII strings: c'Text' or c"Text" +
      • ANTIC strings: d'Text' or d"Text" +
      +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.
      +Placing a * character after a string inverts +high bit in every byte of string.

      +

    +Examples of DTA: +
    + dta b(2,5),a(1000,-1),l(12345,sin(0,127,256))
    + dta d"ANTIC"*,c'It''s a string',b(155)
    +
    + +
    ICL - include another source file +
    Specifies another file to be included in the assembly as if the contests of +the referenced file appeared in place of the ICL statement. +The included file may contain other ICL statements. +The .ASX extension is added if none given.

    +Examples: +

    + icl 'macros.asx'
    + icl 'c:\atari\xasm\fileio'
    +
    + +
    END - end assembling file +
    Remaining part of the file is not assembled. If this statement does +not occur, assembler stops assembling when encounters end of file.
    +Example: +
    + end
    +
    + +
    INS - insert contents of file +
    Copies every byte of specified file into object file and moves origin +counter, as if these bytes were defined with DTA.
    +You may specify range of inserted file. Syntax is: +
    + ins 'file'[,offset[,length]]
    +
    +First byte in file has offset 0.
    +If offset is negative, it is counted from the end of file.
    +Examples: +
    + ins 'picture.raw'
    + ins 'file',-256   insert last 256 bytes of file
    + ins 'file',10,10  insert bytes 10..19 of file
    +
    + +
    RUN - generate run address +
    The Atari executable program should have run address specified. +A program may be loaded in many areas of memory and started from any address. +
     run addr
    +
    +is equivalent to: +
     org $2e0
    + dta a(addr)
    +
    +Examples: +
     run start
    + run program
    +
    + +
    INI - generate init address +
    The Atari executable program may have some routines which are executed +during loading process. There may be many init blocks in one file.
    +Examples: +
     ini init
    + ini showpic
    +
    + +
    ERT - generate error if expression is true +
    Examples: +
     ert *>$c000
    + ert len1>$ff||len2>$ff
    +
    + +
    IFT - assemble if expression is true
    +ELS - else
    +EIF - end if
    +
    With these directives you can construct fragments which +are assembled when a condition is met. +Conditional constructions can be nested.
    +Example: +
    noscr equ 1
    + ift noscr
    + lda #0
    + els
    + lda #$22
    + eif
    + sta $22f
    +
    +Above example can be rewritten using line repeating feature: +
    noscr equ 1
    +:noscr<>0 lda #0
    +:noscr=0 lda #$22
    + sta $22f
    +
    + +
    +
  3. pseudo-command
    +It is something like built-in macro. +Note that it is not an illegal instruction and works on typical 6502.

    +

    +
    ADD - addition without carry +
    If you ever programmed 6502, you must have noticed that you had +to use a CLC before ADC for every simple addition.
    +X-Asm can do it for you. ADD replaces two instructions: +CLC and ADC.

    + +

    SUB - subtraction +
    It is SEC and SBC.

    + + +

    RCC, RCS, REQ, RMI, RNE, RPL, RVC, RVS - conditional repeat +
    They are branches to the previous instruction. +They take no operand, because the branch target +is the address of previously assembled instruction.
    +Example: +
     ldx #0
    + mva:rne $500,x $600,x+
    +
    +The example code copies memory $500-$5ff to $600-$6ff. +With standard 6502 commands only it would be: +
     ldx #0
    +loop lda $500,x
    + sta $600,x
    + inx
    + bne loop
    +
    + +
    SCC, SCS, SEQ, SMI, SNE, SPL, SVC, SVS - conditional skip +
    They are branches over the next instructions. No operand is required, +because the target is the address of instruction following +the next instruction.
    +Example: +
     lda #40
    + add:sta $80
    + scc:inc $81
    +
    +In the above example word variable $80 is incremented by 40.
    +Nor conditional repeat nor skip pseudo-commands require operand, +thus they can be paired with any other command.

    + +

    JCC, JCS, JEQ, JMI, JNE, JPL, JVC, JVS - conditional jumps +
    They are a kind of 'long' branches. While standard branches +(BNE, BEQ) have range of -128..+127, these jumps have range +of all 64 kB.
    +Example: +
     jne dest
    +
    is equivalent to: +
     seq:jmp dest
    +
    + +
    INW - increment word +
    It is a 16-bit memory increment command.
    +Example: +
     inw dest
    +
    is equivalent to: +
     inc dest
    + sne:inc dest+1
    +
    + +
    MVA, MVX, MVY - move byte using accumulator, X or Y +
    Any of these pseudo-commands requires two operands +and substitutes two commands: +
     mva source dest = lda source : sta dest
    + mvx source dest = ldx source : stx dest
    + mvy source dest = ldy source : sty dest
    +
    + +
    MWA, MWX, MWY - move word using accumulator, X or Y +
    They also require two operands +and are combinations of two MV*'s: +one to move low byte, and the other to move high byte.
    +You can't use indirect nor pseudo addressing modes with MW*. +Destination must be absolute address (indexed or not).
    +When source is also absolute, a MW* SOURCE DEST will be: +
     mv* source   dest
    + mv* source+1 dest+1
    +
    +When source is immediate, a MW* #IMMED DEST will be: +
     mv* <immed dest
    + mv* >immed dest+1
    +
    +When <immed equals >immed and immed +is not forward-referenced, X-Asm uses optimization: +
     mv* <immed dest
    + st* dest+1
    +
    +
    +
+ +

Operand

+It depends on the operation field. Some statements don't need any operand, +other need two operands.

+ +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 +@ character (as in Quick Assembler).

+ +There are two extra immediate addressing modes: +< and >, +which use low/high byte of word rather than byte value.

+ +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 a: and z: prefixes.

+ +Examples: +

+ nop
+ asl @
+ lda >$1234	assembles to lda #$12
+ lda $100,x
+ lda a:0	generates 16-bit address
+ jmp ($0a)
+ lda ($80),y
+
+ +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 +MWA, MWX and MWY only: +
 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
+ cmd (z),0+  =  ldy #0    : cmd (z),y : iny
+ cmd (z),0-  =  ldy #0    : cmd (z),y : dey
+
+ +

Comment

+Comment in a statement does not start from any special character +like ; for example. Comment field is implied when appropriate +number of operands was taken.

+ +


+

INTRODUCTIONUSAGESYNTAX + FAQ + BACK +

+
    +
  • Q: Why does X-Asm ignore +2 in following line? +
    label equ 1 +2
    +
    +A: X-Asm treats space as operand terminator. Remaining part of line +is a comment. You should write 1+2 without any spaces.

    + +

  • Q: Why does lda #<table not work?

    +A: < and > represent addressing modes +rather than LOW and HIGH operators.
    +You specify lda <table, not lda #<table +like in most 6502 assemblers.

    + +

  • Q: What's wrong with asl a ?

    +A: You should use @ for accumulator addressing mode.

    + +

  • Q: What's wrong in following line? +
    label: lda #0
    +
    +A: Label definition can not include a colon.

    + +

  • Q: I wrote end start, where start points +to program beginning, but program seems not to start there. Why?

    +A: You should have explicit run address specified. +Use run start directive. end takes no operand.

    + +

  • Q: Why this construction does not work: +
    three equ one+two
    +two   equ one+one
    +one   equ 1
    +
    +while this does: +
    +two   equ one+one
    +one   equ 1
    +
    +A: X-Asm reads source twice (in pass 1 and pass 2) +from the beginning until the end.
    +This allows forward references, but not too complex.
    +Keep in mind that assembler should know all the values in second pass.

    +Example: +

    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
    +
    +These values can be fixed in two passes.
    +If you insert following statement as first line: +
    three equ one+two
    +
    +X-Asm will generate an error because it can't fix +the value of three in second pass.

    + +

  • Q: X-Asm displayed single error while assembling my program. +When I fixed it, another error appeared. Why?

    +A: X-Asm displays only first error.
    +When you were assembling for the first time, both errors might exist, +but X-Asm stopped assembling on the first one.

    + +

  • If you have other questions/problems, +write to me. +
+ + \ No newline at end of file diff --git a/doc/xboot.htm b/doc/xboot.htm new file mode 100644 index 0000000..8c590ea --- /dev/null +++ b/doc/xboot.htm @@ -0,0 +1,68 @@ + + +X-BOOT 4.0 Manual + + +
+

X-BOOT version 4.0

+by Fox/Taquart

+


+
+ +

INTRODUCTION

+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 X-LOAD. +

CHANGES

+

Version 4.0

+
    +
  • wildcards support - now you can convert a set of files +
  • .ATR name not required - name can be taken from executable +
  • no length limit - files longer than 60k allowed +
  • truncated executables handling +
  • checking for memory conflicts +
  • better errors handling +
+

Version 3.2

+
    +
  • .OBX is default extension of Atari executable +
+

Version 3.1

+
    +
  • first release +
+ +
+

USAGE

+There are two ways of running X-BOOT: +
    +
  • XBOOT [/p] obxfile [atrfile] +
  • XBOOT [/p] obxfiles [atrpath] +
+The former converts single file, the latter a set of files.

+Parameters in brackets are optional.

+/p 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.

+Both loaders disable Atari Basic, so you needn't hold OPTION key while +booting.

+ +


+

DETAILS

+Produced ATR is single density and as short as possible. +Loader occupies one boot sector.

+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.

+For more details, view sources of loaders: +

+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. + + \ No newline at end of file diff --git a/doc/xbootpro.asx b/doc/xbootpro.asx new file mode 100644 index 0000000..cafce0d --- /dev/null +++ b/doc/xbootpro.asx @@ -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 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 \ No newline at end of file diff --git a/doc/xbootstd.asx b/doc/xbootstd.asx new file mode 100644 index 0000000..d5e4309 --- /dev/null +++ b/doc/xbootstd.asx @@ -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 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 \ No newline at end of file diff --git a/doc/xhead.htm b/doc/xhead.htm new file mode 100644 index 0000000..6cc855f --- /dev/null +++ b/doc/xhead.htm @@ -0,0 +1,42 @@ + + +X-HEAD 1.1 Manual + + +
+

X-HEAD version 1.1

+by Fox/Taquart

+


+
+ +

INTRODUCTION

+This tool prints headers of Atari executable. +You can examine which memory locations file loads into. +X-HEAD also shows init and run addresses. +

CHANGES

+

Version 1.1

+
    +
  • .OBX is default extension of Atari executable +
+

Version 1.0

+
    +
  • first release +
+ +
+

USAGE

+Simply run X-HEAD with executable filename. No options are supported yet.

+X-HEAD will read the file and display its headers in following format: +

 bbbb-eeee xxxx
+where bbbb is the begin, eeee - the end of the block, +and xxxx is the execution address (init or run vector).

+The summary includes:
+xxxx bytes - length of file, including headers
+xxxx blocks - number of headers
+xxxx inits - number of init blocks (02e2-02e3)
+xxxx modules - number of FFFF headers (one at the beginning is required)

+All displayed numbers are hexadecimal, of course.

+You can redirect output to a file, for example: +

XHEAD TEST >TEST.HDR
+
+
\ No newline at end of file
diff --git a/doc/xload.htm b/doc/xload.htm
new file mode 100644
index 0000000..8f2c4ba
--- /dev/null
+++ b/doc/xload.htm
@@ -0,0 +1,81 @@
+
+
+X-LOAD 1.0 Manual
+
+
+
+

X-LOAD version 1.0

+by Fox/Taquart

+


+
+ +

INTRODUCTION

+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.

+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).

+

CHANGES

+

Version 1.0

+
    +
  • first release +
+ +
+

USAGE

+You run X-LOAD from DOS prompt with executable filename and optional +options:

+

+
/1 - /4 +
Specify COM port number, which interface is attached to. +Default is COM2.

+

/p +
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.

+

+After you run X-LOAD, you only have to boot your Atari and the program +will be loaded and run.

+While loading, you can watch on your PC memory locations, which program +loads to.

+After program was loaded and run, X-LOAD terminates. You may exit it +earlier at any time by pressing ESC key.

+ +


+

DETAILS

+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.

+While booting, X-LOAD accepts two commands for disk drive 1:

+

    +
  • 'S' - read status. Used for checking presence of disk drive. +
  • 'R' - read sector (only first). Used for reading boot program. +
+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.

+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: +

+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. + + \ No newline at end of file diff --git a/doc/xloadpro.asx b/doc/xloadpro.asx new file mode 100644 index 0000000..c86a7e4 --- /dev/null +++ b/doc/xloadpro.asx @@ -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 \ No newline at end of file diff --git a/doc/xloadstd.asx b/doc/xloadstd.asx new file mode 100644 index 0000000..258e18d --- /dev/null +++ b/doc/xloadstd.asx @@ -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 \ No newline at end of file diff --git a/file_id.diz b/file_id.diz deleted file mode 100644 index 3c4a8f1..0000000 --- a/file_id.diz +++ /dev/null @@ -1,7 +0,0 @@ - \/ - /\ - Assembler 2.0 --------------------------- - by Fox/Taquart --------------------------- -8-bit Atari 6502 assembler - for PC 386+ / MS-DOS \ No newline at end of file diff --git a/hardware.asx b/hardware.asx deleted file mode 100644 index e042fd1..0000000 --- a/hardware.asx +++ /dev/null @@ -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 \ No newline at end of file diff --git a/quickref.txt b/quickref.txt deleted file mode 100644 index 2bf338c..0000000 --- a/quickref.txt +++ /dev/null @@ -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 - -=== diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 0c539bd..0000000 --- a/readme.txt +++ /dev/null @@ -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 - -=== diff --git a/xasm.htm b/xasm.htm deleted file mode 100644 index 3eabe95..0000000 --- a/xasm.htm +++ /dev/null @@ -1,509 +0,0 @@ - - -X-Assembler 2.0 Manual - - -
-

X-Assembler version 2.0

-coded by Fox/Taquart -
-
-

INTRODUCTION

-The X-Assembler is an assembler, which generates code for the 6502 processor. -It is 99% compatible with Quick Assembler on 8-bit Atari. -
-

System requirements

-
    -
  • a PC compatible computer with 386 or better CPU -
  • a MS-DOS compatible OS -
  • a numeric coprocessor for generating sinus tables. - Your CPU probably has a built-in coprocessor. -
-
-

Creating a source program

-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. -
-

Converting Quick Assembler files

-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.
-You also have to change all OPT directives, but usually you needn't them -at all. -
-

Assembling a source program

-Syntax (parameters in brackets are optional):
-
XASM source [options]
-
'source' is name of source file. -If no extension given, the .ASX is added by default.

-Options are: -

-
/c -
Enable listing false conditionals. -
/i -
Disable listing included source. -
/l[:fname] -
Enable generating listing. If no fname given, listing is written to source.lst. -
/o:fname -
Specify object name. Default is source.obx. -
/s -
Disable converting spaces to tabs. Using tabs makes listing file shorter.
-Tab stops are assumed to be every 8 characters. -
/t[:fname] -
List label table. If no fname given, table is written at the end of listing. -
- -If source is incorrect, X-Asm displays ONLY FIRST encountered error.

- -Errorlevels returned by X-Asm:
-3 = bad parameters, assembling not started
-2 = error occured
-1 = warning(s) only
-0 = no errors, no warnings
- -

Listing structure

-Line of listing includes: -
    -
  • decimal number of line of source file (if source is different than in -previous listed line, appropriate message line is generated) -
  • hexadecimal origin -
  • hexadecimal bytes written to object file -Listed are also generated headers. A xxxx-yyyy> in place of origin is -a generated header: $xxxx is the first and $yyyy is the last byte of block. -A FFFF> represents two $ff bytes written as a header prefix.

    -A plus sign placed after hex numbers stands for more bytes written to object -in this line, not listed through lack of space. -

  • remaining part of listing line is a copy of source -
- -

Label table structure

-Line of label table includes: -
    -
  • some info of label:
    - n - label not used
    - 2 - label value known in pass 2 only (label definition uses forward reference - and thus you can't do forward references to that label) -
  • hex value of label -
  • name of label -
- -
-

X-ASM LANGUAGE STRUCTURE

-Lines of source code may be: -
    -
  • empty lines - ignored, of course -
  • comments - ignored, too -
  • statements - not ignored :-) -
-Comment lines must have one of the following characters in the FIRST column -of the line: * ; | - -

Numbers

-Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff. -A number can be: -
    -
  • a decimal number -12345 -
  • a hexadedecimal number $abcd -
  • a binary number %10100101 -
  • a character 'a' or "a" (new in 2.0!) -
  • a hardware register ^31 -
  • an origin counter * -
-I think only 'a hardware register' should be explained. It is a short way -of accessing Atari hardware registers:

-^0x means $d00x
-^1x means $d01x
-^2x means $d20x
-^3x means $d30x
-^4x means $d40x
-where x is a hexadecimal digit. - -

Expressions

-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:

- -+ Addition
-- Subtraction
-* Multiplication
-/ Division
-% Remainder
-& Bitwise and
-| Bitwise or
-^ Bitwise xor
-<< Arithmetic shift left
->> Arithmetic shift right
-= Equal
-<> Not equal
-!= Not equal (same as <>)
-< Less than
-> Greater than
-<= Less or equal
->= Greater or equal
-&& Logical and
-|| Logical or

- -Operator precedence: -

-first  []
-       * / % & << >>
-       + - | ^
-       = <> != < > <= >=
-       &&
-last   ||
-
-Compare and logical operators assume that zero is false and non-zero is true. -They return -1 for true.

-When calculating expression, 32-bit arithmetic is used. When range of 32 bits -is exceeded, 'Arithmetic overflow' error is generated.

-If result of expression has improper size, 'Value out of range' error occurs.

-Note difference beetwen X-Asm 2.0 and QAsm/X-Asm 1.2: in older assemblers, -which used 16-bit arithmetic, a LDA 0-1 was correct (LDA $ffff), but X-Asm 2.0 -encounters an error: address can't be negative.

-X-Asm recognizes now signed bytes: LDA #-1 is OK. - -

Statements

-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. - -

Label field

-This field is optional. It is required only by the EQU directive. -Specyfying this field definies a label. Defined label represents an integer -of range -$ffff..$ffff.

-Name of label must begin in column 1 and can contain letters, digits -and underscores (_). Digit can't be label's first character. Name of 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 well under X-Asm for this reason.

-Defining a label without using EQU makes it equal to current value -of the origin counter. Label can't be redefined. - -

Operation field

-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: -
    -
  1. a 6502 processor command -
  2. a compiler directive -
  3. a pseudo-command -
-
    -
  1. 6502 command
    -One of 56 well known processor commands.

    - -
  2. compiler directive
    -One of the following: -
    -
    EQU - assign a value of expression to the label -
    Note that label represents a number, not a text macro.

    -Examples: -

    five equ 5
    -ten  equ five+five
    -
    - -
    OPT - set assembling options -
    Currently there are two options: listing generating and headers generating. -You can turn any of these on or off.

    -Examples: -

     opt l-    listing off
    - opt h-    headers off
    - opt l+h-  listing on, headers off
    -
    -Remember not to put a space between options: -
     opt l+ h-
    -
    -is actually -
     opt l+
    -
    -because h- is a comment.

    -Default (if no opt specified) is opt l+h+.

    - -

    ORG - set new origin counter -
    Examples: -
     org $600         code will be located starting from $0600
    -table org *+100   'table' points to 100 bytes of uninitialized data
    -
    -New! You can set some options applied to new header (if headers are on): -
     org $600
    - rts
    - org a:$601
    -
    -'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. -
     org f:$700
    -
    -'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.

    - -

    DTA - define data -
    You may define: -
      -
    • numbers -
        -
      • bytes: b(200) -
      • words: a(10000) -
      • low bytes of words: l(511) defines byte 255 -
      • high bytes of words: h(511) defines byte 1 - You may enter many expressions in parentheses and combine different types - of data in single line.

        - You may also define a sinus table. Enter this expression:
        - sin(centre,amp,size,first,last)
        - where: -

          -
        • centre is a number which is added to every value of sinus -
        • amp is the amplitude of sinus -
        • size is the period of sinus -
        • first,last define range of values in the table. - They are optional. Default are 0,size-1. -
        - Example: dta a(sin(0,1000,256,0,63)) defines table of 64 words representing - a quarter of sinus with amplitude of 1000. -
      • real numbers: r(-1.23456e12)
        - Real numbers are written in 6-byte Atari Floating-Point format. You can't - combine reals with operators, as you can integers.

        -

      -
    • text strings -
        -
      • ASCII strings: c'Text' or c"Text" -
      • ANTIC strings: d'Text' or d"It's something new!" -
      - 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.

      - Placing a '*' character after a string inverts bit 7 in every byte of string.

      -

    -Examples of DTA: -
    - dta b(2,5),a(1000,-1),l(12345,sin(0,127,256))
    - dta d"ANTIC"*,c'It''s a string',b(155)
    -
    - -
    ICL - include another source file -
    Specifies another file to be included in the assembly as if the contests of -the referenced file appeared in place of the ICL statement. The included file -may contain other ICL statements.

    -Examples: -

    - icl 'macros.asx'
    - icl 'c:\atari\xasm\fileio.asx'
    -
    - -
    END - end assembling of file -
    Remaining part of the file is not assembled. If this statement does not occur, -assembler stops assembling when encounters end of file.
    -Example: -
    - end
    -
    - -
    INS - insert contents of file -
    Copies every byte of specified file into object file and moves origin counter, -as if these bytes were defined with DTA.

    -Examples: -

    - ins 'picture.raw'
    - ins 'tables.dat'
    -
    -New! You may specify range of inserted file. Syntax is: -
    - ins 'file'[,offset[,length]]
    -
    -First byte in file has offset 0.

    -If offset is negative, it is counted from the end of file. -

    - ins 'file',-256   inserts last 256 bytes of file
    - ins 'file',10,10  inserts bytes 10..19 of file
    -
    - -
    RUN - generate run address -
    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. -
     run addr
    -
    -is equivalent to: -
     org $2e0
    - dta a(addr)
    -
    -Examples: -
     run start
    - run program
    -
    - -
    INI - generate init address -
    The Atari executable program may have some routines which are executed during -loading process. There may be many init blocks in one file. -Examples: -
     ini init
    - ini showpic
    -
    - -
    ERT - generate error if expression is true -
    Examples: -
     ert *>$c000
    - ert len1>$ff||len2>$ff
    -
    - -
    IFT - assemble if expression is true
    -ELS - else
    -EIF - end if
    -
    Example: -
    noscr equ 1
    - ift noscr
    - lda #0
    - els
    - lda #$22
    - eif
    - sta $22f
    -
    - -
    -
  3. pseudo-command
    -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. -
    -
    ADD - addition without carry -
    If you ever programmed 6502, you must have noticed that you had to use a CLC -before ADC for every simple addition.
    -X-Asm can do it for you. ADD simply replaces two instructions: CLC and ADC.

    - -

    SUB - subtraction -
    It is SEC and SBC.

    - -

    JNE, JEQ, JCC, JCS, JPL, JMI, JVC, JVS - conditional jumps -
    They are a kind of 'long' branches. While standard branches (BNE, BEQ) have -range of -128..+127, these jumps have range of all 64 kB.

    -For example: a JNE DEST is replaced with: -

     beq *+5
    - jmp dest
    -
    - -
    INW - increment word -
    It is a 16-bit memory increment command. An INW DEST will be replaced by: -
     inc dest
    - bne _skip
    - inc dest+1
    -_skip equ *
    -
    -The _skip label is not declared of course.

    - -

    MVA, MVX, MVY - move byte using accumulator, X or Y -
    These pseudo-commands require two operands. -
     mva source dest = lda source : sta dest
    - mvx source dest = ldx source : stx dest
    - mvy source dest = ldy source : sty dest
    -
    - -
    MWA, MWX, MWY - move word using accumulator, X or Y -
    Also require two operands. They are something like combination of two MV*'s: -one to move low byte, and the other to move high byte.

    -You can't use indirect nor pseudo addressing modes with MW*.

    -Destination must be absolute address (indexed or not).

    -When source is also absolute, a MW* SOURCE DEST will be: -

     mv* source   dest
    - mv* source+1 dest+1
    -
    -When source is immediate, a MW* #IMMED dest will be -
     mv* <immed dest
    - mv* >immed dest+1
    -
    -but when <IMMED = >IMMED and IMMED is not forward-referenced, -X-Asm uses optimization: -
     mv* <immed dest
    - st* dest+1
    -
    -
    -
- -

Operand

-It depends on the operation field. Some statements don't need an operand -or need two operands.

- -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 @ character -(as in Quick Assembler).

- -There are two extra immediate addressing modes: < and >, which use low/high -byte of word is used rather than byte value.

- -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 a: and z: prefixes.

- -Examples: -

- nop
- asl @
- lda >$1234	assembles to lda #$12
- lda $100,x
- lda a:0	generates 16-bit address
- jmp ($0a)
- lda ($80),y
-
- -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 MW*: -
 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
-
-

Problems

-These notes may help you solve problems: -
    -
  • No spaces are allowed within a field. -
    label equ 1 + 2
    -
    -causes label to be equal 1 (+ 2 is treated as a comment).

    - -

  • < and > represent addressing modes rather than LOW and HIGH operators.

    -You specify lda <table, not lda #<table like in most 6502 assemblers.

    - -

  • Label definition does not include a colon -
    label: lda ^4b     ERROR - colon after label name
    -
    - -
  • Exactly one run address should be specified

    -Remember that unlike in other assemblers -

     end start
    -
    -does not tell the assembler that start is the run address (it is a comment). -You must specify the run address with RUN directive.

    - -

  • X-Asm reads source twice (in pass 1 and pass 2)
    -This allows forward references, but not too complex.

    -Keep in mind that assembler should know all the values in second pass.

    -Example: -

    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
    -
    -These values can be fixed in 2 passes.

    -But if you insert following statement as first line: -

    three equ one+two
    -
    -X-Asm will generate an error because it doesn't know the value of three in -second pass.
    -(sorry for v1.2 users: EQU forward reference didn't work at all).

    - -

  • X-Asm displays only first error
    -When you correct one error don't be surpised if you get another one.

    - -

  • If you encounter X-Asm works improperly, please let me know. -
- - \ No newline at end of file diff --git a/xboot.txt b/xboot.txt deleted file mode 100644 index 34cc9ce..0000000 --- a/xboot.txt +++ /dev/null @@ -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. - -=== diff --git a/xbootpro.asx b/xbootpro.asx deleted file mode 100644 index bf390f7..0000000 --- a/xbootpro.asx +++ /dev/null @@ -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 \ No newline at end of file diff --git a/xbootstd.asx b/xbootstd.asx deleted file mode 100644 index b51d8db..0000000 --- a/xbootstd.asx +++ /dev/null @@ -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 \ No newline at end of file diff --git a/xhead.txt b/xhead.txt deleted file mode 100644 index 1b48771..0000000 --- a/xhead.txt +++ /dev/null @@ -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 - -=== \ No newline at end of file