I am using MC9S08LG32 controller and developing software using CW 10.2 Special Edition: Code Warrior for Micro-controllers 10.2 (Eclipse, Windows hosted). I am using small memory model (where by default far locations are used)
I am getting Fix-up Overflow in one of my interrupt service routine.
In that routine is a variable say count.
When I explicitly specify this variable as near I get the fix-up overflow error. As soon I remove this near specifier the error is solved. Can some-one tell me what exactly is happening.
Solved! Go to Solution.
Hello,
If your requirement is that the count variable retain its value between function calls, the static modifier should be used. The variable will then be placed in RAM, rather than the stack. Unlike global variables, the variable will only be visible from within the function in which it is defined.
Regards,
Mac
Hello,
If your requirement is that the count variable retain its value between function calls, the static modifier should be used. The variable will then be placed in RAM, rather than the stack. Unlike global variables, the variable will only be visible from within the function in which it is defined.
Regards,
Mac
Hello
When you define a variable inside of a function, the variable is allocated on the stack.
The near qualifier only applies to variables allocated between 0x00 and 0xFF.
As your stack is not allocated there, you should not define your local variable a near.
CrasyCat
When you define a variable inside of a function, the variable is allocated on the stack.
The near qualifier only applies to variables allocated between 0x00 and 0xFF.
As your stack is not allocated there, you should not define your local variable a near.
CrasyCat
Sir,
The variable count I declared is a global variable and is not allocated space in the routine.