How to assign values to DPH and DPL register?

Status
Not open for further replies.

anand_jha_30

Member level 2
Joined
Oct 29, 2010
Messages
50
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,616
While writing assembly code for 8051 is it illegal to write this
mov dph,#12;
mov dpl,#34;

instead of
mov dptr,#1234;

I am using Ride compiler and its throwing error as --- undefined symbol (PASS 2) 'DPH'
undefined symbol (PASS 2) 'DPL'

Is it compiler dependent.
 

if include file contains,
#define dph xxh
#define dpl yyh
then it is permitted.

check your include <8051.h>
whether it defines the symbol.

and clarify how you include the assembly instruction
in the c code.
 

if include file contains,
#define dph xxh
#define dpl yyh
then it is permitted.

check your include <8051.h>
whether it defines the symbol.

and clarify how you include the assembly instruction
in the c code.

I am not writing C code. I am writing assembly code only and hence there is no include file.
 

I am using Ride compiler and its throwing error as --- undefined symbol (PASS 2) 'DPH'
undefined symbol (PASS 2) 'DPL'

Is it compiler dependent.

since you mentioned ride compiler and asked whether it is compiler dependent ,
it is assumed as c code.

if you post a minimal 8051 sample code , which gives the error ,
it may be possible to identify the problem.
 
I am using RIDE IDE and doing coding in assembly.

When I write the code as

org 0000h
mov dptr,#1234;
end

There is no error an hex is generating.

If I write

org 0000h
mov dph,#12h
mov dpl,#34h
end

there is error for both dph and dpl as undefined symbols
 

execute the following and find if there is any error.

org 0000h
mov 83h,#12h
mov 82hl,#34h
end
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…