Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Inline assembly and C variables

2006-05-07 by Robert Adsett

At 11:15 AM 5/6/2006 +0000, MB wrote:
>I'm trying to use C variables inside inline assembly code, but can't
>get it to work (the compiler is gcc).
>
>static const short g_psMyArray asm("g_psAsmMyArray:") =
>{ 1, 2, 3, 4};
>
>void myfunc()
>{
>     asm("ADRL  r14, psAsmMyArray");
>}
>
>This results with an error (something like "symbol is undefined in
>current file").

Why not just use C?  What's the advantage you are expecting that's 
compelling you to use assembly?

If you can provide a little more detail maybe we can solve the problem in 
another way.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.