home *** CD-ROM | disk | FTP | other *** search
-
- 6502/6510 Cross Assembler System
-
- Version 0.72ß (24 Dec 1995)
-
- ©1995 Skoe of Expression
-
-
- The 6502/6510 Cross Assembler System (XAss) was made for comfortable
- programming of these 8 bit processors. The object code can be found in
- the file "scrap.object" or transfered directly to the 8 bit computer.
- XAss has a lot of functions developed for the Commodore 64.
-
- This file will not explain programming assembler, only the use of XAss.
- I offer you to read this text carefully to avoid problems!
-
-
- STARTING XASS
- ~~~~~~~~~~~~~
- Double click the 6502-XAss icon or drag it onto the iconbar.
-
-
- TRANSFER
- ~~~~~~~~
- You will need a cable (not too long) from Archimedes/RiscPC parallel
- printer port to a parallel port of the 6502/6510 computer, e.g. the C64
- user port (see the file "C64-Cable"). The format of transfered datas is
- explained in chapter "SCRAP/Object".
- The destination machine will need a small program for receiving. For C64
- you can find the files "Transfer" and "Trans-Run" in the Sources directory.
- I suppose that you are a coder so I do not explain the usage. You must
- type it into a C-64 assembler or assemble it using XAss and transfer it
- in hex dump.
-
- If you use another computer, I'll explain the link:
- You have 8 data wires (0V = low, 5V = high), one for ground (0V) and the
- "^ACK" wire. To order the next byte the destination computer must pull
- this one down to 0V, normally it's 5V. The parallel link uses only one way
- handshaking, so the destination computer must read slower than the Arc can
- send. If the Arc is slower it will happen that the destination reads one
- byte two times, e.g. if you write the receiving routine in assembler
- without waiting loops.
-
-
- SYMBOLS
- ~~~~~~~
- Symbols can contain all letters, numbers and the '_'. They must not start
- with a number. Symbol names can be very long, the assembler uses only the
- first 39 characters. Symbols are case sensitiv, i.e. "my_label_1" and
- "My_Label_1" are not the same!
-
- You can use intern and extern symbols. Intern symbols are labels inside your
- program. You define one in a seperate line beginning with a dot:
-
- sei ; set IRQ flag
- .my_nice_label ; here is my label
- nop ; do nothing
- dex ; decrement X reg
- bne my_nice_label ; if not zero branch to my label
-
- Extern symbols can contain any number from 0 to $FFFF. You can define one in
- a seperate line beginning with a '!':
-
- !letter_A = 65 ; 65 is a capital 'A'
- !screen = $0400 ; this is the address of screen mem
- lda #65 ; load akku with #65
- sta screen ; store it into $0400
-
- To generate a program you must define a base address. To do this, simply
- define the extern symbol "base" (not "Base" or "BASE"!) at the top of your
- source code:
-
- ; -----------------------------------
- ; This is a complete program for C-64
- ; It prints 256 letters onto screen
-
- !base = $c000 ; start this program with "SYS 49152"
- !screen = $0400
- !letter = 65
- sei
- lda #letter
- ldx #0
- .loop
- sta screen,x
- dex
- bne loop
- rts
- ; -----------------------------------
-
- As you can see you can use symbols like normal numbers or addresses.
-
-
- TERMS
- ~~~~~
- Every parameter can contain simple calculations, i.e.
-
- ;-----------------------------------
- !base = $C000
- !label_2 = 3
- jmp base + label_2 - 3 ; jumps to $C000+3-3 = $C000
- ;-----------------------------------
-
- ;-----------------------------------
- !one = 1
- !two = 2
- lda #3 * (one + two) ; loads akku with #9
- ;-----------------------------------
-
- You can use decimal and hexadecimal numbers. Hex can begin with '&' (like on
- Acorn computers) or with '$' (like on C64).
-
- If an term starts with '<' or '>' you'll get the low or high byte of an
- expression:
-
- !base = $C000
- lda #<base ;load akku with #$00
- lda #>base ;load akku with #$C0
-
- Note: The parser has a bug recognizing brackets. E.g. you want to get "lda 20"
- and write "lda (2+3)*4". The assembler answers with a "missing ')'
- error". Use "lda 4*(2+3)" instead!
-
-
- ADRESS MODES
- ~~~~~~~~~~~~
- Explained in a very short form:
- (By the way: you can use "LDA $0ca0", "lda $0Ca0" or "Lda $0CA0"...
- not case sensitive)
-
- examples length
- -------- ------
- asl
- nop ;1 byte (akku or single command)
-
- ldx #symbol+1
- lda #3 ;2 bytes (direct)
-
- lda z,100 ;2 bytes (zeropage) \
- \ if you forget "z,"
- lda z,$a1,x ;2 bytes (zeropage,x) \ the assembler will
- / use "absolute[,x|,y]"
- ldx z,5,y ;2 bytes (zeropage,y) /
-
- ldy $400 ;3 bytes (absolute)
-
- lda $0400,x ;3 bytes (absolute,x)
-
- ldx $04C0,y ;3 bytes (absolute,y)
-
- bcc label ;2 bytes (relative)
-
- adc ($10,x) ;2 bytes (indirect,x)
- ; it's the same as "adc z,($10,x)"
-
- adc (1),y ;2 bytes (indirect,y)
- ; or "adc z,(1),y"
-
- jmp ($200) ;3 bytes (absolute indirect)
-
- Note: a command like "lda 1" will assembled as absolute command (3 bytes),
- if you want a zeropage command (2 bytes) you MUST use "lda z,1" !
- So you or the assembler will have no problems with these address modes
- in future (knowing the used address mode is important e.g. for self
- changing code or difficult timing e.g. "bit z,0").
- The XAss is the only assembler I know that uses this "z," method.
-
-
- ASSEMBLER COMMANDS
- ~~~~~~~~~~~~~~~~~~
- /align
-
- is sometimes a very useful command. It fills the object file with NOPs until
- the program counter is $xx00. The meaning is, that branches (B?? mnemonics)
- are one cycle faster if they do not overjump a memory page. It could be very
- important for routines with difficult timing.
-
- example:
-
- ;---------------------
- !base = $5aff
- dex
- bne base
- ;---------------------
-
- is slower than
-
- ;---------------------
- !base = $5aff
- /align
- .loop
- dex
- bne loop
- ;---------------------
-
-
- /by
-
- puts some bytes into memory, e.g.:
-
- /by 0,3+3,<label
-
-
- /tx "Some text"
-
- puts a ASCII text into memory. The table for translating Acorn to C-64 ASCII
- you can find in the file "<6502-XAss$Dir>.c.TextTable", it's a part of the
- source code of XAss, you mustn't change it!
-
- Some specials:
-
- Arc CHR$
- ° 0 e.g. for string ends
- ä 27 [
- ö 28 £
- ü 29 ]
- ß 30 ^
- Ä 91
- Ö 92
- Ü 93
- _ 13 enter
-
- ~ clr/home
- “ "
-
-
- /sc "Text"
-
- puts the screen codes into memory (C-64 POKE codes). Useful for scrollers...
-
- Note: if you use set 1 at C64, small letters on Arc will be capital letters
- on C64, capital letters on Arc will be graphic characters on C64.
-
-
- PRECOMPILER
- ~~~~~~~~~~~
- Precompiler commands start allways with an '#' as first (!) char at a line.
-
- #include
-
- Big sources can be splitted into several text files. At the line containing
- this command the precompiler includes this file. At the moment included
- files mustn't contain "#include".
- An example:
-
- File "IDEFS::4.$.Main":
-
- ---------------------------------
- | |
- |#include "IDEFS::4.$.Noppy" |
- | |
- | rts |
- | |
- |#include "IDEFS::4.$.Noppy" |
- | |
-
-
- File "IDEFS::4.$.Noppy":
-
- ---------------------------------
- | |
- | nop |
- | nop |
- | |
-
-
- Will be assembled as:
-
- ---------------------------------
- | |
- | nop |
- | nop |
- | |
- | rts |
- | |
- | nop |
- | nop |
- | |
-
-
- In this version af XAss you must use the right path or a variable
- like "<Sources$Dir>.Noppy"
-
-
- SCRAP
- ~~~~~
- open directory "<6502-XAss$Dir>.Scrap" after assembling a file.
- You'll find:
-
- --- "Object" ---
-
- is the assembled program file. It has the following structure:
-
- If you use "no transfer" you'll get a normal C64 PRG file:
-
- byte meaning
- ---- -------
- 0 start low
- 1 start high
- 2 datas
- ...
-
-
- Otherwise it's a file containing all transfered datas:
-
- byte meaning
- ---- -------
- 0 =0 \
- 1 =255 / marks start
- 2 start low
- 3 start high
- 4 end low
- 5 end high
- 6 start low
- 7 start high
- 8 end low
- 9 end high
- 10 datas
- ...
-
-
- --- "Report" ---
-
- is a file containing all error messages. The XAss doesn't stop assembling if
- an error occurs. It writes all messages into this file. You can read it after
- clicking "Report".
-
- --- "Symbols" ---
-
- a list of all defind symbols and their contents. Click "Show symbols".
-
-
- PROBLEMS
- ~~~~~~~~
- - no binary numbers (%10110)
- - a line like "LDA (2+3)*2" will cause a "missing )" error,
- use "LDA 2*(2+3)"
- - a lot of bugs...
- - this version can hold max. 500 symbols
-
-
- FUTURE
- ~~~~~~
- - usage binary numbers
- - not too many bugs
- - dynamic number of symbols
- - better handling of #include path names
- - desktop version
- - please write me a letter (snail-mail or e-mail) if you use this assembler!
- if a lot of people use it, I'll include macro handlings
-
-
- USING
- ~~~~~
- If you use the XAss, please write this line into a scrolltext:
- "coded using 6502 XAss System by Skoe of Expression"
-
-
- CONTACT
- ~~~~~~~
- for problems, ideas, newer versions (please send a disk (with PD if
- possible) and some stamps or coins) or bug reports:
-
- snail-mail:
-
- Thomas Giesel
- Hauptstr. 61
- D-03246 Crinitz
- Germany
-
- e-mail:
-
- skoe@stardate.westfalen.de
-
- voice:
-
- 035324-38372 or +49-35324-38372 (Sat/Sun)
-
- =======> I need a Acorn graphician for game projects! <=========
-
-
-
-