2007-05-25 02:51 PM
2007-05-24 04:13 PM
I have to convert the source code form Metrowerks to cosmic. I have some probrlem for following 2 lines code :
1. LD abc:21,A 2. LD X,#abc:7 Could you please explain the code meaning? The sample code is show as following: void abc() { Byte abc[34]; asm LD abc:21,A asm LD X,#abc:7 }2007-05-24 09:42 PM
Hi,
LD abc:21,A means to load the memory with the address of abc+21 with A. If you read a Cosmic .ls-file you'll find something like ld _abc+21,a LD X,#abc:7 means to load X with the address of abc+7. In Cosmic syntax you'll get ld x,#_abc+7 or ld x,#low(_abc+7) But unfortunately I don't know any way to address local objects using the inline assembler at Cosmic. btw.: if you want to convert HW code to Cosmic there is a helpful application note at the Cosmic site Regards, WoRo2007-05-25 02:51 PM
Thank you for your help!