Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/16/08 14:24
Read: times


 
#160974 - complier issue
Hello
I am using keil complier.
I have piece of code which is pointing to external memory but DPTR is incremeting in assembly code
c- code
#define SHAR0 0x2007
#define SHAR1 0x2008
#define SHAR2 0x2009
#define SHAR3 0x200a
#define SHAR4 0x200b
#define SHAR5 0x200c
volatile uint16 xdata *wiznet;
wiznet= ((uint16 xdata *)SHAR5);
SIL_WRITE(wiznet,0x01);
ASM code for the above C-code (keil generated)
0896 90 00 04 MOV DPTR,#0004H
0899 74 20 MOV A,#20H
089B F0 MOVX @DPTR,A
089C A3 INC DPTR
089D 74 0C MOV A,#0CH
089F F0 MOVX @DPTR,A
08A0 90 00 04 MOV DPTR,#0004H
08A3 E0 MOVX A,@DPTR
08A4 FE MOV R6,A
08A5 A3 INC DPTR
08A6 E0 MOVX A,@DPTR
MOV R6,A
08DB A3 INC DPTR
08DC E0 MOVX A,@DPTR
08DD AA 06 MOV R2,06H
08DF F9 MOV R1,A
08E0 7B 01 MOV R3,#01H
08E2 7D 03 MOV R5,#03H
08E4 12 0B 8D LCALL 0B8DH

This asm code is generating
But iam not able to understand why DPTR is incrementing to next location?
I mean to say i want to load the data in 0x2007 but it is getting and loading in 0x2008
please assist anybody for this
thanku for replies
Geetha





List of 13 messages in thread
TopicAuthorDate
complier issue            01/01/70 00:00      
   What is SIL_WRITE?            01/01/70 00:00      
   Incomplete            01/01/70 00:00      
   just a guess            01/01/70 00:00      
   cross posted at SILabs forum            01/01/70 00:00      
   What do you expect...            01/01/70 00:00      
   complier issue            01/01/70 00:00      
      Extension fron one to two bytes            01/01/70 00:00      
      You are right Sir..            01/01/70 00:00      
         RTFM            01/01/70 00:00      
            Erik, I meant wiznet registers!!            01/01/70 00:00      
               Big picture            01/01/70 00:00      
                  I understand..            01/01/70 00:00      

Back to Subject List