what's wrong with this code and why PC goes up by 2?

Thread Starter

PG1995

Joined Apr 15, 2011
832
Hi

I'm using MCU 8051. Please have a look on the video and please help me with the queries below (you can also queries embedded in the video): http://www.youtube.com/watch?v=RKn9tEpM5XE

Rich (BB code):
ORG 0H

    MOV A, 80H
    MOV R0, 81H

    ORG 80H
    DB  10
    DB  12

END
Q1: There is some problem with the code because see the value "A" has taken on. The value for R0 is also wrong.

Q2: The value of PC goes up by 2 for every line. I have read that this instruction MOV A, 80H occupy two bytes instead of one and that's the reason PC goes up by '2' for every line of the code. But can't that instruction be saved on a single byte so that the PC goes up by only '1' byte?

Regards
PG
 
Top