Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!gatech!udel!mmdf From: AXDRW%ALASKA.BITNET@cunyvm.cuny.edu (Don R. Withey) Newsgroups: comp.sys.amiga Subject: Prototyping function pointers Message-ID: <14424@louie.udel.EDU> Date: 1 May 89 18:42:27 GMT Sender: mmdf@udel.EDU Lines: 46 How does one prototype a function pointer in Lattice 5.02? I have a function pointer that I want to force Lattice to pass the arguments in certain registers. For example: extern __far __asm MyFunc(register __a0 struct Window *); ... { ... MyFunc(Win); ... } This works fine, basically it boils down to: movea.l Win,A0 (I may have the order wrong (A0, Win)) jsr _MyFunc Now if I want to do the same thing, except MyFunc is a function pointer, how do I do it? extern __far __asm MyFunc(register __a0 struct Window *); ... { __fptr MyFunc; ... MyFunc = SetFunction(...); ... MyFunc(Win); ... } This doesn't work that way I want it to, it basically does the following: pushal Win (Vax assembler ;-) movea.l MyFunc,A0 (It just happend to use A0, I think) jsr (A0) (clean up the stack) Anyway, It basically ignores the earlier declaration. What I want it for is, I'm setfunctioning a routine, and if my new function fails, I want to call the old function. Don ----------------------------------------------------------- Don R Withey BITNET: AXDRW@ALASKA.BITNET University of Alaska BIX: dwithey 3211 U.A.A. Drive Phone: 907-786-1074 (work) Anchorage, Alaska 99508 Phone: 907-344-4057 (home) -----------------------------------------------------------