Hello David,
For inline assembly, each array element can be addressed with the following construct -
__asm {
lsl MyData:5;
rol MyData:4;
rol MyData:3;
rol MyData:2;
rol MyData:1;
rol MyData;
}
However, to use the LSL and ROL assembly instructions, the variable MyData must reside in page zero, or on the stack. For a stack based local variable, there was no problem compiling, and the expected result was obtained. But with MyData as a global variable, I did have problems compiling the above code, even with the attempt to explicitly define the variable to be allocated to page zero.
#pragma DATA_SEG MY_ZEROPAGE
char MyData[6];
#pragma DATA_SEG DEFAULT
In fact, the global variable did reside within page zero, but the compile continued to fail at the LSL and ROL inline instructions. Perhaps others may be able to throw light on this issue.
Regards,
Mac