Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!ndcheg!ndmath!milo From: milo@ndmath.UUCP (Greg Corson) Newsgroups: comp.sys.mac.programmer Subject: Calling Assembly Language Subroutines from MPW C Keywords: MPW, C, Assembly, 68000 Message-ID: <1455@ndmath.UUCP> Date: 23 Jun 89 14:59:55 GMT Organization: Math. Dept., Univ. of Notre Dame Lines: 28 Suddenly, for speed reasons, I find myself needing to write an assembly language routine that can be called from my C program and passed arguments. The assembly routine contains some special purpose graphics code and will need to use almost all of the 68000's registers. I haven't been able to find a good example of how to write an assembly language routine that is callable from C and can be passed arguments from the C program. I also need to know what registers need to be saved in the assembly routine and restored when it returns to the C caller. If anybody has any examples of this, please send them on...I would REALLY appreciate it. A simple do-nothing program shell that shows how to get an argument and shows what registers need to be saved would be very helpful. I've programmed in 68000 assembly before, but the compiler I was using at the time was setup to generate the calling sequence and register saves for me. I've never tried to write a assembly subroutines under MPW. Thanks for the help! Greg Corson 19141 Summers Drive South Bend, IN 46637 (219) 277-5306 {pur-ee,rutgers,uunet}!iuvax!ndmath!milo