#define using special function register names yields error

Discussion of issues related to writing ZBasic applications for targets other than ZX devices, i.e. generic targets.
Post Reply
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

#define using special function register names yields error

Post by stevech »

Not sure why these get a compiler error

Code: Select all

#define SS_DDR DDRB
#define SS_PORT PORTB
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: #define using special function register names yields err

Post by dkinzer »

stevech wrote:Not sure why these get a compiler error
The problem is that DDR is not a known identifier. The special construction Register.DDR evaluates to the address of the DDR register on the particular device and can thus be used as the source or destination for a value.

The #define construction in ZBasic does not have the full text substitution capability of the C preprocessor.
- Don Kinzer
Post Reply