Hi, I typed in hello.c and text.s as mentioned in the INTRO.html file that is in the DOC folder from the CC65 installation (win32) I have a batch file setup: c:\cc65\bin\cl65 -t apple2 -O hello.c text.s I run the batch file and I get the following new files in the directory: text.o 252 hello2.o 445 hello (no extension) 2,374 I transfer these files to a DSK image for use on an emulator (using FISHWINGS). I use the Applewin emulator. I boot DOS 3.3 and try to BRUN the files. none of the files will BRUN. I BRUN them and they lock up the machine. I BLOAD them at $2000 using BLOAD FILE,A$2000 I enter the monitor and list $2000- call-151 2000l 55 7A EOR $7a,X 6e 61 09 ROR $0961 00 BRK 00 BRK This isn't the beginning of an executable program! That is with the hello.O file. The hello file with no extension that gets generated by compiling starts out with 00 08 (BRK, PHP). Once again, not the beginning of a machine language program as far as I've seen so far. They seem like very large files for saying "hello world" on the screen (listed as size (sectors?) 4 and 12 on the apple catalog screen. Can you see what I am doing wrong? I cannot figure this out. I have tried messing with the switches on the cl65 command line, and I have tried everything I can think of to get this to work. Also, the compiler seems to want all the source files and APPLE2.O and APPLE2.LIB files in the same directory of Cl65. I tried making a batch file that would: set CC65_LIB=c:\cc65\lib set CC65_INC=c:\cc65\include but it still says that it cannot find APPLE2.O and APPLE2.LIB. I am trying to figure out how to point cl65 to look in the correct directory for LIB, O, and C (source) files, without having to specify them in the command line every time. The INTRO.html file tells you to run cl65 and gives you the command with switches, etc. But it does not tell you WHERE (what directory) you are running it from. Should I be in the BIN directory when I run it? How do I point the compiler to look in the correct directory for APPLE2.LIB and APPLE2.O? How do I point the compiler to look in the correct directory for my source file? THanks Rich On 1 Sep 2003 10:12:09 -0700, aiiadict@hotmail.com (Rich J.) wrote: >Can you see what I am doing wrong? I cannot figure this out. I have >tried messing with the switches on the cl65 command line, and I have >tried everything I can think of to get this to work. It took me a little bit to figure it out, but the help section for the Apple II on CC65.org does give you good directions. They were the same as I came up with; wish I discovered it sooner! >Also, the compiler seems to want all the source files and APPLE2.O and >APPLE2.LIB files in the same directory of Cl65. I tried making a >batch file >that would: > set CC65_LIB=c:\cc65\lib > set CC65_INC=c:\cc65\include >but it still says that it cannot find APPLE2.O and APPLE2.LIB. You'll want to go into your system settings and add these to your path. In Windows NT and 2000 you go to your Control Panel, open the "System" applet, then look for the "Environment Labels" and create new ones for CC65_LIB and CC65_INC. >I am trying to figure out how to point cl65 to look in the correct >directory for LIB, O, and C (source) files, without having to specify >them in the command line every time. The Apple2 files go into C:\CC65\LIB - just make sure they are there. >The INTRO.html file tells you to run cl65 and gives you the command >with switches, etc. But it does not tell you WHERE (what directory) >you are running it from. Should I be in the BIN directory when I run >it? How do I point the compiler to look in the correct directory for >APPLE2.LIB and APPLE2.O? How do I point the compiler to look in the >correct directory for my source file? > >THanks >Rich This is what I did: (1) Open the Control Panel, System, Environment Labels (2) Add "C:\CC65\BIN" to your PATH (3) Create CC65_INC for "C:\CC65\INCLUDE" (4) Create CC65_LIB for "C:\CC65\LIB" (5) Close System applet, open a new DOS window (6) Type "SET" and hit enter - make sure your PATH and CC65_INC and CC65_LIB are set correctly (and show up!) For DOS 3.3 development, I use A2TOOLS to import/export/delete files on a DOS 3.3 disk image. You can get it here: http://home.echo-on.net/~terryk/a2tools.zip Unzip the "a2tools.exe" and put into your C:\CC65\BIN directory, that way it's in your PATH. (See step (2) above) Here's the commands I use to compile the HELLO sample program and to put it into a DOS 3.3 disk called "WORKDISK.DSK": cc65 -O -t apple2 hello.c ca65 -t apple2 hello.s ca65 -t apple2 text.s ld65 -t apple2 -o hello.bin apple2.o hello.o text.o apple2.lib a2tools del WORKDISK.dsk HELLO.BIN a2tools in -r B WORKDISK.dsk HELLO.BIN HELLO.BIN This works perfectly for me. // CHRIS I am still having troubles with CC65. I tried downloading the most recent version from cc65.org. I downloaded the DOS version this time. I resolved the problem with specifying the paths. the SET command from a dos BAT file fixes the problem, and the compiler gets to the proper directories. I am still not getting anything like executable code from the compiler. I use CL65 -t apple2 -O c:\cc65\hello.c the -t switch is to specify target computer. -O is for optimize. the last is to tell it which file to compile. I have tried this with and without the optimize switch. The output filesize is very large, and will not BRUN from a dos 3.3 disk. when I load the program and then list from the machine language monitor, I get strange looking code, starting with 00 BRK or ROR, etc. Looks like data, not code. Please email any responses. I am excited about using this program but can not get it to compile! aiiadict AT hotmail DOT com http://rich12345.tripod.com On 1 Sep 2003 10:12:09 -0700, aiiadict@hotmail.com (Rich J.) wrote: >Hi, (SNIP) >This isn't the beginning of an executable program! That is with the >hello.O file. The hello file with no extension that gets generated by >compiling starts out with 00 08 (BRK, PHP). Once again, not the >beginning of a machine language program as far as I've seen so far. (SNIP) No, actually the "HELLO" file *IS* the file you want. You said it begins with "00 08", but that is correct. CC65 will include the 4-byte binary header to the output. The first two bytes are the LOAD ADDRESS (in this case $0800) and the next two bytes are the LENGTH of the file. Starting with BYTE 4 is your program. Like I mentioned in my post before, get the A2TOOLS program and import the file using that. Be sure to include the "-r" (raw mode) switch, so that A2TOOLS doesn't add another 4-byte header on top of the one that's already there. Then it should work fine. // CHRIS Hi, Congratulations but you forgot the linkage operation. The schema is FILE.C -> CC -> FILE.O -> LN -> FILE EXECUTABLE the command is : ln nameofyourprogram.o c.lib (if you want a run only under shell so it's a PRG program) ln +B nameofyourprogram.o c.lib lib/samain.o warning : verify where is the samain.o (stand alone main) normaly in LIB directory Good luck Jean Pierre PS : verify your file .profile for the SET "Rich J." wrote in message news:370265cd.0309010912.7316f2af@posting.google.com... > Hi, > > I typed in hello.c and text.s as mentioned in the INTRO.html file that > is in the DOC folder from the CC65 installation (win32) > > I have a batch file setup: > > c:\cc65\bin\cl65 -t apple2 -O hello.c text.s > > I run the batch file and I get the following new files in the > directory: > text.o 252 > hello2.o 445 > hello (no extension) 2,374 > > > > I transfer these files to a DSK image for use on an emulator (using > FISHWINGS). I use the Applewin emulator. I boot DOS 3.3 and try to > BRUN the files. none of the files will BRUN. I BRUN them and they > lock up the machine. > > I BLOAD them at $2000 using > BLOAD FILE,A$2000 > > I enter the monitor and list $2000- > call-151 > > 2000l > 55 7A EOR $7a,X > 6e 61 09 ROR $0961 > 00 BRK > 00 BRK > > This isn't the beginning of an executable program! That is with the > hello.O file. The hello file with no extension that gets generated by > compiling starts out with 00 08 (BRK, PHP). Once again, not the > beginning of a machine language program as far as I've seen so far. > > They seem like very large files for saying "hello world" on the screen > (listed as size (sectors?) 4 and 12 on the apple catalog screen. > > Can you see what I am doing wrong? I cannot figure this out. I have > tried messing with the switches on the cl65 command line, and I have > tried everything I can think of to get this to work. > > Also, the compiler seems to want all the source files and APPLE2.O and > APPLE2.LIB files in the same directory of Cl65. I tried making a > batch file > that would: > set CC65_LIB=c:\cc65\lib > set CC65_INC=c:\cc65\include > but it still says that it cannot find APPLE2.O and APPLE2.LIB. > > I am trying to figure out how to point cl65 to look in the correct > directory for LIB, O, and C (source) files, without having to specify > them in the command line every time. > > The INTRO.html file tells you to run cl65 and gives you the command > with switches, etc. But it does not tell you WHERE (what directory) > you are running it from. Should I be in the BIN directory when I run > it? How do I point the compiler to look in the correct directory for > APPLE2.LIB and APPLE2.O? How do I point the compiler to look in the > correct directory for my source file? > > THanks > Rich Hi On my mind the linker operation is not OK the commands are : cc hello.c after you should have a program hello.o (object code) so you type ln +B hello.o lib/samain.o lib/c.lib and you have your BRUNable hello under prodos or shell Warning the order samain.o and after c.lib is important samain.o is the main for obtain an executable file under OS and not only shell good luck send email for any problem. Jean Pierre "Rich J." wrote in message news:370265cd.0309010912.7316f2af@posting.google.com... > Hi, > > I typed in hello.c and text.s as mentioned in the INTRO.html file that > is in the DOC folder from the CC65 installation (win32) > > I have a batch file setup: > > c:\cc65\bin\cl65 -t apple2 -O hello.c text.s > > I run the batch file and I get the following new files in the > directory: > text.o 252 > hello2.o 445 > hello (no extension) 2,374 > > > > I transfer these files to a DSK image for use on an emulator (using > FISHWINGS). I use the Applewin emulator. I boot DOS 3.3 and try to > BRUN the files. none of the files will BRUN. I BRUN them and they > lock up the machine. > > I BLOAD them at $2000 using > BLOAD FILE,A$2000 > > I enter the monitor and list $2000- > call-151 > > 2000l > 55 7A EOR $7a,X > 6e 61 09 ROR $0961 > 00 BRK > 00 BRK > > This isn't the beginning of an executable program! That is with the > hello.O file. The hello file with no extension that gets generated by > compiling starts out with 00 08 (BRK, PHP). Once again, not the > beginning of a machine language program as far as I've seen so far. > > They seem like very large files for saying "hello world" on the screen > (listed as size (sectors?) 4 and 12 on the apple catalog screen. > > Can you see what I am doing wrong? I cannot figure this out. I have > tried messing with the switches on the cl65 command line, and I have > tried everything I can think of to get this to work. > > Also, the compiler seems to want all the source files and APPLE2.O and > APPLE2.LIB files in the same directory of Cl65. I tried making a > batch file > that would: > set CC65_LIB=c:\cc65\lib > set CC65_INC=c:\cc65\include > but it still says that it cannot find APPLE2.O and APPLE2.LIB. > > I am trying to figure out how to point cl65 to look in the correct > directory for LIB, O, and C (source) files, without having to specify > them in the command line every time. > > The INTRO.html file tells you to run cl65 and gives you the command > with switches, etc. But it does not tell you WHERE (what directory) > you are running it from. Should I be in the BIN directory when I run > it? How do I point the compiler to look in the correct directory for > APPLE2.LIB and APPLE2.O? How do I point the compiler to look in the > correct directory for my source file? > > THanks > Rich