AHCC
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
AHCC V4.11
LS
A new version available on:
http://members.chello.nl/h.robbers/
Changes:
may 30 2012
v4.11
Compiler:
Revision of registerization of local variables.
Produces slightly better code.
Also repairs Draconis Marathon.
Fixes a bug where a explicit cast of ptr to long or vv
was handled incorrectly.
A further bugfix (A very very old one, perhaps since v3b1).
Assembler:
Implemented opcodes:
align
aline
Allow single = for 'equals' in IF expressions.
Full implementation of 'equ' expressions.
addq.w #n,An
addq.b #n,An
silently changed to addq.l #n,An.
2 new pseudo opcodes for use with Coldfire compatible
programs:
xsave reglist
xrest reglist
The instructions generate the movem sequences required
for Coldfire campatibility. You, as a programmer, do
not have to count the registers for the lea instructions.
The compiler will do that for you and also generate
the lea's.
Library:
Provided 68000/Coldfire usable TOS bindings in case
a project did not include the AHCC specific tos.h
(The one that uses __syscall__).
The library is called "ahcctos.lib".
Have fun!
A new version available on:
http://members.chello.nl/h.robbers/
Changes:
may 30 2012
v4.11
Compiler:
Revision of registerization of local variables.
Produces slightly better code.
Also repairs Draconis Marathon.
Fixes a bug where a explicit cast of ptr to long or vv
was handled incorrectly.
A further bugfix (A very very old one, perhaps since v3b1).
Assembler:
Implemented opcodes:
align
aline
Allow single = for 'equals' in IF expressions.
Full implementation of 'equ' expressions.
addq.w #n,An
addq.b #n,An
silently changed to addq.l #n,An.
2 new pseudo opcodes for use with Coldfire compatible
programs:
xsave reglist
xrest reglist
The instructions generate the movem sequences required
for Coldfire campatibility. You, as a programmer, do
not have to count the registers for the lea instructions.
The compiler will do that for you and also generate
the lea's.
Library:
Provided 68000/Coldfire usable TOS bindings in case
a project did not include the AHCC specific tos.h
(The one that uses __syscall__).
The library is called "ahcctos.lib".
Have fun!
-
- Moderator
- Posts: 5254
- Joined: Wed Oct 23, 2002 4:36 pm
- Location: Friedrichshafen, Germany
- Contact:
Re: AHCC
Thanks for the update! It's great to have a bugfixed and supported C compiler around. 

Simon Sunnyboy/Paradize - http://paradize.atari.org/
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
AHCC V4.12
LS
A new version available on:
http://members.chello.nl/h.robbers/
Changes:
september 22 2012
v4.12
General:
Changed 'xref' to 'pdb' in all source files
(pdb = Project Data Base, xref.... is only part of it).
Compiler (Coldfire target):
Fixed non Coldfire code for 'move' in some cases.
Also fixed cases where mov3q could have been used, but
was not.
Shell:
Small fix in handling time/date stamps by make.
Pass uppercase masks to fileselecter when run on single TOS.
Assembler:
Fix dc.l name +/- nnnn
where nnnn got lost resulting wrongfully in dc.l name.
Library:
ahccstd*: Added unlink, strcmpi.
Have fun.
A new version available on:
http://members.chello.nl/h.robbers/
Changes:
september 22 2012
v4.12
General:
Changed 'xref' to 'pdb' in all source files
(pdb = Project Data Base, xref.... is only part of it).
Compiler (Coldfire target):
Fixed non Coldfire code for 'move' in some cases.
Also fixed cases where mov3q could have been used, but
was not.
Shell:
Small fix in handling time/date stamps by make.
Pass uppercase masks to fileselecter when run on single TOS.
Assembler:
Fix dc.l name +/- nnnn
where nnnn got lost resulting wrongfully in dc.l name.
Library:
ahccstd*: Added unlink, strcmpi.
Have fun.
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
AHCC V4.13
LS
There is a new vwersion available on
http://members.chello.nl/h.robbers/
Only 1 change:
september 28 2012
v4.13
Compiler(Coldfire target)
Fixed a regression in 4.12 concerning use of 'mov3q' instruction.
There is a new vwersion available on
http://members.chello.nl/h.robbers/
Only 1 change:
september 28 2012
v4.13
Compiler(Coldfire target)
Fixed a regression in 4.12 concerning use of 'mov3q' instruction.
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
AHCC V4.14
LS
There is a new version availble on:
http://members.chello.nl/h.robbers/
october 3 2012
v4.14
General:
Removed leftover traces of a debug session some time ago.
Compiler:
Fixed a bug where a static string was not properly
used (changed without copying)
The bug resulted in incorrect compiling of ahccstdi.lib.
Assembler:
Fixed a regression where incbin statement crashed.
Have fun.
There is a new version availble on:
http://members.chello.nl/h.robbers/
october 3 2012
v4.14
General:
Removed leftover traces of a debug session some time ago.
Compiler:
Fixed a bug where a static string was not properly
used (changed without copying)
The bug resulted in incorrect compiling of ahccstdi.lib.
Assembler:
Fixed a regression where incbin statement crashed.
Have fun.
Re: AHCC
This week i have also started to use AHCC. I like it and want to use it for one of my next projects.
Today i had a problem with #include: I want to include the header file GLOBAL.H into two source files, but i get always an error that my variables are doubly defined. It´s a common problem with C/C++ which can be resolved with an include guard, but it seems that this doesn´t work in AHCC.
Any solution for this problem?
Today i had a problem with #include: I want to include the header file GLOBAL.H into two source files, but i get always an error that my variables are doubly defined. It´s a common problem with C/C++ which can be resolved with an include guard, but it seems that this doesn´t work in AHCC.
Code: Select all
#ifndef __GLOBAL_H
#define __GLOBAL_H
long *pScreenAdr1;
long *pScreenAdr2;
long *pStack = 0;
#endif
>> > raZen/Paradox < <<
Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile
Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile
Re: AHCC
Hello,
variables do not belong into the header files.
you can put something like this into the header file (GLOBALS.H):
extern char *my_variable;
in another c file (maybe GLOBALS.C) you have then:
char * my_variable;
each file which includes GLOBALS.H knows about that variable.
What you are trying isn't an AHCC bug, it's simply wrong.
variables do not belong into the header files.
you can put something like this into the header file (GLOBALS.H):
extern char *my_variable;
in another c file (maybe GLOBALS.C) you have then:
char * my_variable;
each file which includes GLOBALS.H knows about that variable.
What you are trying isn't an AHCC bug, it's simply wrong.

Re: AHCC
Thanks, mOnO. You are right that works!
It´s just a long time ago that i have used pure C and global variables.

It´s just a long time ago that i have used pure C and global variables.

>> > raZen/Paradox < <<
Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile
Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
Re: AHCC
LS
There is a new version available on my Home page
http://members.chello.nl/h.robbers
Changes:
january 10 2014
v5
general:
Back to small version number. (Greetings mister Thorvalds
Replaced 'string' back to char * for single declarators,
to Wstr for declarator lists.
(appeared to be a little confusing)
'const char *' remains 'Cstr'.
I also wanted to reserve 'string' for other C dialects.
Shell:
Some patches provided by Gerhard Stoll regarding
page up/down keys on some Tos's or emulators.
Compiler:
Implemented Pure C style inlining:
e.g. a prototype specifying a value;
e.g. short ror(short v, short c) 0161170;
short rol(short v, short c) 0161570;
'is' or <=> between prototype and value will be silently
accepted.
Small changes regarding 'void'.
Some invisible reorganization and refactoring.
Check on a expression's side effects.
Notifications "code has no effect".
More fixes regarding 'const' (type qualifiers in general).
Accept empty arguments in macros.
If the argument is anywhere used, the consequences are
for the programmer.
New header <rotate.h>
Fixed wrong code for comparing constants to zero (rare
There is a new version available on my Home page
http://members.chello.nl/h.robbers
Changes:
january 10 2014
v5
general:
Back to small version number. (Greetings mister Thorvalds
Replaced 'string' back to char * for single declarators,
to Wstr for declarator lists.
(appeared to be a little confusing)
'const char *' remains 'Cstr'.
I also wanted to reserve 'string' for other C dialects.
Shell:
Some patches provided by Gerhard Stoll regarding
page up/down keys on some Tos's or emulators.
Compiler:
Implemented Pure C style inlining:
e.g. a prototype specifying a value;
e.g. short ror(short v, short c) 0161170;
short rol(short v, short c) 0161570;
'is' or <=> between prototype and value will be silently
accepted.
Small changes regarding 'void'.
Some invisible reorganization and refactoring.
Check on a expression's side effects.
Notifications "code has no effect".
More fixes regarding 'const' (type qualifiers in general).
Accept empty arguments in macros.
If the argument is anywhere used, the consequences are
for the programmer.
New header <rotate.h>
Fixed wrong code for comparing constants to zero (rare
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
Re: AHCC
A new version is available at
http://members.chello.nl/h.robbers/
Changes:
september 18 2014.
v5.1
Shell:
KIT::match options:
4 radio buttons
word, any, prefix, postfix
The latter very useful for finding usage of
struct/union members e.g. ->large, not ->larger
A few better names in the big window struct. (IT)
Comparing folders streamlined. see Compare Folders.
Comparing files streamlined. see Compare 2.
Editor:
Fixed a small bug where UNDO involved the first line in
some cases.
Optional line numbers: New check button in the KIT.
Handled similar to 'small font' and 'boldtags' options.
Compiler:
Fixed a discrepancy in struct alignment between
Pure C and AHCC.
(Only important when mixing AHCC and Pure C object files).
Fixed a bug where a arg in a register got clobbered with
indirect calling via a call returning in A0.
Assembler:
pseudo op 'xrest': registerlist properly flipped (as for movem).
Have fun.
H.Robbers
http://members.chello.nl/h.robbers/
Changes:
september 18 2014.
v5.1
Shell:
KIT::match options:
4 radio buttons
word, any, prefix, postfix
The latter very useful for finding usage of
struct/union members e.g. ->large, not ->larger
A few better names in the big window struct. (IT)
Comparing folders streamlined. see Compare Folders.
Comparing files streamlined. see Compare 2.
Editor:
Fixed a small bug where UNDO involved the first line in
some cases.
Optional line numbers: New check button in the KIT.
Handled similar to 'small font' and 'boldtags' options.
Compiler:
Fixed a discrepancy in struct alignment between
Pure C and AHCC.
(Only important when mixing AHCC and Pure C object files).
Fixed a bug where a arg in a register got clobbered with
indirect calling via a call returning in A0.
Assembler:
pseudo op 'xrest': registerlist properly flipped (as for movem).
Have fun.
H.Robbers
- DrCoolZic
- Fuji Shaped Bastard
- Posts: 2261
- Joined: Mon Oct 03, 2005 7:03 pm
- Location: France
- Contact:
Re: AHCC
First of all thanks for the work you are doing with AHCC. I have been using it on several projects some time ago (v4.1) and was very pleased especially by the library implementation that is more efficient than the one from PureC…
I am currently working on some code that I did not wrote and that compiles without problem on Pure C but unfortunately I have several problems with AHCC
1) Comment problem/improvement
One of the .c file includes a .h file that has a problem in a comment:
The compiler reports “EOF in comment” in the line of the .c file that include the .h file. Would be nice to indicate that the EOF is in the included file or to report the problem in the .h file.
The included file has over 1600 lines and it was very difficult to find where the problem happen. It would therefore be nice if you could indicates at least the start of the first comment that includes the second comment to help in pinpointing the problem.
2) Side note
When I first unchecked the –c option of the compiler nothing changed? I found that in order for an option to be activated you have to close the KIT window (of course same thing happen for any change in compiler /linker options)? Would be nice to at least indicate in the KIT window that one or several options has changed and that you need to close the window for them to be validated? Or better do an auto-save of the configuration before and compilation happen?
3) casting bug?
One line in the source contains several casting.
Something like:
Although not best way of coding this is valid C language that should compile and produce good code. AHCC complains with strange ERROR messages and stops.
Unfortunately this type of casting is used in many places in the code and I had to get back to PureC to compile these modules. Are you aware of this problem and can it be fixed?
I am currently working on some code that I did not wrote and that compiles without problem on Pure C but unfortunately I have several problems with AHCC
1) Comment problem/improvement
One of the .c file includes a .h file that has a problem in a comment:
Code: Select all
/* first comment not ended
/* second comment ended correctly */
The included file has over 1600 lines and it was very difficult to find where the problem happen. It would therefore be nice if you could indicates at least the start of the first comment that includes the second comment to help in pinpointing the problem.
2) Side note
When I first unchecked the –c option of the compiler nothing changed? I found that in order for an option to be activated you have to close the KIT window (of course same thing happen for any change in compiler /linker options)? Would be nice to at least indicate in the KIT window that one or several options has changed and that you need to close the window for them to be validated? Or better do an auto-save of the configuration before and compilation happen?
3) casting bug?
One line in the source contains several casting.
Something like:
Code: Select all
int a,b=1,c=1;
a = (int)((double)b/(double)c);
Unfortunately this type of casting is used in many places in the code and I had to get back to PureC to compile these modules. Are you aware of this problem and can it be fixed?
Visit *** http://info-coach.fr/atari ***
- DrCoolZic
- Fuji Shaped Bastard
- Posts: 2261
- Joined: Mon Oct 03, 2005 7:03 pm
- Location: France
- Contact:
Re: AHCC
I have tried the following interesting program
I am getting three errors for the second line (code as no effect, undifined double ...) and one error for third line ?
?????????????
Code: Select all
int sum = 17, count = 5;
double mean;
mean = (double) sum / count;
?????????????
Visit *** http://info-coach.fr/atari ***
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2281
- Joined: Sun Jul 31, 2011 1:11 pm
Re: AHCC
Can you provide the whole C-file, or a minimized version?DrCoolZic wrote:I have tried the following interesting program
I am getting three errors for the second line (code as no effect, undifined double ...) and one error for third line ?Code: Select all
int sum = 17, count = 5; double mean; mean = (double) sum / count;
Sometimes include files define something that causes "interesting" things to happen, because their defines aren't "name-spaced" with suitable prefix.
- DrCoolZic
- Fuji Shaped Bastard
- Posts: 2261
- Joined: Mon Oct 03, 2005 7:03 pm
- Location: France
- Contact:
Re: AHCC
create file test.c that contains
No include nothing more than what I show
and compilation fails with many errors.
I have discovered that AHCCST does not seems to be provided with a floating point library. But this should be a linker error not a compiler error. double is part of the language!
Code: Select all
void test() {
int s=14, c=3;
double m;
m = (double) s/c;
}
and compilation fails with many errors.
I have discovered that AHCCST does not seems to be provided with a floating point library. But this should be a linker error not a compiler error. double is part of the language!
Visit *** http://info-coach.fr/atari ***
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
Re: AHCC
When creating AHCCST I wanted to be as secure and rogorous as possible. So I removed anything that even smelled like floating point.
Remember that AHCCST was created for reducing memory usage for ST users not needing floating point.
Henk.
Remember that AHCCST was created for reducing memory usage for ST users not needing floating point.
Henk.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2281
- Joined: Sun Jul 31, 2011 1:11 pm
Re: AHCC
The different AHCC IDE programs are:
- ahcc.prg: IDE for building 68020+ (TT/Falcon/clone) binaries. Binaries using floating point should be compiled with "-2 -8" (020+FPU) options and they won't work with (unmodified ST, STE and Falcon) machines that don't have FPU
- ahccst.prg: IDE for building 68000 binaries that work on all 680x0 machines (ST/STE/TT/Falcon). Binaries compiled with this should link to 'i' (integer) version of a library when such is available as this AHCC version doesn't have any floating point support
- ahcccf.prog: IDE for building ColdFire (FireBee) binaries. Binaries compiled with this should be compiled with the "-7" option and link to 'cf' (ColdFire) or 'f' version of a library when such is available
- DrCoolZic
- Fuji Shaped Bastard
- Posts: 2261
- Joined: Mon Oct 03, 2005 7:03 pm
- Location: France
- Contact:
Re: AHCC
I thought that you just did not provide the floating point library with AHCC but that we could use the binary compatible PureC floating point library ...Henk Robbers wrote:When creating AHCCST I wanted to be as secure and rogorous as possible. So I removed anything that even smelled like floating point.
Remember that AHCCST was created for reducing memory usage for ST users not needing floating point.
Henk.
Did not know about the goal you just mention. I believed that the goal was just to replace Pure C with a maintained compiler.
Visit *** http://info-coach.fr/atari ***
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
Re: AHCC
That was indeed my intention. Alas, I was too lazy to replace the (rather big) Pure C floating point library. So I took the easiest way:DrCoolZic wrote:I believed that the goal was just to replace Pure C with a maintained compiler.
68020+ fp by FPU,
68000 No fp at all.
Long ago I asked in a news group (c.s.a.programmer ?) whether someone was interested to create such a library. Got no response.
Henk.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2281
- Joined: Sun Jul 31, 2011 1:11 pm
Re: AHCC
For floating point emulation on 68000, one could use PML, like some other free Atari compilers did. Not sure how much effort it will need to get it working with AHCC though.
- DrCoolZic
- Fuji Shaped Bastard
- Posts: 2261
- Joined: Mon Oct 03, 2005 7:03 pm
- Location: France
- Contact:
Re: AHCC
In some cases your implementation of standard libraries is much more efficient that the one provided with Pure C.
So if we need floating point is it possible to use Pure C compiler but link with AHCC libraries?
So if we need floating point is it possible to use Pure C compiler but link with AHCC libraries?
Visit *** http://info-coach.fr/atari ***
-
- AHCC Developer
- Posts: 39
- Joined: Mon Nov 14, 2011 2:37 pm
Re: AHCC
Please study math.h.DrCoolZic wrote:In some cases your implementation of standard libraries is much more efficient that the one provided with Pure C.
So if we need floating point is it possible to use Pure C compiler but link with AHCC libraries?
All incarnations of AHCC implement overloading of existing operators.
This way one can specify routines for every operation involving floating point.
In case of AHCCST one must design his own floating point format and declare it as a structure type.
(e.g. the 96 bit Pure C software floating point type).
Re: AHCC
Hello, I found an bug in AHCC 4.14 with the KIT.
Select "Small Font" -> the window font changes
Exit AHCC and open the KIT and a file... altough "Small Font" is still displayed as checked, the font is large.
Greets
Select "Small Font" -> the window font changes
Exit AHCC and open the KIT and a file... altough "Small Font" is still displayed as checked, the font is large.
Greets
Re: AHCC
I have been using AHCC on my Firebee for a while now, but using the version that came with the machine, version 4.10 I think it is.
I recently downloaded version 5.1 and hit a problem: function prototypes seem to be ignored. In a program such as:
When compiled in 5.1 I get a warning on 'say_hello' inside main: no prototype, and then an error at the definition of say_hello, as the definition does not match the (default) prototype.
The program compiles fine in version 4.10 (same code, same prj etc).
This looks like an error to me in version 5.1 ?!
I recently downloaded version 5.1 and hit a problem: function prototypes seem to be ignored. In a program such as:
Code: Select all
#include <stdio.h>
void say_hello ();
void main () {
say_hello ();
}
void say_hello () {
printf ("hi\n");
}
The program compiles fine in version 4.10 (same code, same prj etc).
This looks like an error to me in version 5.1 ?!
Re: AHCC
IMO you must also declare the parameters to functions (In your case: void), I think this should do the job:
Code: Select all
#include <stdio.h>
void say_hello (void);
void main () {
say_hello ();
}
void say_hello (void) {
printf ("hi\n");
}