Originally Posted by
itCbitC
Not sure what the above statement means? Do you mean IDE specific functions?
Can you assemble m68k source in traditional mode so that MULTI IDE doesn't embed any of its own code.
Really can't say unless you specify what "program-specific functions embedded" means.
A better solution would be to convert the existing m68k assembly file into C - don't have to worry about cross-compilation.
Now there are two C language files and portability isn't a headache anymore.
Nope! it is not. The assembly process stops when the S record file is generated. There is no object module created. This process is used mostly for embedded applications where the host and target systems are different. The S-record file is then uploaded to the target machine thro' either a programmer or a serial interface.
Sorry, I didn't explain that well. MULTI uses some different instructions for its assembly files that aren't used in regular m68k assembly.
Converting to C sounds like it would relieve a lot of the headache. However after searching around it seems like it would be a pretty tough task, especially since I don't know assembly very well (I didn't write these files). Perhaps you could look at the code and see if it's something worthwhile?
In the c code, the function to call the assembly function is:
Code:
void XProcess(Function_ptr XAddr)
{
if (PrintLevel < 2)
fprintf(OutputFile, "Execute AP procedure at address %08X\n", XAddr);
// If valid address then execute
if ( ValidAddress((UInt32)XAddr, 1) )
XPrc(XAddr); //Calls assembly function
else
ErrorHandler(ErrInvalidAddress, 30, 0, 0, NULL);
} // End XProcess
This is the assembly function that the c code calls:
Code:
/* Procedure XPrc (Function_ptr ProcAddress);
*
* XPrc saves all registers; calls the AP program;
* and restores the registers.
*/
.data
/* Register storage area */
RegisterStorage:
DS.L 15
.global XPrc
XPrc:
MOVEM.L %D0/%D1/%D2/%D3/%D4/%D5/%D6/%D7/%A0/%A1/%A2/%A3/%A4/%A5/%A6,RegisterStorage
LINK %A6,#-(10)
MOVE.L 8(%A6),%A2
/* Call AP program at address in A2 */
JSR (%A2)
MOVE.L (%A7)+,%A4
UNLK %A6
MOVE.L (%SP)+,%A0
ADD #0x8,%SP
MOVE.L %A0,-(%SP)
MOVEM.L RegStore,%D0/%D1/%D2/%D3/%D4/%D5/%D6/%D7/%A0/%A1/%A2/%A3/%A4/%A5/%A6
RTS