Jump to content
Excelsior Forums
White-Elephant

XDS-C Fatal F450

Recommended Posts

Hi,

When compiling the following very small modula-2 example we get the message

XDS Modula-2 v2.40 [ANSI C v4.20] - build 10.05.2005

Compiling "Fatal.Mod"

* [*** 0.00 F450]

* compilation aborted: type guard check

which we don't understand.

Any ideas what we are doing wrong?

We compiled by:

xm +m2addtypes +m2extensions +nooptimize Fatal.Def

xm +m2addtypes +m2extensions +nooptimize Fatal.Mod > Fatal.Err

Fatal.Def

DEFINITION MODULE Fatal;

FROM SYSTEM IMPORT ADDRESS;

TYPE

  TransferArea = ARRAY [0..15] OF CARDINAL;

VAR

  TRANRAM [ADDRESS(0FFFFFC00H)] : TransferArea;

END Fatal.

Fatal.Mod

IMPLEMENTATION MODULE Fatal;

END Fatal.

:huh:

Share this post


Link to post
Share on other sites

Possible workarounds:

- If you use TRANRAM only within this module, remove TRANRAM from the definition module to the implementation one.

- Declare not variable at the fixed address, but pointer to:

DEFINITION MODULE Fatal;

FROM SYSTEM IMPORT ADDRESS;

TYPE

  TransferArea = ARRAY [0..15] OF CARDINAL;

  PTransferArea = POINTER TO TransferArea;

VAR

  TRANRAM: PTransferArea;

END Fatal.

Fatal.Mod

IMPLEMENTATION MODULE Fatal;

BEGIN

  TRANRAM := PTransferArea(ADDRESS(0FFFFFC00H));

END Fatal.

Unfortunately, in this case you need to change the other modules as well (TRANRAM^).

Share this post


Link to post
Share on other sites

TRANRAM is used by other modules which is why it is placed in the def

Using a variable pointer to access it not only requires that

we alter all the code that accesses this memory mapped device

but adds an extra level of redirection thereby making the code less efficient.

If this is a compiler bug what are the chances of it getting fixed?

Can we somehow pay for it to be fixed?

Ie is there a level of support we can purchase

that will enable us to get minor compiler bugs corrected?

Ahlan

Share this post


Link to post
Share on other sites

To answer your question we need to make an analysis of the problem. Usually a payment makes such analysis much easier.  ;)

Seriously, I can't understand how to declare a variable placed to the fixed address like TRANRAM [ADDRESS(0FFFFFC00H)] : TransferArea in C? Do you have any ideas?

Share this post


Link to post
Share on other sites

White-Elephant, what compiler were you using before?

Sleepyhead, I am not quit sure what you are asking.  In C, you can specify a pointer to a fixed location via the usual gobbly-gook:  char *TRANRAM = (char *)0xFFFFFC00;  How would this help?

john

Share this post


Link to post
Share on other sites

We were using a Modula-2 compiler

for Motorola Mc68332

produced by the company HiWare.

We are interested in converting our Modula

to ANSI C so that we can eventually port the

application to other hardware (probably Coldfire)

Note TRANRAM should be a constant pointer.

Ahlan

Share this post


Link to post
Share on other sites

XDS-C is designed to be used as a "via C" compiler. It is not suitable for the conversion of Modula-2 source to C. In particular, XDS-C does not preserve constant expressions and comments and uses macros extensively, so the resulting code is difficult to read and maintain, not to mention further development.

We have a true Modula-2 to C/C++ converter available on a semi-custom basis. It may be customized to better fit your Modula-2 dialect and library set, conversion rules, output formatting requirements, and any other needs you may have.

Alternatively, we could convert your software for you and optionally port it to the platform(s) of your choice.

If you are interested, Ahlan, could you please email us or fill in the RFP form?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×