How to can I change the number of bytes reserved for function with a variable-length argument list when using 8-bit MCUs with Cx51?


By default, the C51 compiler reserves 15 bytes for passing arguments to functions with variable-length argument list for SMALL and COMPACT memory model, and 40 bytes for LARGER memory model.


User can use the MAXARGS(n) compiler directive to change the number of bytes reserved.


To do this in Simplicity IDE, here as an example, if 24 bytes is required for the variable-length argument list, you can use the MAXARGS(24) for the Keil 8051 Compiler setting as the picture below showing, and then re-build the project again.




For more information on Cx51 Variable Length Argument Routines, please click here.


  • 8-bit MCUs
  • Knowledge Base Articles