m68k-coff SP changing

Toshi Morita tm2@best.com
Tue Apr 3 15:50:00 GMT 2001


> Does anyone know why the following instructions change my SP?
> My target is m68k-coff.
> 
> Thanks
> 
> 0x858 in _stext ()
> 3: /x $fp = 0x7f8
> 2: x/i $pc  0x858 <_stext+88>:  movew #30960,0xfffa52
> 1: /x $sp = 0x7fc
> (gdb) 
> _main () at test.c:9
> 9       static void _main (void) {
> 3: /x $fp = 0x7f8
> 2: x/i $pc  0x860 <_main>:      linkw %fp,#-4
> 1: /x $sp = 0x7fc
> (gdb) 
> 12        LCD_MR0 = 0x18; 
> 3: /x $fp = 0x7f8
> 2: x/i $pc  0x864 <_main+4>:    moveb #24,0x41ffe1
> 1: /x $sp = 0x7f4
> (gdb) 
> 13        LCD_MR1 = 0xb0; 
> 3: /x $fp = 0x7f8
> 2: x/i $pc  0x86c <_main+12>:   moveb #-80,0x41ffe2
> 1: /x $sp = 0x7f0
> (gdb) 
> 15        LCD_HPS = 0x27;       /* 320 / 8 - 1 in hex */
> 3: /x $fp = 0x7f8
> 2: x/i $pc  0x874 <_main+20>:   moveb #39,0x41ffe4
> 1: /x $sp = 0x7ec

I'd guess your exception handler has a bug.

Toshi



More information about the Binutils mailing list