Monday, May 30, 2016

8051 Program - exchange r6r7 and dptr

; Description:
; Exchange R6/7 And DPTR
;
; Entry Requirements:
; DPTR Has 1st Value
; R6/7 Has 2nd Value
;
; On Exit:
; DPTR <-> R6/7
;
; Affected:
; DPTR, R6, R7
;
; Stack:
; 1 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
UTIL_DPTRR67:
push acc ; Save Acc
mov a,dpl ; Get DPL
mov dpl,r7 ; Move R7 To DPL
mov r7,a ; Move DPL To R7
mov a,dph ; Get DPL
mov dph,r6 ; Move R6 To DPH
mov r6,a ; Move DPH To R6
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 - store r6r7 to dptr xram   |   8051 Program - exchange r0r1 and dptr   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment