diff --git a/atari.pal b/atari.pal
deleted file mode 100644
index c22f5bc..0000000
Binary files a/atari.pal and /dev/null differ
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 0000000..bfa3cc0
Binary files /dev/null and b/doc/6502proc.gif differ
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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+COLPF0 COLPF1 COLPF2 COLPF3
+- Colors of player field
+
+COLPM0 COLPM1 COLPM2 COLPM3
+- Colors of players and missiles
+
+CONSOL
+- Consol keys
+
+GRAFM
+- Graphics of missiles
+
+GRAFP0 GRAFP1 GRAFP2 GRAFP3
+- Graphics of players
+
+GTIACTL
+- GTIA control
+
+HITCLR
+- Clear collision registers
+
+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
+
+KOLM0PF KOLM1PF KOLM2PF KOLM3PF
+- Collisions of missiles with playfield
+
+KOLP0P KOLP1P KOLP2P KOLP3P
+- Collisions of players with players
+
+KOLP0PF KOLP1PF KOLP2PF KOLP3PF
+- Collisions of players with playfield
+
+PAL
+- PAL system flag
+
+PMCTL
+- Player/Missile Control
+
+SIZEM
+- Sizes of missiles
+
+SIZEP0 SIZEP1 SIZEP2 SIZEP3
+- Sizes of players
+
+TRIG0 TRIG1 TRIG3
+- Triggers
+
+VDELAY
+- Vertical delay of players and missiles
+
+
+
\ 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 @@
+
+
+
+Manuals of utilities:
+
+
+Atari XL/XE documentation (under construction):
+
+
+All programs are freeware. Copyright (c) Taquart 1999.
+
+
+Optional options are:
+
+
+Errorlevels returned by X-Asm:
+
+
+
+
+Operator precedence:
+
+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.
+
+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
+
+
+
+
+USAGE
+You can run GR0 without any parameters to see available options. They are:
+
+
+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
+by Fox/Taquart
+Registers
+
+
+
+ Address Read register Write register
+ Address Read register Write register
+
+ ^00 KOLM0PF HPOSP0
+^10 TRIG0 GRAFP3
+
+ ^01 KOLM1PF HPOSP1
+^11 TRIG1 GRAFPM
+
+ ^02 KOLM2PF HPOSP2
+^12 unused COLPM0
+
+ ^03 KOLM3PF HPOSP3
+^13 TRIG3 COLPM1
+
+ ^04 KOLP0PF HPOSM0
+^14 PAL COLPM2
+
+ ^05 KOLP1PF HPOSM1
+^15 unused COLPM3
+
+ ^06 KOLP2PF HPOSM2
+^16 unused COLPF0
+
+ ^07 KOLP3PF HPOSM3
+^17 unused COLPF1
+
+ ^08 KOLM0P SIZEP0
+^18 unused COLPF2
+
+ ^09 KOLM1P SIZEP1
+^19 unused COLPF3
+
+ ^0A KOLM2P SIZEP2
+^1A unused COLBAK
+
+ ^0B KOLM3P SIZEP3
+^1B unused GTIACTL
+
+ ^0C KOLP0P SIZEM
+^1C unused VDELAY
+
+ ^0D KOLP1P GRAFP0
+^1D unused PMCNTL
+
+ ^0E KOLP2P GRAFP1
+^1E unused HITCLR
+
+
+^0F KOLP3P GRAFP2
+^1F CONSOL CONSOL
+
+Description
+
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue
+bit 0 - unused
+bits 3-1 - luminace
+bits 7-4 - hue
+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)
+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
+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
+Any value written to this register causes collision registers to be reset.
+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)
+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)
+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)
+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)
+bit 0 - unused
+bits 1-3 - 000 if TV system is PAL. Else it is NTSC
+bits 4-7 - unused (=0)
+bit 0 - get missiles data from ANTIC
+bit 1 - get players data from ANTIC
+bit 2 - lock triggers when pressed
+bits 3-7 - unused
+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
+bits 1,0 - size of player (see SIZEM)
+bits 2-7 - unused
+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)
+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 3X-ASM Package version 2.2
+by Fox/Taquart
+
+
+
+X-Assembler 6502 cross-assembler
+X-BOOT Atari executable -> disk image converter
+X-HEAD Simple Atari executable analyzer
+X-LOAD SIO2PC interface Atari executable loader
+GR0 DOS screen adjuster
+
+
+
+GTIA GTIA chip documentation CPUBUGS.ASX 6502 bugs detector source
+
+X-Assembler version 2.2
+by Fox/TaquartINTRODUCTION
+ USAGE
+ SYNTAX
+ FAQ
+ BACK
+
+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
+
+
+Version 1.2
+
+
+
+INTRODUCTION
+ USAGE
+ SYNTAX
+ FAQ
+ BACK
+
+
+System requirements
+
+
+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.
+
+
+If source is incorrect, X-Asm stops on first encountered error.
+By default lines skipped because of false condition are not listed.
+3 = bad parameters, assembling not started
+2 = error occured
+1 = warning(s) only
+0 = no errors, no warnings
+
+Listing structure
+Line of listing includes:
+
+
+
+
+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.
+Label table structure
+Line of label table includes:
+
+
+
+
+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)
+INTRODUCTION
+ USAGE
+ SYNTAX
+ FAQ
+ BACK
+
+Lines of source code may be:
+
+
+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:
+
+
+
+-12345
+$abcd
+%10100101
+'a' or "a"
+*
+^31
+^0x means $d00x
+^1x means $d01x
+^2x means $d20x
+^3x means $d30x
+^4x means $d40x
+where x is a hexadecimal digit.
+
+
+
+{lda #0} 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
+
+
+first []
+ * / % & << >>
+ + - | ^
+ = <> != < > <= >=
+ &&
+last || 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.
+
+
+ + +
adc:sta $80 +is equivalent to +
adc $80 + sta $80 ++Single instruction always consists of 3 letters. It can be: +
+
five equ 5 +here equ * ++ +
opt l- listing off + opt h- headers off + opt l+h- listing on, headers off ++ +
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 b(2,5),a(1000,-1),l(12345,sin(0,127,256)) + dta d"ANTIC"*,c'It''s a string',b(155) ++ +
+Examples: +
+ icl 'macros.asx' + icl 'c:\atari\xasm\fileio' ++ +
+ end ++ +
+ ins 'file'[,offset[,length]] ++First byte in file has offset 0.
+ ins 'picture.raw' + ins 'file',-256 insert last 256 bytes of file + ins 'file',10,10 insert bytes 10..19 of file ++ +
run addr ++is equivalent to: +
org $2e0 + dta a(addr) ++Examples: +
run start + run program ++ +
ini init + ini showpic ++ +
ert *>$c000 + ert len1>$ff||len2>$ff ++ +
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 ++ +
+
+ +
+ +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 ++ +
+ +
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.
+ +
+A: < and > represent addressing modes
+rather than LOW and HIGH operators.
+You specify lda <table, not lda #<table
+like in most 6502 assemblers.
+ +
+A: You should use @ for accumulator addressing mode.
+ +
label: lda #0 ++A: Label definition can not include a colon.
+ +
+A: You should have explicit run address specified. +Use run start directive. end takes no operand.
+ +
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.
+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.
three equ one+two ++X-Asm will generate an error because it can't fix +the value of three in second pass.
+ +
+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.
+ +
+
+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.
+ +
+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: +
+
+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
+
+
+
+
+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.
+ +
+While booting, X-LOAD accepts two commands for disk drive 1:
+
+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: +
XASM source [options] -'source' is name of source file. -If no extension given, the .ASX is added by default.
-Options are: -
-
-Errorlevels returned by X-Asm:
-3 = bad parameters, assembling not started
-2 = error occured
-1 = warning(s) only
-0 = no errors, no warnings
-
-
-A plus sign placed after hex numbers stands for more bytes written to object -in this line, not listed through lack of space. -
-^0x means $d00x
-^1x means $d01x
-^2x means $d20x
-^3x means $d30x
-^4x means $d40x
-where x is a hexadecimal digit.
-
-
-
-+ 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. - -
-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. - -
-Examples: -
five equ 5 -ten equ five+five -- -
-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 $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.
- -
- You may also define a sinus table. Enter this expression:
- sin(centre,amp,size,first,last)
- where:
-
-
- Placing a '*' character after a string inverts bit 7 in every byte of string.
-
- dta b(2,5),a(1000,-1),l(12345,sin(0,127,256)) - dta d"ANTIC"*,c'It''s a string',b(155) -- -
-Examples: -
- icl 'macros.asx' - icl 'c:\atari\xasm\fileio.asx' -- -
- end -- -
-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 addr --is equivalent to: -
org $2e0 - dta a(addr) --Examples: -
run start - run program -- -
ini init - ini showpic -- -
ert *>$c000 - ert len1>$ff||len2>$ff -- -
noscr equ 1 - ift noscr - lda #0 - els - lda #$22 - eif - sta $22f -- -
- -
- -
-For example: a JNE DEST is replaced with: -
beq *+5 - jmp dest -- -
inc dest - bne _skip - inc dest+1 -_skip equ * --The _skip label is not declared of course.
- -
mva source dest = lda source : sta dest - mvx source dest = ldx source : stx dest - mvy source dest = ldy source : sty dest -- -
-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 --
- -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 --
label equ 1 + 2 --causes label to be equal 1 (+ 2 is treated as a comment).
- -
-You specify lda <table, not lda #<table like in most 6502 assemblers.
- -
label: lda ^4b ERROR - colon after label name -- -
-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.
- -
-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.
- -
- -