assembly mov command

General discussion on mikroC PRO for 8051.
Post Reply
Author
Message
mikonforever
Posts: 1
Joined: 28 Sep 2012 16:13

assembly mov command

#1 Post by mikonforever » 21 Aug 2015 18:25

Hello,
The compiler (3.6.0) generate invalid expression (34 348 Assembler instruction 'mov A, Temp1' was not found ) for "mov A, Temp1"

char fonksiyon(char Temp)
{
char temp1;
temp1=Temp;
asm {
push Acc (no error)
mov A,#0 (no error)
mov A, Temp1 (error)
..
..
pop Acc
}
any advise, there is a "mov" command in 8051 but why compiler generate error ?

User avatar
Aleksandar.Mitrovic
mikroElektronika team
Posts: 1697
Joined: 11 Mar 2015 12:48

Re: assembly mov command

#2 Post by Aleksandar.Mitrovic » 24 Aug 2015 11:51

Hi,

Can you please write is like this:

Code: Select all

mov A, _temp1+0
For more information please refer to the compiler 8051 Help->ASM Declaration.

Also you can just type temp1=Temp; compile it and run in asm mode (View->Assembly), you will see something like this:

Code: Select all

MOV _temp1+0, _temp+0
Best regards,
Aleksandar

aCkO
Posts: 1119
Joined: 14 Feb 2011 04:07
Location: Bar, Montenegro

Re: assembly mov command

#3 Post by aCkO » 24 Aug 2015 19:37

You should use variable's assembly name. It should be:

Code: Select all

mov A, fonksiyon_temp1_L0
Regards

Post Reply

Return to “mikroC PRO for 8051 General”