Subject:
|
Re: H8 bit operations (was Re: GNU C wizards?)
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 5 Jan 1999 08:41:16 GMT
|
Original-From:
|
John A. Tamplin <jat@traveller.comSPAMCAKE>
|
Viewed:
|
2000 times
|
| |
 | |
Ok, after more investigation the problem is twofold:
1) The compiler doesn't look at an absolute address (such as generated by
#define P6DR (*(volatile unsigned char *)0xFFBB) and then used by P6DR=0).
Instead, it looks for an attribute __eightbit_data__ on a symbol.
With the standard configuration, you can't set that attribute on
external symbols and you have to initialize it. I have changed it
so you can have a header file containing something like:
extern volatile unsigned char P6DR __attribute__((__eightbit_data__));
and then define them in an assembler file like this:
.global _P6DR
.equ _P6DR,0xFFBB
After this change, the compiler properly outputs 8-bit address forms for
references to the 8-bit area.
2) The compiler still insists on loading, modifying, and storing rather than
using bset/etc for many instances. I am not sure why this is happening,
so I still have more work to do.
John A. Tamplin Traveller Information Services
jat@Traveller.COM 2104 West Ferry Way
256/705-7007 - FAX 256/705-7100 Huntsville, AL 35801
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics
|
|
Message is in Reply To:
 | | H8 bit operations (was Re: GNU C wizards?)
|
| (...) After looking into it further, if the compiler has the address in a register (or will use it more than once so it will load it in a register), it does use the bset/bclr instructions. However, there is this in h8300.md: ;; Bitfield operations (...) (26 years ago, 4-Jan-99, to lugnet.robotics)
|
6 Messages in This Thread:           
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|