From 4102fd8bb04044138a7989f4a25992fff750b421 Mon Sep 17 00:00:00 2001
From: Piotr Fusik
+
+
+
+
+
+CHRCTL
+- Characters control
+
+DLPTRL DLPTRH
+- Display List pointer
+
+DMACTL
+- DMA control
+
+HSCROL
+- Horizontal scroll
+
+LPENH
+- Light pen horizontal position
+
+LPENV
+- Light pen vertical position
+
+NMIEN
+- NMI enable
+
+NMIST
+- NMI status
+
+PMBASE
+- Player/missile base
+
+VCOUNT
+- Vertical count
+
+VSCROL
+- Vertial scroll
+
+WSYNC
+- Wait for synchronization
+
+
+
\ No newline at end of file
diff --git a/doc/atari.gif b/doc/atari.gif
new file mode 100644
index 0000000000000000000000000000000000000000..d542d807f9bb94691784224664db2a5fb495f28e
GIT binary patch
literal 372
zcmV-)0gL`eNk%w1VNd{20FeLy|NsB^`1k+-00000EC2ui08ju>00092gpaAq?GK}z
zwAzca-n{z{hT=$;=82~2%C_zj#4#Y(0bRe9joUY`oA7)yU@$Ty_GU+9j`+(pAxYoz
zHhomL*ldF
@@ -63,9 +63,299 @@ by Fox/Taquart
-
+
+
- Consol keys
@@ -22,12 +22,18 @@ Manuals of utilities:
Atari XL/XE documentation (under construction):
-All programs are freeware. Copyright (c) Taquart 1999.
+Visit X-ASM Homepage:
+http://www.6502.org/users/fox/xasm
+
+All programs and documentation are freeware. Copyright (c) 1998-2000 Taquart.
+
+
+
+
+
+PORTA
+- Port B
+
+PACTL
+- Port A Control
+
+PBCTL
+- Port B Control
+
+
+
\ No newline at end of file
diff --git a/doc/pokey.htm b/doc/pokey.htm
new file mode 100644
index 0000000..1e09ec0
--- /dev/null
+++ b/doc/pokey.htm
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+AUDCTL
+- Audio control
+
+AUDF1 AUDF2 AUDF3 AUDF4
+- Audio frequency
+
+IRQEN
+- IRQ enable
+
+IRQST
+- IRQ status
+
+KBCODE
+- Keyboard code
+
+POT0 POT1 POT2 POT3
+- Potentiometrs
+
+POTGO
+- Potentiometr goes
+
+POTST
+- Potentiometrs status
+
+RANDOM
+- Random
+
+SERIN
+- Serial input
+
+SEROUT
+- Serial output
+
+SKCTL
+- Serial and keyboard control
+
+SKSTAT
+- Serial and keyboard status
+
+SKSTRES
+- SKSTAT reset
+
+STIMER
+- Start timers
+
+
+
\ No newline at end of file
diff --git a/doc/xasm.htm b/doc/xasm.htm
index f69d2df..41d22cd 100644
--- a/doc/xasm.htm
+++ b/doc/xasm.htm
@@ -1,25 +1,61 @@
-
-
-
-Optional options are:
+source is the name of source file.
+If no extension is given, the .ASX is implied.
+Default action on invoking without options is to compile
+writing to a file with the .OBX extension.
+
+By default lines skipped due to false condition are not listed.
-
-Errorlevels returned by X-Asm:
+There are following types of fields:
+
+In the latter form, you must use a minimum of an instruction field.
+It depends on the instruction, how many operands it takes.
+Every instruction takes constant number of operands, therefore
+there's no need to use a special character at the start of a comment, because after
+succesfully taking operands, X-Asm discards the remaining part of line.
+
+
+
+
+Single instruction always consists of 3 letters. It can be:
+
+
+
+
+
+
-
-Operator precedence:
+
+
+Operator precedence:
+
+Operators are similar to used in C language, but their priorities are different
+than in C.
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
+While calculating expression, signed 32-bit arithmetic is used. When range of 32 bits
is exceeded, 'Arithmetic overflow' error is generated.
-ANTIC Documentation
+by Fox/Taquart
+Registers
+
+
+
+ Address Read register Write register
+^40 unused DMACTL
+^41 unused CHRCTL
+^42 unused DLPTRL
+^43 unused DLPTRH
+^44 unused HSCROL
+^45 unused VSCROL
+^46 unused unused
+^47 unused PMBASE
+^48 unused unused
+^49 unused CHBASE
+^4A unused WSYNC
+^4B VCOUNT unused
+^4C LPENH unused
+^4D LPENV unused
+^4E unused NMIEN
+^4F NMIST unused
+Description
+
+Contains high byte of character set in text modes.
+bit 0 - display characters 128-255 as spaces
+bit 1 - display characters 128-255 as inverse
+bit 2 - display all characters upside down
+bits 1,0 - width of screen
+00 - screen off
+01 - narrow screen - 256 pixels
+10 - normal screen - 320 pixels
+11 - wide screen - 384 pixels
+bits 3,2 - DMA for Players/Missiles
+00 - no DMA for P/MG
+01 - DMA for missiles
+10 - DMA for players and missiles
+11 - DMA for players and missiles
+bit 4 - P/MG resolution
+0 - 120 lines
+1 - 240 lines
+bit 5 - DMA for Display List
+bits 7-6 - unused
+bits 5-0 - unused
+bit 6 - enable VBLKI
+bit 7 - enable DLI
+bits 5-0 - unused
+bit 6 - VBLKI occured
+bit 7 - DLI occured
+High byte of P/MG data
+Contains number of scanline divided by 2.
+Any value written to this register stops CPU until right border of normal screen is reached.GTIA Documentation
by Fox/Taquart^1F CONSOL CONSOL
-
-Colors
+
+
+ 0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+A
+B
+C
+D
+E
+F
+0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 7
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 9
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ B
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ D
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ E
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ F
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
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.
+with state of consol keys. Reset bit means key pressed.
bit 0 - START key
bit 1 - SELECT key
bit 2 - OPTION key
diff --git a/doc/index.htm b/doc/index.htm
index f1df23b..8fa1044 100644
--- a/doc/index.htm
+++ b/doc/index.htm
@@ -1,10 +1,10 @@
X-ASM Package version 2.2
+X-ASM Package version 2.3
by Fox/Taquart
+GTIA GTIA chip documentation
+POKEY POKEY chip documentation
+PIA PIA chip documentation ANTIC ANTIC chip documentation CPUBUGS.ASX 6502 bugs detector source
PIA Documentation
+by Fox/Taquart
+Registers
+
+
+
+ Address Read/Write register
+^30 PORTA
+^31 PORTB
+^32 PACTL
+^33 PBCTL
+Description
+
+A bit is RESET on an event
+bit 0 - joystick 0 up
+bit 1 - joystick 0 down
+bit 2 - joystick 0 left / paddle 0 button
+bit 3 - joystick 0 right / paddle 1 button
+bit 4 - joystick 1 up
+bit 5 - joystick 1 down
+bit 6 - joystick 1 left / paddle 0 button
+bit 7 - joystick 1 right / paddle 1 button
+Controls memory.
+bit 0 - $c000-$cfff and $d800-$ffff:
+0 - RAM
+1 - OS ROM
+bit 1 - $a000-$bfff:
+0 - BASIC ROM
+1 - RAM
+bits 6-2 - extended memory control
+bit 7 - $5800-$5fff:
+0 - SELF TEST ROM
+1 - RAM
+bits 1-0 - interrupts control (?) = 00
+bit 2 - PORTA control
+0 - input/output configuration
+1 - data register
+bit 3 - cassette motor
+0 - on
+1 - off
+bits 7-4 - interrupts status (?) = 0011
+bits 1-0 - interrupts control (?) = 00
+bit 2 - PORTB control
+0 - input/output configuration
+1 - data register
+bit 3 - serial devices command line
+0 - on
+1 - off
+bits 7-4 - interrupts status (?) = 0011POKEY Documentation
+by Fox/Taquart
+Registers
+
+
+
+ Address Read register Write register
+^20 POT0 AUDF1
+^21 POT1 AUDC1
+^22 POT2 AUDF2
+^23 POT3 AUDC2
+^24 unused AUDF3
+^25 unused AUDC3
+^26 unused AUDF4
+^27 unused AUDC4
+^28 POTST AUDCTL
+^29 KBCODE STIMER
+^2A RANDOM SKSTRES
+^2B unused POTGO
+^2C unused unused
+^2D SERIN SEROUT
+^2E IRQST IRQEN
+^2F SKSTAT SKCTL
+Description
+
+bits 3-0 - volume control
+bit 4 - channel control
+0 - synthetize sound
+1 - constant level
+bits 7-5 - sound distortion
+000 - with 5-bit and 17-bit registers
+001 - with 5-bit register
+010 - with 5-bit and 4-bit registers
+011 - with 5-bit register
+100 - with 17-bit register
+101 - clear sound
+110 - with 4-bit register
+111 - clear sound
+bit 0 - base clock for all channels
+0 - 64 kHz
+1 - 15 kHz
+bit 1 - channel 2 filter controlled by channel 4
+bit 2 - channel 1 filter controlled by channel 3
+bit 3 - join counters 3 and 4 into 16-bit channel
+bit 4 - join counters 1 and 2 into 16-bit channel
+bit 5 - base clock for channel 3
+0 - according to bit 0
+1 - 1.77 MHz (PAL), 1.79 MHz (NTSC)
+bit 6 - base clock for channel 1
+0 - according to bit 0
+1 - 1.77 MHz (PAL), 1.79 MHz (NTSC)
+bit 7 - distortion register
+0 - 17-bit
+1 - 9-bit
+1 - enable
+bit 0 - timer 1
+bit 1 - timer 2
+bit 2 - timer 4
+bit 3 - end of transmission
+bit 4 - serial output
+bit 5 - serial input
+bit 6 - keyboard
+bit 7 - BREAK key
+0 - requested
+bit 0 - timer 1
+bit 1 - timer 2
+bit 2 - timer 4
+bit 3 - end of transmission
+bit 4 - serial output
+bit 5 - serial input
+bit 6 - keyboard
+bit 7 - BREAK key
+Position of potentiometr in range 0-224
+Any value written to this registers starts measurement of potentiometrs
+0 means POTx contains proper value
+1 means POTx is being measured
+bit 0 - POT0
+bit 1 - POT1
+bit 2 - POT2
+bit 3 - POT3
+bits 7-4 - not used
+Received byte
+A byte to be send
+bits 1,0 - POKEY control
+00 - reset POKEY
+11 - normal state
+bit 2 - speed of A/D conversion
+bit 3 - two-tone transmission
+bits 6-4 - transmission speed control
+bit 7 - force SPACE signal
+bit 0 - unused (=0)
+bit 1 - transmission
+0 - in progress
+bit 2 - keyboard status
+0 - a key pressed
+bit 3 - SHIFT key status
+0 - pressed
+bit 4 - serial input line state
+bit 5 - keyboard buffer overflow
+bit 6 - serial input buffer overflow
+bit 7 - Framing Error occured
+Any value written to this register resets SKSTAT error flags
+Any value written to this register resets all countersX-Assembler version 2.2
+X-Assembler version 2.3
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
+
+TABLE OF CONTENTS
+
+
+
+
+INTRODUCTION
+The X-Assembler is a cross-assembler generating code for the 6502 processor.
+It has been designed to be easy to use for Quick Assembler programmers,
+therefore its syntax is an extension of QA's one.
+Changes
+Version 2.3
+
+
+Version 2.2
Version 2.0
+Version 2.0
Version 1.2
+Version 1.2
-INTRODUCTION
- USAGE
- SYNTAX
- FAQ
- BACK
-
-
-System requirements
+
+USAGE
+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:
+Source code requirements
+
+
+Converting Quick Assembler files
+Because of possible editor-associated problems you had better convert
+an Atari text file to a regular PC text file, i.e. EOLs from $9b to $0d/$0a
+and ATASCII specific characters to their integer representation.
+You have to change all OPT directives,
+but usually you only need to remove them.
+Assembling a source program
+The common syntax of invoking command line is following:
XASM source [options]
-
source is name of source file.
-If no extension given, the .ASX is added by default.Assembling options
+Following options are supported:
-
If source is incorrect, X-Asm stops on first encountered error.
-By default lines skipped because of false condition are not listed.
+Exit codes
+Meaning of exit codes returned by X-Asm:
3 = bad parameters, assembling not started
2 = error occured
1 = warning(s) only
0 = no errors, no warnings
-
-Listing structure
+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
@@ -164,46 +196,120 @@ 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
+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)
+reference and thus you can't make 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: * ; |
+
+SYNTAX
-Expressions Statements
+Fields
+Source code is line-oriented. Every line of source consists of fields.
+Same sequence of characters used in different fields has completely different meaning.
+Fields are separated with one or more blank characters.
+There can't be any space within a field excluding strings and comments.
+
+Every line of source must match one of two general forms:
+
+
+In the first form, both fields are optional. Blank lines are ignored of course.
+Comment must here start with one of these characters: ; | or *
+(semicolon, pipe or asterisk). Any information in the line following
+such character is ignored.Label field
+This field is optional. It must start at first character in line, without
+any blank characters before. The purpose of using label field is to define a label.
+Label is a symbol representing an integer of range -$ffff..$ffff.
+Name of a label can contain letters, digits and underscores (_).
+Digit can not be label's first character.
+Name of a label can be as long as you want and all the characters
+are meaningful. In Quick Assembler only 6 leading characters were recognized
+and some sources may not compile 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.Repeat count
+Repeating means assembling single line several times as if
+there were several identical lines. Note it is not just duplicating
+bytes written to object.
+Repeat count, which can be any valid expression, has to be preceded
+with a colon.
+Examples:
+:4 asl @
+:2 dta a(*)
+
+In the latter example each DTA has different operand value.
+If repeat count equals zero, remaining part of line is not assembled.
+This allows conditional assembly on single line to be more compact.
+
+Instruction field
+If this is the first field in a line, the line must start with at least
+one blank character. Instruction 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
+
+Note that
+ lda:tax $80
+
is correct, because $80 is a comment for TAX.
+
+
+Operand field
+Some instructions don't need any operand,
+other need two operands.
+6502 commands require operand with proper
+addressing mode.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.Expressions
Expressions are numbers combined with operators and brackets.
You should use square brackets, because parentheses are reserved
for 6502 indirect addressing.
-Numbers
+Numbers
Numbers are 32-bit signed integers, in the range of -$7fffffff..$7fffffff.
A number can be:
--12345
+$abcd $abcd %10100101 'a' or "a"
@@ -226,13 +332,16 @@ where x is a hexadecimal digit.
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.
+immediately follow the operand or the command in implied addressing mode.*
+You can skip the operand, if the addressing mode is fixed.
+Examples:
+{lda #}, {jsr}, {bne}, {jmp ()},
+{sta a:,x}.
Operators
-Currently there are 19 operators:
-+ Addition
@@ -253,90 +362,39 @@ Currently there are 19 operators:- Subtraction >= Greater or equal && Logical and
-|| Logical or
-
-
-first []
- * / % & << >>
- + - | ^
- = <> != < > <= >=
- &&
-last ||
++ Plus (does nothing)
+- Minus (changes sign)
+~ Bitwise not (complements all bits)
+! Logical not (changes true to false and vice versa)
+< Low (extracts low byte)
+> High (extracts high byte)
+
+first [] (brackets)
+ + - ~ < > (unary)
+ * / % & << >> (binary)
+ + - | ^ (binary)
+ = <> != < > <= >= (binary)
+ ! (unary)
+ && (binary)
+last || (binary) 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: -
+
+
+
Directives
-
-
Examples:
five equ 5
@@ -344,7 +402,7 @@ here equ *
Default (if no OPT specified) is opt l+h+.
Examples:
@@ -359,7 +417,7 @@ Examples:
Examples:
@@ -368,18 +426,20 @@ Examples:
table org *+100
In the latter example table points to 100 bytes
-of uninitialized data (note label is assigned to *
+of uninitialized data (label is assigned to *
before ORG directive is executed).
-It is something like built-in macro.
-Note that it is not an illegal instruction and works on typical 6502.
+Pseudo-commands
+Pseudo-commands are built-in macros.
+They are not illegal instructions and work on typical 6502.
X-Asm can do it for you. ADD replaces two instructions:
CLC and ADC.
- -6502 commands require operand depending on the addressing mode. -Addressing modes should be entered in standard convention except +
There are two extra immediate addressing modes: < and >, -which use low/high byte of word rather than byte value.
+which use low/high byte of word rather than byte value.
+They are for Quick Assembler compatibility.
+You can use traditional #< and #>.
+Note
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.
+addressing mode if it supposes it is possible. You may override it with +a: and z: prefixes.
Examples:
@@ -623,7 +686,7 @@ Examples:There are also pseudo addressing modes, which are similar to -pseudo-commands. You may use them as standard addressing modes +pseudo-commands. You may use them just like standard addressing modes in all 6502 commands and pseudo-commands excluding MWA, MWX and MWY only:
cmd a,x+ = cmd a,x : inx @@ -638,18 +701,8 @@ in all 6502 commands and pseudo-commands excluding cmd (z),0- = ldy #0 : cmd (z),y : dey-
- -
label equ 1 +2 @@ -657,11 +710,12 @@ number of operands was taken.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: < and > are not only 'low' and 'high' +operators, but also 'low of immediate' and 'high of immediate' +addressing modes indicators. +In order to get lda $ab, write lda +>$abcd
A: You should use @ for accumulator addressing mode.
@@ -705,10 +759,9 @@ the value of three in second pass.
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.
+but X-Asm stopped on the first one.
+This is syntax for running X-BOOT:
+XBOOT [/p] obxfiles [atrpath][atrfile]
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.
+If file name extension is omitted, the default .OBX or .ATR is added. +If no atrpath is given, disk images are written by default in +the directory where executables are.
+If file name contains spaces, you should enclose it in quotation marks.
+/p switch (or equivalent -p) 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 nor any special loader.
Both loaders disable Atari Basic, so you needn't hold OPTION key while booting.
- +Below are some examples:
+
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't read it from an Atari DOS nor extract it somehow or other. You can only run it by booting.
-For more details, view sources of loaders: +For more details, read sources of loaders: