Ok, I am feeling really stupid. I have written thousands of lines of assembler for three different (32) processors and I have never had this much trouble doing something so (what I think) simple.
Thanks to Mr. TonyP I understand a little more of this (for me) new world of 8-bit microcontrollers. It is definitely a different way of thinking.
Based on what Tony mentioned above I have written the following code in my C code TimerISR:
extern struct TCB *CurrentTask;
...
ISR(TaskTimerInt_Interrupt)
{
__asm pshh;
__asm tsx;
__asm pshx; // for some reason my compiler does not like pshhx
__asm pshh;
__asm ldhx CurrentTask;
__asm pula;
__asm sta StackPtr, x; // I get "undefined class/struct/union" error when I compile
__asm pula;
__asm sta StackPtr + 1, x;
Looks to me like there is some trick to declaring CurrentTask->StackPtr or refering to the StackPtr element struct TCB. I put it as the first element in the struct so I could just refer to CurrentTask as an address.
Does StackPtr need to be declared in some tricky way?
Also, a related question. When I am writting my embedded __asm code if I stop and write a line of C code such as:
CurrentTask = CurrentTask->Next;
I get the same "undefined struct/class/union" error. I am sure they are related.
Is "extern" not enough?
thanks for everyone's patience,
dave