Re: [cc65] indirect load question...

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2009-03-03 21:19:46
Hello,

* On Tue, Mar 03, 2009 at 11:52:20AM -0800 Dirk Jagdmann wrote:
> > My question is, since these all (should) refer to the same memory
> > location ( 0x0284 ), they should produce the same output. The correct
> > output value is '1', not 225. Is there some issue with doing indirect
> > loads ( de-referencing an unsigned  char * )?
> 
> You did not set mouse_port to any value yet!
> 
> How about:
> 
> static volatile unsigned char *mouse_port=(unsigned char*)STRIG0;

What about:

static volatile unsigned char * const mouse_port = (unsigned char * const )STRIG0;

The const prevents accidentially setting mouse_port to something
different without a little bit more effort. It might also produce some
more efficient code (although, I did not test it for cc65).

Regards,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Mar 3 21:20:11 2009

This archive was generated by hypermail 2.1.8 : 2009-03-03 21:20:13 CET