Parameterized functions marked as critical generate
incorrect prologues. When a function is marked as critical
the compiler copies the CCR to reg A and pushes it on the
stack before disabling interrupts. However, if a critical
function accepts arguments, then the first argument is
passed in reg A. Copying the CCR will overwrite the
argument in reg A.
Critical functions should not use reg A to pass arguments,
or a warning should be generated that critical functions
cannot have arguments.
In the attached example, test(a,b,c) is a critical function.
Argument 'a' is passed by saving it in reg A (line 135).
The first instruction of test(), tpa, overwrites this argument
Log in to post a comment.