avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Jmp'ing to address / 2?


From: Stuart Whelan
Subject: [avr-gcc-list] Jmp'ing to address / 2?
Date: Thu, 5 Oct 2006 15:24:16 +1300

Hi Folks,

I am using gcc 3.4.4 and avr-libc 1.4.4 on win32....

I have been using the CodeVision compiler for a long time, 
but have decided to port my projects to gcc-avr.

My application jumps to the bootloader on receipt of jump 
to bootloader command, but the jmp I am using seems to 
be doing strange things. I cut it done down to the 
smallest test:

main()
{
        asm volatile("jmp 0x1c00"::);
}

And compiled it with:

avr-gcc -mmcu=atmega16 -o foo.obj foo.c 

And the jmp command comes out as:
  96:   0c 94 00 0e     jmp     0x1c00 <__stack+0x17a1>

Now if I read that correctly, it is jmp'ing to 0e00, 
not 1c00.. I notice that 0e00 is 1c00/2...

When I step through this in the debugger, the program 
counter does indeed jump to 0e00, not 1c00.

Can anyone shed some light on this for me?

Kind Regards,
Stuart Whelan
Technical Director
Pacific Simulators International Ltd

DDI:      +64  3 9828866 x700
Mobile:   +64 27 2828074

Recursion: See Recursion. 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]