[cc65] indirect load question...

From: Winslow, Dan D (US SSA) <dan.winslow1baesystems.com>
Date: 2009-03-03 20:29:07
The following program :

 

#include <conio.h>

 

#define STRIG0 0x0284

#define STRIG1 0x0285

static unsigned char *mouse_port;

unsigned char mval=0;

 

void main( void )

{

  cprintf("mouse_port=%i\r\n",*((unsigned char *)(0x0284)) );

  cprintf("mouse_port=%i\r\n",*mouse_port);

  mval=*mouse_port; 

  cprintf("mouse_port=%i\r\n",mval);

}

 

 

Produces the following output :

 

mouse_port=1

mouse_port=225

mouse_port=225

 

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 * )?

 

Dan Winslow

Third Nerd from the Left, Technology Defenestration Office

Senior SW Engineer, JMPS FW

BAE Systems, NS

Omaha NE 68005

402-827-5854

 


----------------------------------------------------------------------
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 20:29:21 2009

This archive was generated by hypermail 2.1.8 : 2009-03-03 20:29:23 CET