OS_GetEnv result

Alex Waugh alex at alexwaugh.com
Sat Aug 3 14:09:17 PDT 2002


In message <5ab762604b.Jo at hobbes.riscos.be>
          John Tytgat <John.Tytgat at aaug.net> wrote:

> I think the following would be easier:
>
> 	;Gets the __riscosify_control value which can be defined by
> 	;the global variable __riscosify_control in the user program.
> 	;Returns 0 (= default value) when not defined.
> 	;
> 	;int __get_riscosify_control(void)
> 	IMPORT	|__riscosify_control|, WEAK
> 	EXPORT	|__get_riscosify_control|
> 	NAME	"__get_riscosify_control"
> |__get_riscosify_control|
> 	LDR	a1, =|__riscosify_control|
> 	TEQ	a1, #0
> 	LDRNE	a1, [a1, #0]
> 	return	AL, pc, lr
> 
> And somewhere.h:
> 
> int __get_riscosify_control(void);

Yes, that's a bit nicer.

Alex

-- 
Alex Waugh                               alex at alexwaugh.com

PHP, Roots, WebJames and more from http://www.alexwaugh.com/



More information about the gcc mailing list