CLR  P2.7
CLR  P2_COPY.7
SETB P2.5
SETB P2_COPY.5
; ...
MOV  DPTR,#MEM_ADDR
MOV  A,P2_COPY       ; read copy of current state of bits
ANL  A,#11111000b    ; mask address bits
ORL  DPH,A           ; keep output bits at their state
MOVX A,@DPTR