Is there any documentation about how many levels of subroutine nesting the various built-in GCBasic functions contain? This would be very helpful to avoid over-pushing the PIC's small stack in the user code, especially in 16F parts.
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
no documentation, but...
seems that every sub or functin caal ude stack cell.
depending on code an chip type it is possible to call from 2 to nested calls.
for more infrmation see chip datasheet. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can nest as many calls as you have stack space, so if you got 8 then you can call 8 times before you get a stackoverflow. As mention this is located in your PIC datasheet(s). Its the same as if you were doing it in asm.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks, but once again, that wasn't my queastion. i want to know how deep each of the built-in functions uses so I can figure out how many additional pushes my app can use, assuming I already know the stack depth for the part I'm using.
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry I must have misunderstood your question originally.
Just trying to help out where I can.
I think what your after will need to come from Hugh or Kent. My assumption is the built in calls return off the top of the stack so we have available the entire stack after a built in calls return, but I do not know that for sure. It is correct there is no documentation on that currently.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It varies from one lot of internal routines to another, and even from one subroutine to another. Generally, 2 stack levels, but some routines (LCD and serial) will use 3, even 4 in the case of SerPrint.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Hugh...that's the kind of information I'm looking for.
I'm working on the assumption that, if my program already is into a set of nested subroutines of my own creation and I call a GCBasic built-in function, I risk over-pushing the stack and crashing the PIC. I would have liked to have a list of how much further each individual GCB function pushes the stack. If I come p with that list, I'll post it.
Joe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any documentation about how many levels of subroutine nesting the various built-in GCBasic functions contain? This would be very helpful to avoid over-pushing the PIC's small stack in the user code, especially in 16F parts.
Joe
no documentation, but...
seems that every sub or functin caal ude stack cell.
depending on code an chip type it is possible to call from 2 to nested calls.
for more infrmation see chip datasheet. :)
You can nest as many calls as you have stack space, so if you got 8 then you can call 8 times before you get a stackoverflow. As mention this is located in your PIC datasheet(s). Its the same as if you were doing it in asm.
Thanks, but once again, that wasn't my queastion. i want to know how deep each of the built-in functions uses so I can figure out how many additional pushes my app can use, assuming I already know the stack depth for the part I'm using.
Joe
Sorry I must have misunderstood your question originally.
Just trying to help out where I can.
I think what your after will need to come from Hugh or Kent. My assumption is the built in calls return off the top of the stack so we have available the entire stack after a built in calls return, but I do not know that for sure. It is correct there is no documentation on that currently.
It varies from one lot of internal routines to another, and even from one subroutine to another. Generally, 2 stack levels, but some routines (LCD and serial) will use 3, even 4 in the case of SerPrint.
Thanks Hugh...that's the kind of information I'm looking for.
I'm working on the assumption that, if my program already is into a set of nested subroutines of my own creation and I call a GCBasic built-in function, I risk over-pushing the stack and crashing the PIC. I would have liked to have a list of how much further each individual GCB function pushes the stack. If I come p with that list, I'll post it.
Joe