AnsweredAssumed Answered

Asm code before C-coded Main() - Write to global var in Asm code?

Question asked by VincentV on May 12, 2006
Latest reply on May 15, 2006 by VincentV
I'm writing code for the HCS12 and before main is called, I have it set up to first call some assembly code to check the health of the HCS12.

After these tests run and main() is called, I want to make sure that the tests were successful.

I would like to be able to shove the test results into a global variable (which is declaried in my main.c), but I seem to be missing something.

In the assembly, I have:

XREF post_status

and I can use the instrution:

MOVW #$BEEF, post_status

without trouble.

in main.c, after my #includes, I have

typedef unsigned int uint16;
extern uint16 post_status;
uint16 post_status;

Now, this compiles but does not seem to produce the desired result of having 0xBEEF stored in post_status when checked in main()

Any thoughts as to what it would take to coax code warrior into doing what I want to do?!

Message Edited by IronTek on 05-12-200609:33 AM

Message Edited by IronTek on 05-12-200610:10 AM

Message Edited by IronTek on 05-12-200610:10 AM

Outcomes