Hi,
I'm working on a home project (embedded using Palm IIIx) and am having trouble writing to the system address space. I'm trying to write to the register that controls the cursor size. I can write to it ok using gdb (set *0xfffffa1c=0x1f1f), but the following program does nothing:
typedef unsigned short WORD; #define LCD_CURSOR_W_H *((volatile WORD *) 0xfffffa1c) // LCWCH
int main(void) { LCD_CURSOR_W_H = 0x1f1f;
while(1);
return 0; }
I compiled with prc-tools (gcc version 2.95.3) running in cygwin and with a cross compiler I built and ran on my linux box using gcc version
3.4.3. That gcc's -v: Configured with: ../../source/gcc-3.4.3/configure --target=m68k-elf --prefix=/usr/ local/m68k --with-newlibHere's the output of objdump -S on main.o (same for both except for how while(1) is handled:
int main(void) { 0: 4e56 0000 linkw %fp,#0 LCD_CURSOR_W_H = 0x1f1f; 4: 31fc 1f1f fa1c movew #7967,fffffa1c
while(1); a: 60fe bras a c: 4e71 nop
Notice the odd 3B machine code output for the assembler line "movew...". I don't think that's right--wheres the preceeding word of
0xffff for the address? It looks like a bug, but how could it have gone unnoticed all this time? I must be doing something dumb. Geesh this should be easy. :) Please enlighten me!Jim