Re: [cc65] void* pointer to asm sequence?

From: thefox xofeht <thefox1aspekt.fi>
Date: 2013-02-02 14:18:37
On Sat, Feb 2, 2013 at 12:15 PM, Stefan <vorsichtphysiker@gmx.net> wrote:

> Is something like:
>
> void *foo = {asm("nop"), asm("nop"), asm("nop")};
>
> possible, so that foo points to a sequence of assembler commands? If it is
> clear, that code is written for 6502 machines,
> there would be no portability issues.
>

Make a function out of it, then assign the function pointer to foo:

void bar( void )
{
  asm("nop");
  asm("nop");
  asm("nop");
}

void* foo = bar;

-thefox

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Feb 2 14:18:46 2013

This archive was generated by hypermail 2.1.8 : 2013-02-02 14:18:50 CET