@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `1  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D1:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D1:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu  } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED736 FREE SECTORS COPYING---D1:DIRECK.COMl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 138ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8u-*- Text -*- CC65 preliminary doc CC65 is a PD C compiler for Atari 8-bit computers. Using it: EssentiallyT}, all you do to use CC65 is start it up and hand it a file name to compile. This can be done either on a command line, or bU}y typing it in at the prompt after CC65 starts up. Input files are assumed to be C source. Extension .C is assumed if nV}ot specified. Include files are currently assumed to be on the same drive as the C source file. [If anyone can think of W}a better way to do this, please tell me] Switches: -v Verbose. -v once means print function names as they're encoX}untered. Twice prints source lines as they're read. -d Debug. Turns on various debugging code. CC65 processes aY} source file and produces a file with the same name, and extension .M65, ie if you compile foo.c, you'll get foo.m65. The Z}assembler language produced is suitable for feeding to RA65, although you could probably get it to work by defining a couple[} of macros using something like MAC/65. eding to RA65, although you could probably get it to work by defining a couple. CC65 Library Documentation by Mark Miller 9/21/91 ]} ---------------------------- John Dunning, the author of CC65, said in the documentation ^} that he hadn't made any detailed doc's for the libraries, and if anyone else wanted to do so, to go ahead _}and make them. I didn't see any doc's on the libraries at atari.archive, in the 8bit directory. I decid `}ed to take it upon myself to do this documentation, to help myself use the CC65 library functions, and to a} help others. I have derived this documentation from the source code of the library functions John Dunning provide b}d. I have been rather discriminating in choosing which functions to document, and which others are c}not worth worrying about. I knew there were some things in the library sources that were primarily just d}for use by other library functions. Some of the lower-level functions are actually accessible by calling e} certain functions which I document here, without much loss of programmer control. These types of functions act as f} interfaces to the lower-level ones. They may manipulate the data you input to them a little bit, but ot g}herwise the result you get is the same, or almost the same, as if you called the equivalent lower-level f h}unction. This is because all these types of functions do is call a lower-level function with certain par i}ameters. Where such functions are documented here, I have included which lower-level functions they call. j} If you are the type who likes to program "down to the bare metal" I really recommend you get the sources to k} the library functions yourself. There is a lot to see in the sources, some of which I don't understand. l} I don't claim to be an expert on CC65, but I am experienced in the C language. Since many of the m}library functions have a standard C equivalent, I will indicate when a function is non-standard. I n}would like to thank Gary Duzan for helping me understand many things in the library sources, and John Dunning himse o}lf, who has helped me in editing this documentation. If anyone has suggestions or corrections, send them p} to me at millerm@mozart.cs.colostate.edu. It took a lot of effort to create this documentation, mainly q}because I had to derive it from the source code, both C and assembly, which was scantily documented in mo r}st cases (I don't mean this to be a major flame), and it needed to be interpreted correctly. I also did lots of s} correspondence with Gary Duzan and John Dunning, making sure I interpreted everything alright (at least as t}far as they can remember...). So this is a start, and I'm not going to come right out and say it's perfe u}ct. I submit this in the same spirit that CC65 was released: In hopes that it will be helpful, but ther v}e are no guarantees that it has no errors. Just something to note, ERR is a global value in stdio.h. w} Character Processing ---------------------- int isalnum(c) int c; x} Returns a nonzero value if c is alphanumeric. int isalpha(c) char c; Returns a y} nonzero value if c is an alphabetic character. int isascii(c) char *c; Returns a non z}zero value if c is an ASCII character (values in the range of 0-127). int isatty(fd) int fd {}; Returns a nonzero value if fd (an IOCB channel number) is a device. This is not a standard C fun |}ction. int iscntrl(c) char *c; Returns a nonzero value if c is a control character (v }}alues in the range of 0-31, 127). int iscons(fd) int fd; Returns a nonzero ~}value if fd (an IOCB channel number) is the console (stdout?). This is not a standard C function. int i }sdigit(c) char c; Returns a nonzero value if c is a decimal digit. int isgraph(c) } int c; Returns a nonzero value if c is a graphics character (values in the range of 33-12 }6). int islower(c) int c; Returns a nonzero value if c is a lower-case character. } int isprint(c) int c; Returns a nonzero value if c is a printable character } (values in the range of 32-126). int isodigit(c) char c; Returns a nonzero }value if c is an octal digit. int ispunct(c) int c; Returns a nonzero value if c is a } punctuation character. int isspace(c) int c; Returns a nonzero value if c is a white }-space character (a space, tab, or carriage-return). int isupper(c) int c; }Returns a nonzero value if c is an upper-case character. int iswhite(c) char c; See i }sspace(). int isxdigit(c) int c; Returns a nonzero value if c is a hexadecimal digit } (characters '0'-'9', 'A'-'F', or 'a'-'f'). char toascii(c) int c; Returns t }he ASCII equivalent of c. int tolower(c) int c; Returns the upper-case character c as } the equivalent lower-case character. int toupper(c) int c; Converts the lo }wer-case character c as the equivalent upper-case character. String Processing -- }----------------- int atoi(s) char *s; Returns the numeric integer version the intege }r string s. int atoib(s, b) char *s; int b; Converts the number string s }, in base b, to an unsigned integer. Returns the converted value. This function is like strtoul() in st }andard C. int dtoi(decstr, nbr) char *decstr; int *nbr; Converts the sig }ned decimal in the string decstr to a numeric signed integer. It puts the result in nbr. Returns the fi }eld length of the integer, otherwise ERR if an error occurs. This is not a standard C function. int find }(str, len, c) char *str; int len; char c; Searches for the character c } in string str of length len. Returns the index where c is found in str. This function is similar to str }pos() in standard C. The exception is that this function expects a length for the string. itoa(i, s) } int i; char *s; Converts the signed integer i to a signed integer string. T }he string s becomes the converted string. This is not a standard C function. itoab(n, s, b) } int n; char *s; int b; Converts the unsigned integer n to a string in base b. Th }e string s becomes this string. This is not a standard C function. char *itod( }nbr, str, sz) int nbr; char *str; int sz; Converts the signed integer }nbr to a signed decimal string of length sz. The string str becomes this string. This string will be ri }ght-justified. If sz > 0, str will be null-terminated, with the '\0' character at sz index location. } If sz = 0, itod finds the end of the string. The string is expected to be null-terminated. If sz < } 0, itod puts the converted number in str at location (-sz)-1. Returns str (string ptr). This is not a s }tandard C function. char *itoo(nbr, str, sz) int nbr; char *str; int sz; } Converts the integer nbr to an octal string of length sz. The rest is the same as itod(). This is no }t a standard C function. char *itou(nbr, str, sz) int nbr; char *str; } int sz; Converts integer nbr to an unsigned decimal string of size sz. The rest is the same a }s itod(). This is not a standard C function. char *itox(nbr, str, sz) int nbr; } char *str; int sz; Converts integer nbr to a hexadecimal string of length sz. The re }st is the same as itod(). This is not a standard C function. int otoi(octstr, nbr) char *o }ctstr; int *nbr; Converts the unsigned octal number in the string octstr to an integer }. The integer nbr becomes the converted number. Returns the field size of the number, else ERR if an error } occurs. This is not a standard C function. reverse(s) char *s; } Reverses the characters in string s. This is not a standard C function. char *strcat(str1, str2) } char *str1, *str2; Puts str2 on the end of str1. The null character '\0' of str2 beco }mes the null character of the combined string, str1. Returns str1 (string ptr). char *strchr(str, chr) } char *str, chr; Searches for the character chr in the string str. Returns a pointer to } the location of the character in this string. Note what is returned is _not_ an index in str. It is a pointer to } a location in memory. int strcmp(s, t) char *s, *t; Returns a value less t }han 0, if s "is less than" t, equal to 0, if s is equal to t, more than 0 if s "is more than" t. char *s }trcpy(s1, s2) char *s1, *s2; Copies the string s2 to s1, overwriting the contents of s1. } This includes the null-character of s2. It copies all of s2 even if s2 is longer than s1. Returns s1 (string p }tr). int strlen(str) char *str; Returns the length of the string str, excluding the ' }\0' character. int utoi(decstr, nbr) char *decstr; int *nbr; C }onverts the unsigned decimal string decstr to an unsigned numeric integer. The integer nbr becomes this value. Re }turns the field size of the converted number, else ERR if an error occurs. This is not a standard C func }tion. int xtoi(hexstr, nbr) char *hexstr; int *nbr; } Converts the hexadecimal string hexstr to a numeric integer. The integer nbr becomes this value. Returns th }e field size of the converted number, else ERR if an error occurs. This is not a standard C function. } Memory Functions ------------------ char *bcopy(p1, p2, nbytes) char *p1, *p2; } int nbytes; Copies nbytes bytes from address p1 to p2. Returns p1 (pointer). } bzero(ptr, nbytes) char *ptr; int nbytes; Zeroes out nbytes bytes starting at loca }tion ptr. Input/Output -------------- [Note: The global variables stdin, stdout, and stderr } in stdio.h are of type FILE *, so they can be used with any of the following functions that have paramet }ers of type FILE *. These are standard C functions. A file pointer is typically called a stream. fd st }ands for "file descriptor."] cclose (iocb) int iocb; Closes the IOCB channel "iocb". } This function is like fclose() in standard C. char cgetc(iocb) int iocb; R }eturns a character from IOCB channel "iocb", else negative of error code if an error occurs. errno is set to the n }egative of the error code. This function is like fgetc() in standard C. ch }ar *cgets(str, size, iocb) char *str; int size, iocb; Gets a string from the IOCB c }hannel "iocb", "size" bytes long. Returns str (string ptr), or NULL if an error occurs. This function is } like fgets() in standard C. close(fnum) int fnum; Closes the file associated with fn }um. fnum is the value returned from open(). This function is like fclose() in standard C. cl }oseall() Closes all IOCB channels, not including the screen, and/or files. This is not a standard }C function. int copen(name, mode) char *name, mode; Opens a free IOCB channel in mode } "mode". The possible modes are: 'r' - read, 'w' - write, 'a' - append, and 'd' - directory. Returns t }he opened IOCB channel number, or negative of error code if an error occurs. errno is set to the negative } of the error code. This function is similar to fopen() in standard C. int cputc(ch, iocb) } char ch; int iocb; Puts the character ch into IOCB channel "iocb". Returns negative } of error code if an error occurs. errno is set to the negative of the error code. This function is like fputc() }in standard C. int delete(name) char *name; Deletes file specified by the s }tring "name". It calls fdelete(). Returns negative of error code, if an error occurs. errno is set to t }he negative of the error code. This is not a standard K & R C function, but there is an equivalent function in } ANSI C called remove(). int fclose(fd) FILE *fd; Closes the stream fd. It cal }ls close(). Returns NULL if the file is closed successfully, else ERR if an error occurs. } char fgetc(fd) FILE *fd; Returns a character from stream fd, else negative of error } code if an error occurs. errno is set to the negative of the error code. char *fgets(str, size, }fd) char *str; int size FILE *fd; Gets an entire string from the strea }m fd, including the carriage-return, or size-1 characters, whichever comes first. The string str gets the } input. fn_default(name, ext, target) char *name, *ext, *target; Fixes up the filenam }e "name". It adds a drive number and the extender "ext". The string "target" is the modified string. "n }ame" is not altered. This is not a standard C function. FILE *fopen(fn, mode) char *fn, *mode; } Opens the file fn in the mode specified by the string "mode". It calls copen(). Returns the FILE point }er (the stream) to the file, otherwise NULL if an error occurs. errno is set to the negative of the erro }r code. The possible modes are: "a" - append, "r" - read, "w" - write, "u" - update (the equivalent mode } in the standard fopen() function for "u" is "r+"). int fprint }f(argc) int argc; Prints in a format to a stream. The parameters are: fprintf(fd, ctr }lstr, args...). FILE *fd; char *ctrlstr; The string ctrlstr is the control string, where } the output format is specified. The possible options in the control string are: %b - print binary numbe }r %c - print character %d - print signed decimal number %o - print unsigned octal number } %s - print string %u - print unsigned decimal %x - print unsigned hexadecimal number The % }b - binary option is non-standard. The %f - float option is not supported, because currently there is no type floa }t in CC65. Returns the number of items output, or a negative number if an error occurs. errno is set to }the negative of the error code. int fputc(ch, fd) char ch; FILE *fd; Out }puts the character ch to stream fd. Returns the negative of the error code if an error occurs. errno is set to th }e negative of the error code. int fputs(string, fd) char *string; FILE *fd; } Writes "string" to stream fd. It calls write(). Returns NULL always. int fread(buf, sz, }n, fd) char *buf; int sz, n FILE *fd; Reads n items of size sz (in byt }es) from stream fd into string buf. It calls read(). Returns the number of items of size sz read. } int fwrite(buf, sz, n, fd) char *buf; int sz, n FIL }E *fd; Writes n items of size sz (in bytes) from string buf to stream fd. It calls write(). Retur }ns the number of items written, or NULL if an error occurs. char kbdchar() Returns a cha }racter from keyboard input (stdin). The equivalent function in standard C is getchar(). char *gets(str) } char *str; Gets a line from standard input (stdin), excluding the carriage-return. T }he limit of characters that can be input is 32767. The array str must be large enough to hold the user's } input. It calls fgets(). Returns str (string ptr) if input is successful, otherwise NULL if an error occurs. } int open(name, mode) char *name; int mode; Opens the file with filename "na }me" in mode "mode". The two possible modes are: 4 = read, 8 = write. It calls copen(). Returns a non-n }egative value if successful, otherwise ERR if an error occurs. The returned value should be kept, if the open } operation is successful. You will need it for other functions in this "family" of functions. This is not a }standard C function. int printf(args) int args; Prints in a format to the screen. Th }ere is no stream parameter. The parameters are: printf(ctrlstr, args...) char *ctrlstr; } The rest works the same as fprintf(). Returns the number of items output, or a negative number if an error } occurs. int read(fnum, buf, size) int fnum; char *buf; } int size; Gets "size" number of characters from the file associated with fnum and puts }them into the string buf. fnum is the value returned from open(). Returns the number of characters read, or } negative of error code if an error occurs. errno is set to the negative of the error code. This is not a sta }ndard C function. int rename(old, new) char *old, *new; Renames file "old" with new f }ilename "new". It calls frename(). Returns 0 on success, else ERR if an error occurs. This is not a sta }ndard K & R C function, but there is an equivalent function in ANSI C by the same name. int write(fnum, }buf, nbytes) int fnum; char *buf; int nbytes; Writes nbytes number of }characters to the file associated with fnum. fnum is the value returned from open(). Returns the number } of bytes written. This is not a standard C function. Storage Al }location -------------------- char *pmalloc(nbytes) int nbytes; Permanently } allocates memory of size nbytes in free RAM starting at __himem. Note that this is _not_ the same pointer as } the Atari DOS HIMEM pointer. It is a global variable whose value is set after the program is loaded into mem }ory. pmalloc() moves the __himem pointer forward nbytes bytes. Returns a pointer to the space allocated }. Note there is no corresponding free() function in this library. The memory sections look like this: } DOS LOMEM>| ||< heap >| ...stack>|< HIMEM >|}untime stuff, to produce an executable. In the CC65 distribution, you should find the canonical test program, hello.?}c. You should also find the C runtim stuff, runtime.obj and c.olb. Here's what you do to compile up hello.c and run it. @} Put hello.c, runtime.obj, and c.olb on drive 1 of your system, or, if you're using something like Spartados that supports dA}efault devices, put those files on whatever device you're using as a default. Run CC65.COM. When it starts, it will promB}pt with CC65>. Type the line -V HELLO.C at the prompt and hit return. CC65 will compile hello.c, producing hello.m6C}5. Run RA65.COM. When it starts, it will prompt with RA65>. Type the line HELLO.M65 at the prompt and hit return. D} RA65 will assemble hello.m65, producing hello.obj. At this point you can delete hello.m65 if you want. Run LINK65.COME}. When it starts, it will prompt with LINK65>. Type the line -O HELLO.COM RUNTIME.OBJ HELLO.OBJ C.OLB at the prompt aF}nd hit return. Link65 will link hello.obj with the C runtime stuff, and produce an executable program called hello.com. G} You're done! You can now run hello.com, to see the canonical message. The procedures for building bigger programs are mH}uch the same. If you've got multiple source files, you'll compile and assemble each of them separately, then feed all of tI}hem to LINK65, where you typed HELLO.OBJ in the example above. See the link65.doc for more details. ly, then feed all of tg-*- Text -*- Libr-65 preliminary doc Libr65 is the object library maintenance utility part of the CC65 package.K} Its mission in life is to build, maintain, list etc libraries of object modules. Object libraries are useful when buiL}lding things like C programs, as there are all kinds of functions that want to be optionally linked in, and keeping track oM}f them all by hand is too big a pain to be worthwhile. See the LINK65 doc for a [brief] explanaked in, and keeping track oa-*- Text -*- Link-65 preliminary doc. Link-65 is a linker for relocatable object modules. It inputs object filO}es and outputs an executable image. Link-65 accepts as input a series of names and switches. Valid switches: -O SP}pecify output file, as "-O FOO.COM". -B Specify exec base address, as -B2800. Number is a hex constant. Default valuQ}e is #x2000. -M Write a map file. A bunch of information gets dumped to the map, like how big each oject module R} ended up in the executable, and what addresses of global symbols etc. The name of the map file is the name of the ouS}tput file, with the extension .MAP, ie "-M -O FOO.COM" will output the executable in FOO.COM, and the map in FOO.MAP. T} -V Verbose. Turns on printing of various debug info while the link proceeds. Anything that's not a switch is expectU}ed to be a file name. All files are linked together to produce the executable. Ex: You could say something like: LINKV}65 -m -o foo.com start.obj foo.obj to link START.OBJ and FOO.OBJ together to form FOO.COM, and write the linker map to FOW}O.MAP. Link-65 knows how to search object libraries (.OLB files) to resolve references to undefined symbols. This is espX}ecially useful when linking C programs, as they'll typically reference all kinds of canned library routines. Libraries areY} specified as files like anything else. Ex: LINK65 -o hello.com runtime.obj hello.obj c.olb Runtime.obj is the C starZ}tup/runtime module, hello.obj is the main program, and c.olb is the C library. If a filespec contains a leading at-sign ([}'@') it is interpreted as an indirect command file. That means it's expected to contain a list of names of the files that \}are really supposed to be linked. Using this scheme, the above example would look like this: LINK65 -o hello.com @hello.]}lnk where hello.lnk contains the following 3 lines: runtime.obj hello.obj c.olb Case does not matter in command ^}line args; ie -v is equivalent to -V. As usual, Link-65 will prompt for a command line if there isn't one, either because y_}ou didn't type it, or 'cause you're running on some system that doesn't do command lines, like DOS 2.5. ither because yn-*- Text -*- Relocatable object file format: Header: #xFDFD identifies this as a relocatable obj file. Nbytes !a}symbol: word. Nbytes of symbol table. Includes 'nsymbols'. Nbytes segment: word. N bytes this segment uses. Nb!b}ytes data: word. N bytes in segment data this object file. Nsymbols: word. N symbol structs following. Symtab: !c} some number of symbol structs. Each one looks like: namelen: byte length of namestring value: word symbol value!d} flags: word flag bits this sym, one of: abs: value absolute rel: value relative to start of module Data: !e}a bunch of op bytes, followed by data per op. ops: lit |0.0.0.n.n.n.n.n| n literal bytes follow. rel |0.0.1.0!f}.0.0.0.0| generate the following word offset by the start address of this segment rel-hi |0.0.1.0.0.0.0.1| gener!g}ate a byte, the high half of the following word, offset by segment base rel-lo |0.0.1.0.0.0.1.0| generate a byte, t!q})B%DOS SYSB*)DUP SYSB SCC65 DOCB\CC65LIB DOCBINTERNALDOCB:INTRO DOCBJLIBR65 DOCBNLINK65 DOCB `OBJ DOCB%uRA65 DOCB README TXThe low half of the following word, offset by segment base sym |0.1.s.n.n.n.n.n| if s is clear, sym number is nnnnn,!r} if set, nnnnn is top 5 bits, next byte is bottom 8. followed by a word. Generate the following word offset by the !s}value of symbol n. sym-hi |1.0.s.n.n.n.n.n| Same as above, but generate hi byte of resultant value sym-lo |1.1.s.n!t}.n.n.n.n| Same, but generate lo byte n| Same as above, but generate hi byte of resultant value sym-lo |1.1.s.n --*- Text -*- A65 preliminary doc [If anyone can come up with a better name than RA65, please let me know...] %v} RA65 is the assembler that goes with CC65, although it can just as well be used by itself. RA65 eats 6502 assembly-languag%w}e source files, and produces relocatable object files, suitable for linking into executables with LINK65. When you start%x} up RA65, it wants an optional name for the output file, optional debugging switches, and any number of input file names. T%y}he input files are read in order, and an output file is written. If no output file is specified, the output file name will%z} be the first input file name, with .OBJ substituted for whatever extension was there. Ex: RA65 foo.m65 assembles f%{}oo.m65, producing foo.obj. RA65 -o foo.obj foo.m65 does the same thing. RA65 -o foo.obj defs.m65 moredefs.m65 foo.m6%|}5 This form is useful when you've got some files of equates or something that you want to assemble your code with. Swi%}}tches: -O output file name, as described above. -V verbose. If verbose is turned on, the assembler will print li%~}nes to the screen as it assembles them. Differences between RA65 and other assemblers for the Atari: RA65 is NOT the sa%}me sort of beast as most other assemblers for Atari 8-bitters, at least all the ones I've ever seen. The output of this as%}sembler is not an executable image, but a relocatable object module. [The format of .OBJ files is described in more detail%} elsewhere] These files are essentially instructions to the linker about how to construct the real executable. A .OBJ fi%}le contains instructions, raw data, specialized reference codes (things like "generate a byte that's the hi byte of the add%}ress of symbol foo") and symbol tables. The symbol table contains both definitions of symbols that are defined in this mod%}ule, as "symbol _BAZ is defined as 27 bytes in from the beginning of this module" and references to symbols not defined in %}this module, as "value of symbol _QUUX + 20". There are some differences in how you use this assembler, compared to tradi%}tional ones. o No ORG or *= directive. It's meaningless in this kind of assembler; as the starting address, like all %}other addresses, is determined at link time, not assemble time. o Undefined symbols. These are errors in an ordinary %}assembler, but are not necessarily errors here. Undefined symbols are assumed to be references to something to be define%}d elsewhere. Note! Since the default way to reference a symbol as a 16-bit quantity, addresses on page 0 must be defined%} properly before you reference them, otherwise they'll error, or at least generate incorrect code. o No symbol for t%}he current PC. This is really a bug, as it's possible to make it work, I've just never gotten around to it. This means y%}ou can't say things like sym = * when defining symbols; you should use the sym: form instead. Special%} ops: RA65 understands a couple of other things that aren't usually done in traditional assemblers. The following pseudo%}-ops are used by CC65, in particular: ldax #foo This loads the AX pair with the constant value foo, by generating %} an lda and an ldx. It will not work with non-constants. lbne labl This is a long-branch pseudo-op. It ge%}nerates a bne if the label can be reached that way, otherwise it generates a beq *+5 followed by a jmp to the %}label. There are similar ones for lbeq, lbcc etc. Other stuff: RA65 understands the following pseudo-ops: .g%}lobl Define or reference a global symbol. used as: .globl foo .word Generate one or mor%}e 16-bit values. Values can be constants, expressions, symbol references etc. Values are separated by commas.%} .byte Generate one or more 8-bit values. Similar to above. .blkb n Generate n bytes of empty space. %} = Set the value of a symbol. Used as: foo = 3 [There's more; finish later] Command lines: Like all t%}he members of the CC65 family, RA65 can either grok command lines as used by Spartados and DOS XL, or prompt for its command%} line. If no command line is given, or you're running something that doesn't do command lines, RA65 will prompt, as RA65%}> You're then expected to type in the rest of the command line. Ex: under Spartados, if you typed RA65 -v foo.m65 %}you get the same effect under DOS 2.5 by starting up RA65, then at the RA65> prompt, typing -v foo.m65 -v foo.m65 $n-*- Text -*- This is the second betatest distribution of CC65 and associated stuff. Please see INTRO.DOC for instructions)} on getting started. Since the last go-round, the following bugs have been fixed: o The low-level file-open code now u)}pcases the filename before attempting to open it. This should fix the lossage observed on systems like DOS 2.5 that )}treat lowercase characters as illegal. o The command-line parser should now be able to recognize DOS XL command l)}ines, as well as SpartaDos. As before, all executables have their base address set to #x2000, with the exeception of CC65)}.COM, which starts at #x2600. Please let me know if you run into memory problems; I suspect I can get another half K out o)}f CC65 before running into stack problems. All text files are in ATASCII except the ones in DOC.ARC, which are in mushy-)}dos format, ie CRLF as line delimiters. Since I've been remiss in writing the doc for the library routines etc, I've inc)}luded the library source. You shouldn't have to rebuild it, but it may be useful for reference. If anyone feels inclined t)}o write part of the doc for me, don't let me stop you! BTW when I built LIBSRC.ARC I wasn't very selective, I just grabbed)} eveything out of my current development directory that looked relevant. There are probably some duplicates and extra file)}s in there, esp since many of the routines were originally in C, then later hand-coded in assembler. Caveat emptor. Plea)}se let me know how this stuff works for you. I'd like to declare it done and post it for real. . Caveat emptor. Plea(d