AHCC

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC V4.11

Postby Henk Robbers » Wed May 30, 2012 1:29 pm

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!

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4774
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: AHCC

Postby simonsunnyboy » Wed May 30, 2012 3:50 pm

Thanks for the update! It's great to have a bugfixed and supported C compiler around. 8)
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC V4.12

Postby Henk Robbers » Sat Sep 22, 2012 12:18 pm

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.

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC V4.13

Postby Henk Robbers » Thu Sep 27, 2012 4:40 pm

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.

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC V4.14

Postby Henk Robbers » Tue Oct 02, 2012 1:47 pm

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.

RA_pdx
Captain Atari
Captain Atari
Posts: 214
Joined: Sun Feb 02, 2003 12:01 pm
Location: Nuernberg/GERMANY

Re: AHCC

Postby RA_pdx » Sat Jan 12, 2013 10:31 pm

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.


Code: Select all

#ifndef __GLOBAL_H
#define __GLOBAL_H

long *pScreenAdr1;
long *pScreenAdr2;

long *pStack = 0;

#endif


Any solution for this problem?
>> > raZen/Paradox < <<

Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile

m0n0
Captain Atari
Captain Atari
Posts: 417
Joined: Mon Oct 05, 2009 3:13 am

Re: AHCC

Postby m0n0 » Sat Jan 12, 2013 11:21 pm

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. :)

RA_pdx
Captain Atari
Captain Atari
Posts: 214
Joined: Sun Feb 02, 2003 12:01 pm
Location: Nuernberg/GERMANY

Re: AHCC

Postby RA_pdx » Sun Jan 13, 2013 8:29 am

Thanks, mOnO. You are right that works! :)
It´s just a long time ago that i have used pure C and global variables. :wink:
>> > raZen/Paradox < <<

Atari 1040STE, TOS 2.06, 4MB, MC68010, IDE 8GB SSD, Gigafile

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Thu Jan 09, 2014 3:26 pm

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

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Fri Sep 26, 2014 8:00 pm

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

itaboy
Captain Atari
Captain Atari
Posts: 173
Joined: Sun May 04, 2014 6:24 pm

Re: AHCC

Postby itaboy » Fri Sep 26, 2014 10:55 pm

Thanks!!! Downloaded. I will try it tomorrow. Thank you for your grat job. It's very appreciated

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: AHCC

Postby DrCoolZic » Fri Oct 17, 2014 8:40 am

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:

Code: Select all

/* first comment not ended
/* second comment ended correctly */

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:

Code: Select all

int a,b=1,c=1;
a = (int)((double)b/(double)c);

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?

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: AHCC

Postby DrCoolZic » Fri Oct 17, 2014 12:32 pm

I have tried the following interesting program

Code: Select all

int sum = 17, count = 5;
double mean;
mean = (double) sum / count;


I am getting three errors for the second line (code as no effect, undifined double ...) and one error for third line ?

?????????????

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: AHCC

Postby Eero Tamminen » Fri Oct 17, 2014 8:52 pm

DrCoolZic wrote:I have tried the following interesting program

Code: Select all

int sum = 17, count = 5;
double mean;
mean = (double) sum / count;


I am getting three errors for the second line (code as no effect, undifined double ...) and one error for third line ?


Can you provide the whole C-file, or a minimized version?

Sometimes include files define something that causes "interesting" things to happen, because their defines aren't "name-spaced" with suitable prefix.

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: AHCC

Postby DrCoolZic » Fri Oct 17, 2014 9:46 pm

create file test.c that contains

Code: Select all

void test() {
   int s=14, c=3;
   double m;
   m = (double) s/c;
}

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!

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Mon Oct 20, 2014 9:22 pm

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.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: AHCC

Postby Eero Tamminen » Tue Oct 21, 2014 9:00 pm

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

Btw. this info is from my Atari devel page: http://koti.mbnet.fi/tammat/hatari/devel.shtml

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: AHCC

Postby DrCoolZic » Wed Oct 22, 2014 10:31 am

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.

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 ...
Did not know about the goal you just mention. I believed that the goal was just to replace Pure C with a maintained compiler.

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Tue Nov 04, 2014 9:47 pm

DrCoolZic wrote:I believed that the goal was just to replace Pure C with a maintained compiler.


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:
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.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: AHCC

Postby Eero Tamminen » Wed Nov 05, 2014 7:19 pm

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.

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2144
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: AHCC

Postby DrCoolZic » Thu Nov 06, 2014 10:28 am

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?

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Tue Nov 11, 2014 9:33 pm

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?


Please study math.h.

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).

m0n0
Captain Atari
Captain Atari
Posts: 417
Joined: Mon Oct 05, 2009 3:13 am

Re: AHCC

Postby m0n0 » Thu Dec 18, 2014 9:16 pm

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

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Sat Jun 06, 2015 11:00 am

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:

Code: Select all

#include <stdio.h>

void say_hello ();

void main () {
  say_hello ();
}

void say_hello () {
   printf ("hi\n");
}


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 ?!
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

m0n0
Captain Atari
Captain Atari
Posts: 417
Joined: Mon Oct 05, 2009 3:13 am

Re: AHCC

Postby m0n0 » Sat Jun 13, 2015 1:57 pm

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");
}


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests