#: 16361 S12/OS9/68000 (OSK)
01-Sep-92 06:48:19
Sb: #16358-#Combining C and asm
Fm: Bob Santy 76417,714
To: Bob van der Poel 76510,2203 (X)
Bob:
Sorry if you think this is a kludge, but it works! Try a coding style like
this:
#asm
FOO set 12345
#endasm
extern int FOO; /* if C source will need the definition */
cfunction()
{
int x = FOO;
#asm
move.l #FOO,d0
#endasm
printf( "%d\n", x );
}
The example shows a definition (once in assembler) that can be seen by asm AND
C. Granted it isn't terribly clean. Hope this helps.
Bob
There is 1 Reply.
|