ELEKTRO FORUM

Elektroforum
It is currently January 9, 2009, 4:57 pm

All times are UTC





Post new topic Reply to topic  [ 1 posts ] 
Author Message
PostPosted: 2008-02-03 03:08:59
Online
Registered User

Joined: 2008-02-03 03:08:59
Hallo Gruppe,

und gerade ist mir beim Herumspielen noch etwas aufgefallen: Wenn ich
aus einer C-Datei, die ich mit avr-gcc übersetze auf einem AVR
einen
absoluten Jump einfügen will, ohne das jmp-Kommando zu verwenden
(das
unterstützen einige Einheiten ja nicht), muss ich auf rjmp
ausweichen.
Damit das automatisch die aktuelle Adresse verwendet:

asm volatile ("JumpLbl: rjmp .+0x100 - JumpLbl");

führt im Code dazu:

274: 73 cf rjmp .-282 ; 0x15c

d.h. immer 0x5c Bytes zu weit. Wenn ich diese 0x5c immer abziehe

asm volatile ("JumpLbl: rjmp .+0x100 - JumpLbl - 0x5c");

dann klappt es - aber eine "saubere" Lösung ist das
nicht. Insbesondere
denke ich mal, dass diese 0x5c davon abhängen für
welches Device ich
übersetze (Anzahl der Interruptvektoren u.ä.).
Ich nehme an, dass diese
Differenz damit zusammenhängt, dass das "JumpLbl"
Label aufgelöst wird,
bevor der Code reloziert ist (also vor dem Linkerskript). Wie bekomme
ich das Deviceunanhängig hin?

Viele GrÃ¼Ãźe,
Johannes

--
"PS: Ein Realname wäre nett. Ich selbst nutze nur keinen,
weil mich die
meisten hier bereits mit Namen kennen." -- Markus Gronotte aka Makus /
Kosst Amojan / maqqusz / Mr. G / Ferdinand Simpson / Quartillia
Rosenberg in dse <45608268$0$5719$9b4e6d93@newsspool3.arcor-online.net>


Top
 Profile
 
Post new topic Reply to topic  [ 1 posts ] 

Who is online

Users browsing this forum: Sven Vogel <no spam-birdyman@web.de>,Christoph Haselau <christoph.haselau@gmx.de>,Markus-Beier@gmx.net (Markus),Georg Sauthoff <g sauthoff@web.de>,chrisco@gmx.net (Christian Colberg), 3 guests, sprzęt budowlany Szkolenia kody pocztowe imprezy w krakowie dom w wejherowie


New posts New posts    No new posts No new posts    Announce Announcement
New posts [ Popular ] New posts [ Popular ]    No new posts [ Popular ] No new posts [ Popular ]    Sticky Sticky
New posts [ Locked ] New posts [ Locked ]    No new posts [ Locked ] No new posts [ Locked ]    Moved topic Moved topic
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group