Monday, May 30, 2016

8051 Program - store r6r7 to dptr xram

; Description:
; Store R6/7 To DPTR In External Memory Space. Return DPTR Pointing To
; Next Location.
;
; Entry Requirements:
; DPTR Contains Location To Store R6/7
; R6/7 Contains Value To Be Stored
;
; On Exit:
; (DPTR) = R6, (DPTR + 1) = R7
;
; Affected:
; None
;
; Stack:
; 1 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; I Often Use R6/7 As A Register Pair That Serves As A Second DPTR,
; So This Is Used To Store R6/7 When Building Lists, Etc.
UTIL_STDPTRD:
push acc ; Save Acc
mov a,r6 ; Get R6
movx @dptr,a ; Store High Byte
inc dptr ; Point To Low Byte
mov a,r7 ; Get R7
movx @dptr,a ; Store Low Byte
inc dptr ; Point To Next Location
pop acc ; Recover Acc
ret ; Return To Caller


Source: Assorted Utilities, John C. Wren 11/23/96



Related topics:
8051 Program - increment 16bit in iram   |   8051 Program - compare dptr to 16bit iram value   |   8051 Program - compare dptr to ba   |   8051 Program - shift a 16 bit iram value 4 bits left   |   8051 Program - load dptr from (dptr) rom   |   8051 Program - load dptr from (dptr) xram   |   8051 Program - exchange r0r1 and dptr   |   8051 Program - exchange r6r7 and dptr   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment