#: 16362 S12/OS9/68000 (OSK)
01-Sep-92 08:05:04
Sb: #16358-Combining C and asm
Fm: Kevin Darling 76703,4227
To: Bob van der Poel 76510,2203 (X)
Bob,
Well, I guess you could simply include the assembler equate, too:
#define FOO 12345
#asm
FOO equ 12345
#endasm
But what I do instead is to take such constants, and store them as variables:
#define FOOVAL 12345
static int foo; /* foo is a variable */
void setfoo() /* This function called by main on init */
{
foo = FOOVAL;
}
void dofoo() /* This function called to use foo from asm */
{
#asm
move.l foo(a6),d0
...
#endasm
}
|