murf@Apple.COM (Jim Murphy) (11/19/88)
I would like to know if there is a way to provided the same functionality that is provided by MPW to inline direct assembly opcodes into a header file. An example would be the list manager interface where the MPW header file for a List Manager call look likes the following: pascal void LDispose(ListHandle lHandle) = {0x3F3C,0x0028,0xA9E7}: What this does is to push the arguments onto the stack then execute the following: MOVE.L #$0028,-(SP) ; push package selector _Pack0 ; call the package The advantage to this approach is that the arugment(s) are only pushed onto the stack once. In lightspeed C the only why I have seen to do this is to take each of the package routines and make an inline asm function. However, the code generated for the inline asm call begins with a LINK A6,#$0000 instruction. It also ends with an UNLK A6 instruction. Because of that the only way I know of to make the interface work is to recopy the arguments onto the stack and then make the package call. Am I missing something here? I sure hope so. Could kind soul show me the error of my ways and provide me with a way around having to copy the arguments over. Thanks in advance. ******************************************************************************* * Jim Murphy (Murf) EMail {sun,decwrl,amdahl}!apple!murf * * or murf@apple.com * * USMail 20525 Mariani Ave. Cupertino CA 95014 * * AppleLink Murphy4 * ******************************************************************************* * All opinions expressed are mine alone and do not represent any policy * * of apple computer. * ******************************************************************************* * Data, Code? it all the same to me -murf * *******************************************************************************