Borland Turbo C 2.0 for Atari 68000 machines: ODD behavior

Gregory Carter carter at cs.wisc.edu
Sat Apr 6 19:10:13 AEST 1991


I recently had a problem with a compiler for my MEGA STE 4/50.  I was
wondering if any of you can report the same problems with Borland's
compiler?

When I attempt to move 0x03 into the address 0x00ff8e20 I get the
following:

 (unsigned int)(*((unsigned int *)0x00ff8e20L)) = 0x03;
 which translates to:
                       MOVE.W #$0003, $00ff8e20

 Ok, I expect that, thats no problem....BUT when I do this:

 (unsigned int)(*((unsigned int *)0xffff8e20L)) = 0x03;
 which translates to:
                       MOVE.W #$0003, $8e20

This is obviously not correct.

I thought about the compiler cutting 8 bits off the top half of the
address since the 68000 doesn't use this space anyway.  But, this isn't
what I expected.  Anyone know why they (BORLAND) decided to do address
coloring in this fashion?

Its a curiosity right now, but when I was going through my profs unclear,
nonportable, nonfunctional class examples, IT TICKED ME OFF. Made life
generally !pleasant.

Any help greatly appreciated.

Greg Carter
[Looks like a bug to me. -John]
-- 
Send compilers articles to compilers at iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.



More information about the Comp.lang.c mailing list