An example C program:
Code:
//file.c
unsigned char func(void)
{
unsigned char temp;
temp = 5; //some C code that uses the variable
++temp;
return temp;
}
//compile to assembly
htkc --chip=ht47c20-1 --opt=none -s file.c
If you look in the generated assembler file, you'll see that the compiler will refer to the local variable "temp" as something like ??_func+0, however, it also creates an equate with the more meaningful name _func_temp which you can use. It'll look something like this:
_func_temp equ ??_func+0
So you can just use this symbol. Here's an example:
Code:
unsigned char func(void)
{
unsigned char temp;
#asm
mov a, 5
mov [_func_temp],a
#endasm
++temp;
return temp;
}
Although, I'd recommend converting your asm code to C
--------------------
Matt Luckman
HI-TECH Software