MC908GZ60 running LED

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC908GZ60 running LED

1,517 Views
Josef
Contributor I
Hello,
I use the MC908GZ60 and CodeWarrior. I want to programm a simple running LED on Port A in C language.
I wrote a code like this:
 
 
char var1 = 0b00000001;
 
 
for(;:smileywink: {
 
 asm("rol      var1");
 PTA = var1;
 wait();     // function with loops for time delay
}
 
When I "make" the project i get following error message:
 
 
Error   : C18700: Unknown Opcode Operand Combination: Opc.:ROL/Dest.:Ext/Source:NoOp.
main.c line 90  
Error   : C18701: Unknown Opcode 19
main.c line 90  
Error   : Compile failed
 
Can anyone tell me what is wrong with my code?
Thanks for your help!
 
sincerly yours
Josef
 
 
 
Labels (1)
0 Kudos
Reply
2 Replies

562 Views
CompilerGuru
NXP Employee
NXP Employee
your var1 variable has an extended (16 bit) address, but rol only works with direct (8 bit) addresses.
So you either allocate var1 in direct memory:
#pragma DATA_SEG SHORT MY_ZEROPAGE
char var1 = 0b00000001;

or you change your code which does the rotate, for example to a load/rola/store
asm {
lda var1;
rola;
sta var1;
}

Daniel
0 Kudos
Reply

562 Views
Josef
Contributor I
Aha, yes with the new code it works.
Thank you for your quick answer!
 
One further little question. Do you know any good documentation for programming HC08 cores?
Which contains informations about the #pragma, interrupts, ... perhaps with little code examples.
The Help menu of CodeWarrior explains only how to define interrup service routines with the processor expert and the descriptions in the Data Sheet are even less
 
 
Josef
0 Kudos
Reply