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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/15/08 14:29
Read: times


 
#150871 - Need help with RAM access via 8051
Hello all!
I am just learning 8051 and need some help:

I have some values stored at ROM:
DSEG    AT 0
	REG_0       	:DS 1
	REG_1        	:DS 1	
	REG_2        	:DS 1
	REG_3		:DS 1
	REG_4		:DS 1
	REG_5		:DS 1	
	REG_6		:DS 1
	REG_7  		:DS 1
	vec_name	:DS 1
	len		:DS 1
	vecr		:DS 12


vecr = 12 numbers that represent offset for RAM.
XSEG	AT  0FF00H

	checks	:DS 16   
	h	:DS 1
	m	:DS 1
	PositionN   :DS 12 


Now, what I am trying to do is to put a value at PositionN + vecr,
i.e. if first number in vecr is 5; and PositionN locations is FF18, the value should be placed at FF18 + 5 in RAM.

For now i have this code:
       MOV 	DPTR,#PositionN
	MOV	A,#0FFH
	MOVX	@DPTR,A

How Can I add the offset to DPTR?

Thank

List of 15 messages in thread
TopicAuthorDate
Need help with RAM access via 8051            01/01/70 00:00      
   re            01/01/70 00:00      
      RE:            01/01/70 00:00      
      no need to put constant into dptr            01/01/70 00:00      
         How can I get the low and high parts?            01/01/70 00:00      
            what '51 assembler do you use?            01/01/70 00:00      
         push/pop A            01/01/70 00:00      
            In my asm push ACC works!            01/01/70 00:00      
               Another question:            01/01/70 00:00      
                  options:            01/01/70 00:00      
                     By inc I mean increase the value in RAM by 1            01/01/70 00:00      
                        once DPTR points to that value...            01/01/70 00:00      
            this is why it's dangerous...            01/01/70 00:00      
         You can push/pop [direct] though.            01/01/70 00:00      
            this is certainly correct...            01/01/70 00:00      

Back to Subject List