Re: Asm called by c_func
- Posted by Bernie Ryan <xotron at bluefrog.com> Apr 24, 2007
- 530 views
Larry Miller wrote: > > I know that an assembly routine called by call() must preserve all registers. > What registers, if any, must be preserved if the routine is called by c_func? > Am I correct in assuming that the return value will be in the EAX register? > From examples I have determined the calling conventions. > Hi Larry You need to preserve any register that your internal assembly code uses so that you can restore them to their original values. The EAX returns with whatever your internal assembly code places in it. This could be a flag or a 32-bit value or a 32-bit pointer. Bernie My files in archive: WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan