I am having a difficult time combining C and assembly in the Kiel development environment. I have a progtram which is mainly in C. I have assembly modules which are inline code. The assembly modules have to access variables which are defined in the main C area. I am using the EXTRN command in my inline ASM area for at least one char variable. ex: EXTRN DATA(curSector)
I now have an unsigned long which was being passed to the inline assembly in the Registers. That works, of course. But I wanted to directly address the long variable in my assembly code to eliminate the need to prep the registers prior to the call.
so I have
unsigned long burnAddress ; defined in the C code
in the inline assembly I have:
EXTRN DATA (burnAddress)
and I access it like this:
mov a,burnAddress ; MSB .. mov a,burnAddress +1 .. mov a,burnAddress +2 .. mov a,burnAddress +3 LSB
Is this correct?
Thanks
eng