I know that this was asked 4 years ago, but he still has not received a proper answer. I believe that the question that the OP asks is their approach to working on whether the HiTech PICC18 C compiler is valid and / or best. As mentioned in a later comment, the limitation (rather bad and poorly advertised by Hitech) is that "the Hi-Tech compiler allows only 256 bytes of automatic variables." In fact, the restriction is worse than the total 256 bytes for local variables and parameters. The linker warning when this is exceeded is rather cryptic. If functions are in different branches of the call tree, then the compiler can overlap variables to reuse space. This means that you can have more than 256 bytes. But keep in mind that the interrupt handler (or handlers, if you use the priority scheme) has its own call tree, which divides the local / paragraph block by 256 bytes.
Locals Two solutions to reduce the space required by locals are as follows: make locales global or static. With their static storage, the scope is the same and, provided that the function is not called from interrupts, it is safe (in any case, the compiler does not allow the use of resources). This is probably the preferred option. The disadvantage is that the compiler cannot reuse these location variables to reduce overall memory consumption. Moving variables to the global area is reusable, but reuse management must be managed by the programmer. Probably the best balance is to make simple variables static, but make global chunks of memory, such as string buffers, global and reuse them carefully.
Be careful with initialization.
foo() { int myvar = 5; }
should change to
foo() { static int myvar; myvar = 5; }
Parameters If you go through the transfer of large amounts of data through the call tree in the parameters, you will quickly encounter the same 256-byte limit. Your best option here might be to pass a pointer to the globally allocated struct / s "options". Alternatively, you can have global parameter variables that are set by the upper party and read by polling through the tree. It really depends on the software design whose approach is better.
I struggled with the same problems as the OP, and I think the best option in the long run is to switch from using the Hitech compiler. The optimization decision made by the compiler authors to highlight all locals / params in one block is really suitable for very small PICS sizes. For large PICSs, you will come across a local / parameter far before you press the size of the device plunger. Then you need to start hacking your code to match the compiler, which is perverted.
In conclusion ... Yes, your approach is valid. But think about it by simply setting locals static if appropriate, since, in general, reducing the size makes your code more secure.