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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/07/02 15:07
Read: times


 
#21512 - RE: ASM variables, moving thru it
By using R0 or R1 as an Indirect pointer you can access a range of Ram of your choosing. Simply point R0 (or R1) to the beginning (or end) of your selected RAM area. Then it is a simple matter of MOVing the desired variable to the Accumulator with:
MOV A,@R0
and to return it memory with:
MOV @R0,A
Afterwards just increment (or decrement) R0 (or R1) for the next pass. Using this method you do not even have to define the variables except the first (or last) one only if you wish to use it by a name. You just place the RAM address such as 50h into R0 (or R1). However, I would suggest that you place a comment line near the beginning of your program that you are setting aside X number of bytes and their location so that you don't inadvertently use those RAM locations for something else.
Also, with 8052 Assembler there is no way of defining a variable and placing a value into that variable at the same time. You must initialize each location with data separately. Do not assume RAM to be at 00h after power up or reset, either.

Hal

List of 16 messages in thread
TopicAuthorDate
quick question on ASM variables            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: ASM variables, moving thru it            01/01/70 00:00      
RE: ASM variables, moving thru it            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: quick question on ASM variables, Rob            01/01/70 00:00      
RE: quick question on ASM variables, Rob            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: data segment variables wont work?            01/01/70 00:00      
RE: quick question on ASM variables            01/01/70 00:00      
RE: data segment variables wont work?            01/01/70 00:00      
RE: Thanks!!            01/01/70 00:00      
RE: Thanks!!            01/01/70 00:00      

Back to Subject List