Path: utzoo!attcan!uunet!ginosko!bbn!apple!oliveb!ames!killer!chasm From: chasm@killer.DALLAS.TX.US (Charles Marslett) Newsgroups: comp.sys.atari.8bit Subject: An Atari Assembler: A65 Summary: A65 assembler, part 2 of 3 (Docs) Message-ID: <8448@killer.DALLAS.TX.US> Date: 24 Jun 89 05:40:40 GMT Organization: The Unix(R) Connection, Dallas, Texas Lines: 160 # This is a shell archive (Part 2 of 3) # # It contains the documentation (what little there is) # for the A65 (NON-macro) assembler. # #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # a65.doc # This archive created: Fri Jun 23 20:31:09 1989 sed 's/^X//' << \SHAR_EOF > a65.doc X X X A65 (A very simple 6502 assembler) X X by X Charles Marslett X Wordmark Systems X X XThe A65 assembler is modeled after the Atari MACRO Assembler (AMAC) that Xwas distributed by APX along with the MEDIT editor and the DDT debugger. XThe most significant thing about it is that the source files cannot contain Xline numbers (so editors that use line numbers must be able to write an Xunnumbered output file). A second characteristic is that it is a disk-to- Xdisk assembler (the source must be in a disk (or cassette) file and the Xobject cannot be inserted directly into memory. X XThe assembler is run from the DOS menu using the 'L' command, and prompts Xyou for the source file name, the object file name and the listing file Xname: a RETURN in response to the object and listing prompts will cause Xthe assembler to generate files on the same drive with extensions '.OBJ' Xand '.LST' using the same file name as the source file. If no '.' appears Xin the source file name, '.ASM' is its assumed extension. A listing can Xbe printed directly by specifying 'P:' as the list file or dumped to the Xscreen by specifying 'E:'. A '-' disables the listing if you do not want Xone. X XA start at implementing support for the 65C02 opcodes is in the code, but Xwhat is there has not been tested very thouroughly and most of the opcodes Xand addressing modes are not in place yet. Otherwise, the machine Xinstructions are as any other standard 6502 assembler would expect. XExpressions can include +, -, * and / operators as well as HIGH[] and LOW[] Xfunctions to extract the high and low bytes of 16-bit numbers. Brackets, X[ and ], may be used to group terms in an expression if necessary. Symbols Xmay have up to 11 characters, including upper and lower case letters, Xunderscores and numbers. Symbols must start with an underscore or letter, Xand case is significant except for the predefined assembler opcodes and the Xregister names A, X and Y. X XThe machine opcodes recognized are: X X ADC, AND, ASL, BCC, BCS, BEQ, BIT, BMI, BNE, BPL, BRA (65C02 only), X BRK, BVC, BVS, CLC, CLD, CLI, CLV, CMP, CPX, CPY, DEC, DEX, DEY, X EOR, INC, INX, INY, JMP, JSR, LDA, LDX, LDY, LSR, NOP, ORA, PHA, X PHP, PLA, PLP, ROL, ROR, RTI, RTS, SBC, SEC, SED, SEI, STA, STX, X STY, TAX, TAY, TSX, TXA, TXS, TYA X XThe assembler directives are: X XDB defines a byte, in decimal (12), hex ($0C), octal (@14) or binary X (%00001100) and may also be a character string (enclosed in quotes) XDC defines a byte, as above, but with the high bit set (if defining a X string, only on the last byte of the string) XDW defines a word, low byte first, as if an indirect pointer XDS allocates a number of bytes without storing any data in them X XORG sets the location counter to a fixed address X*= same as ORG XEQU defines a symbol to have a specific value X= same as EQU X X X X X X X X XINCLUDE causes the file specified to be inserted at this point in the X assembly (can be nested if the DOS supports sufficient numbers X of files open at once -- the object, list and source files are X kept open at all times, and each level of nested includes requires X one more open file. MYDOS and Atari DOS 2 allow 3 normally, which X does not allow a listing and include files. If set to 5, the X assembler could generate a listing and handle 1 level of nested X includes) XTITLE specifies the first title line XSUBTTL allows entering a second title line XPAGE causes the assembler to go to the top of th next listing page X XEND terminates the program and specifies INIT and RUN addresses X XLIST a stub for future expansion XMACRO another stub (does nothing, not even generate an error) XMEND another stub X XOctal numbers, EQU, *=, and INIT and RUN addresses may have bugs in them -- Xgood luck. Most of the rest has been debugged reasonably well. X XThe END statement can have the following forms: X X END no RUN or INIT vectors generated at all X END ADDR ADDR is the RUN entry point X END ADDR, ADDR is the INIT entry point (no RUN vector) X END INIT,RUN both vectors specified X X(This is what I call minimum documentation, I will add to it as questions Xare asked) X X Charles Marslett X 8/21/85 X X X XChanges since the first release: X XThe assembler now behaves more reasonably when a forward reference is Xencountered (it used to just generate junque quietly!) -- forward references Xare forced to 16-bit values if possible, otherwise A65 assumes you know what Xyou are doing, and assumes it will be an 8-bit value when it is defined. X XThe assembler allows upper and lower case symbols, and it is case sensitive. XIt still ignores case, however, when handling the directives and machine Xopcodes as well as the register names ("A", "X" and "Y"). Underscores are Xalso allow in symbols and are treated as letters (makes C people happy!). XSymbols may also be up to 11 characters long (rather than 8 as before). X XThe initial load address is the HIMEM value from DOS (the lowest possible Xload address) rather than a random value left over in memory. X XErrors are marked in the listing file (as before) but they are also echoed Xto the screen, and the total number of errors (in HEX) are reported at the Xend of the assembly. If any errors occur, the automatic return to the DOS Xprompt is delayed until the [RETURN] key is pressed to give you an opportunity Xto note any (unexpected) errors reported. X X X X X X X X X XFinally, some errors that were previously accepted (and generated bad code) Xare now caught and flagged as errors). These included multiply defined Xsymbols and some invalid addressing modes. X X Charles Marslett X 6/16/89 SHAR_EOF # End of shell archive exit 0 =========================================================================== Charles Marslett STB Systems, Inc. <== Apply all standard disclaimers Wordmark Systems <== No disclaimers required -- that's just me chasm@killer.dallas.tx.us