ZooEYZooEY is a crossassembler designed for 6502 processors. Binaries are generated specially for 8-bit Atari systems (AtariDosII and SpartaDOS X formats supported). This tool is compatible with Quick Assembler, one of the most popular assemblers in Poland.
- -d - More information about assembly process,
- -h - Help,
- -i path - include path. You can add many include paths (using -i many times),
- -l filename - Generate labels report. Each line consists of 5 fields: label name, decimal value, hexadecimal value, declaration line number and (optional) additional information. In last filed can be two values: 'Reloc' means that label is relocable. 'Unused' means that label is unused,
- -m - Check memory collisions. You can check collisions only with 'd' and 's' block types. All other blocks are ignored,
- -o filename - Output file name,
- -r - Remove previously created file if assembly fail. Name is taken from -o option,
- -s - Turn on SpartaDOS X filenames for ICL directive. Ordinary paths looks like 'D2:filename.ext'. If you have sources from SDX, your paths' syntax may be like 'D:>dir1>dir2>filename.ext'. All included files must be in current directory,
- -v - Prints version and exit,
- -w - Turn display warnings on,
- -z - ZooEY behavior. Turn off some qa features. For files included by ICL: pseudodirective OPT isn't skipped; pseudodirective END conclude current file and back to previous, file.
qa incompatibilitiesZooEY is a Quick Assembler descendant. As such it should work well with any code written for Quick Assembler, but while porting original QA sources, keep in mind that there are some OPT arguments which are not supported. The implemented ones control binary headers and compile-time listing. For details, look at pseudo directives section below and -z switch.
values and typesA numeric value is a number from 0 to $FFFF (0-65535). It can be put down in any of the following ways, which defines how it is treated by the assembler:
- :lda 2000,x - generates opcode of the mnemonic in specified addressing mode,
- <$2000 - generates LSB of the word,
- >$2000 - generates MSB of the word,
- 'A' - generates an ATASCII/ASCII code of the value,
- 'A'* - generates an ATASCII/ASCII code of the value +128 (highest bit inverted),
- "A" - generates an internal code of the value,
- "A"* - generates an internal code of the value +128 (highest bit inverted),
- * - current PC (Program Counter) value. This is a 16-bit value,
- $1010 - a hex representation of the value,
- %1010 - a binary representation of the value,
- 1010 - a decimal representation of the value.
- ^ - power,
- * / % - multiplication, division, modulo division,
- + - - addition, substraction,
- < > - less than, greater than,
- = - equals,
- ! - logical NOT,
- & - logical AND,
- | - logical OR,
- ( ) - brackets.
macrosA macro must be contained within the scope of "mac" and "endm" directives. An argument of macro can be invoked from within the macro by the '\' character followed by the argument number, given as a decimal. To use a macro you just call its name and arguments like: macro_name arg1,arg...,argN.
INOTICE: Macros can be nested but constants cannot be defined within macros.
Defining a macro: blah mac lda \1 sta \2 enm Using the macro: blah $2000,$2001 The macro above will be expanded by assembler into: lda $2000 sta $2001
conditional assemblingThe following directives are supported:
.if condition .ifdef label .elif condition .else .fiwhere 'condition' is any arithmetical or logical expression. An example:
wait_for_sync equ 1 .if wait_for_sync lda 20 cmp 20 beq *-2 .fi
additional directivesThose two are automatic. I.e. assembler recognizes the EOLs anyway. If, for some reason the assembler can't parse the EOLs, those directives can force it into a specified EOL mode.
- .atari - forces the assembler to assume that the sourcefile has atari EOLs ($9B)
- .unix - forces the assembler to assume that the sourcefile has unix EOLs ($0A)
By default ZooEY uses the op-code list of a generic vanilla MOS6502. If you want to extend the instruction set use the following:
- .65c02 - force 65C02 instruction set (must be enabled in every sourcefile that uses it)
- .unpbl - force unpublished (illegal) instructions (must be enabled in every sourcefile that uses it)
- bin 'fname'[,A[,B]] - includes contents of the file 'fname'. If A is present - readout starts at the offset A, if B is present, B bytes of file are read in.
- cos A,B,C - generates a cosine table with MAX A and the length of B. Amplitude level is at C.
- dta - generates data of the following types:
- a - address - 16-bit value. You can write adresses in a row like this: 'dta a(1,2,3,4)',
- b - byte - 8-bit value,
- c - ATASCII/ASCII code(s) for given argument e.g. dta c'ABCD',
- d - Internal Antic Character code(s) for given argument,
- h - MSB of argument,
- l - LSB of argument,
- v - vector - 16bit value, relocatable.
dta v($1000) - unrelocatable vector value (constant) dta v(*) - relocatable vector value dta v(*+100) - relocatable, if inside a relocatable block.
- icl 'fname' - include another asm file,
- mem A,B - define(reserve) memory block started at A and size B. Usefull only with -m option (memory checking).
- opt - assembling options. You can use a number, h-, h+, p+ and p- as arguments.
- a number - is a value from 0 to 255 (compatible with QA opt - but not all bit setups are supported),
- p+, p- - source printout on and off.
- h+, h- - standard DOS header (FFFF) on and off.
- org - binary header block generation (interchangable with 'blk'). The parameters are:
- addr - address (exactly like in QA),
- n,addr - headerless block, beginning with addr,
- d,addr<,addr2> - a generic DOS block with FFFF header. Source is assembled from addr. If addr2 is provided, the block addres is addr2.
- e,[m|e],size - dummy block. Reserves a memory block in lowmem or xms. Does not contain data, only reserves address space of size 'size',
- s,addr - generic Sparta block with FAFF header. Symbols and jumps to 'r' type block are supported. After using the two, one must use 'u,a' and 'u,s' blocks (using the same rules as apply for 'r' type blocks),
- r,[m|e] - relocatable sparta block with FEFF header. After the last 'r' block, you must use 'u,a' block(s). And, if you used symbols - 'u,s' block(s),
- u,a - address update block (must follow 'r' block - see above),
- u,s - symbol update block (must follow 'r' block - see above),
- u,n,'name',addr - symbol declaration block. Defines symbol 'name' (max 8 chars) beginning at addr.
- sin A,B,C - generates a sine table with MAX of A and table length of B. The aplitude level is at C.
- smb - Sparta symbol definition. Use only in 's' and 'r' type binary blocks. Example:
print smb 'PRINTF' jsr print dta d'hello world.',b($9b,0)
extra toolsThere are also three scripts:
- atari2unix - converts EOL from $9b to $0a,
- label2asm - converts label's report (produced by -l option) to asm file, acceptatble for 'icl' pseudodirective,
- unix2atari - converts EOL from $0a to $9b.