•  Back 
  •  XCONTROL 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-File
                 XCONTROL  Function Calling Procedure


Calling Conventions

XCONTROL uses "right-left" stack-based parameter passing for all of its
functions and expects that user defined callback functions are similarly
"right-left" stack-based. Compilers which do not default to this method
should use either the 'cdecl' or '_stdargs' keyword depending on your
compiler.

Function entry stubs must also consider the longword return code placed
on the stack by the 68x00 'JSR' function. 'C' compilers always expect
this. For example, the pointer to the XCPB passed to the cpx_init()
function can be stored through the following machine language statement:

    _cpx_init:
                    move.l      4(sp),xcpb

Stack Space

CPX programmers should note that all CPX operations use the default
Control Panel stack space (2048 bytes) and should therefore restrict heavy
usage of automatic variables and other large consumers of stack space.