Page 1 of 1

variable in register

Posted: Thu Aug 02, 2018 6:32 am
by joaopa
Hello,

I want to put the value of a variable in the register A of the Z80. Is it possible? Here is an example of I want to do:

Code: Select all

int main(void)
{
uint8_t variable_1=3,variable_2=4, result;
result=variable_1+variable_2;
#asm
ld a, result                         <---------------  It is moraly whait I want to do
#endasm}
}
Any idea how to achievee that?
Thanks in advance.

Posted: Thu Aug 02, 2018 9:58 pm
by dom
Can you give a bit more context as to what you're trying to do? - That will help guide an appropriate answer!