Yahoo Groups archive

Lpc2000

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

Message

Re: Outputing the Link Regisister

2006-04-08 by gert_vervoort

--- In lpc2000@yahoogroups.com, "fordp2002" <SimonEllwood@...> wrote:

> Does anybody know how to get the contents of the Link Register into a
> 32 bit C Varible.
> 
> Maybe I need a bit of inline assembeler ;)
> 


This should do the trick:


#include <stdio.h>

main()
{
        register unsigned int *lr_ptr asm("r14");

        printf("0x%X\n", lr_ptr);

        return 0;
}

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.