Hi, Philipp! * Functions usually return by ret (medium model) or retf (large model). > So, call/jp and callf/jpf are used in medium and large models respectfully, aren't them?
How do I declare a function pointer (24 bit) in case of large memory model? Best regards, Paul Beltyukov чт, 6 мая 2021 г. в 14:34, Philipp Klaus Krause <p...@spth.de>: > Am 06.05.21 um 11:11 schrieb Павел Бельтюков: > > Hi, everybody! > > > > Although SDCC manual contains some information about stm8 options > > it has no information on working register set and procedure calling > > convention. > > > > Can anyone explain: what registers are used and for what purpose? > > > > What are function call prologues and epilogues like? > > > > What about interrupt ? > > > > How parameters and return values are placed in registers/stack? > > > > What is the difference between medium and large memory models with > > regard to previous questions? > > > > Best regards, > > Paul Beltyukov > > Current situation: > > * All parameters are passed on the stack. > * The parameters on the stack are cleaned up by the caller (unless the > callee is declared __z88dk_callee, in which case they are cleared up by > the callee). > * 8-Bit return values are passed in register a. > * 16-Bit return values are passed in register x. > * 24-Bit return values are passed in registers yl:x. > * 32-Bit return values are passed in registers y:x. > * For return values bigger than 32 bits, the caller passes an additional > hidden parameter containing a pointer, the callee then writes the return > value where that pointer points to. > * For functions that needs access to more than 255 B of stack space, y > is used as frame pointer. > * Within the function, registers a, x and y (if not used as frame > pointer) are used whichever way the register allocator decides. > * Funktions declared __naked have no prologue or epilogue. > * Functions declared __critical have sim / rim in prologue / epilogeu. > * Function prologue consists of setting up the frame pointer, if necessary. > * Functions usually return by ret (medium model) or retf (large model). > Exceptions apply for some functions using __z88dk_callee. > * Interrupt routines are handled like other functions (but if sdcc > considers it necessary, the function prologue will contain additional > code to work around hardware bug). They return by iret. > > Philipp > > > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user >
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user