SDCC V2.3.0, using Borland binaries, produces code with
lots of pops but with no corresponding pushs. The
program will crash, because of the non symmetrical
usage of push (or lcall) and pop (or ret).
The appended files (ZIP with SRC.C and SRC.ASM)
demonstrate the issue.
An ISR calls the function subroutine().
The function then calls another function my_func()
indirectly via a simple table (struct, array)
containing the address of my_func(). When my_func()
returns back to subroutine(), the code at label 00103$
will be executed. There you will find
but you will not find any corresponding pushs before
(or after). All relevant functions, ISR, subroutine()
and my_func() were declared using register bank 2. No
specific options other than -I and -L were used.
How can this problem be solved?
Is there any workaround?
Log in to post a comment.