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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/15/00 16:10
Read: times


 
#2681 - RE: 8051 Question
If you really wanted to address 0011h in external I/O, you'd have to use a MOVX instruction.

The easiest implementation is using the DPTR:

. mov dptr,#0011h ;load the pointer
. mov a,#00Fh ;load the write value
. movx @dptr,a ;write external from acc

In some I/O implementations, you might not be using the P2 for addressing. It that case you can use the "movx @r0,a" and "movx @r1,a" commands. BEWARE, these can be tricky in some addressing schemes involving P2. Sometimes you need to write the upper address to the full or partial addressing bits on P2 before using the @r0 or @r0 referencing. The keye is that @r0 and @r1 only affect the lower address bytes of the external addressing.

While tricky, this is quite powerful for experienced 8051 programmers/designers.

If you hadn't found the MOV and MOVX commads until helped online... stick with DPTR when using MOVX as long as you can.

-Jay C. Box

-Jay C. Box

List of 4 messages in thread
TopicAuthorDate
8051 Question            01/01/70 00:00      
RE: 8051 Question            01/01/70 00:00      
RE: 8051 Question            01/01/70 00:00      
RE: 8051 Question            01/01/70 00:00      

Back to Subject List