Monday, May 30, 2016

8051 Program - shift dptr right

; Description:
; Shift DPTR 1 Bit To Right
;
; Entry Requirements:
; DPTR Has Value To Shift Right
;
; On Exit:
; DPTR = DPTR >> 1
;
; Affected:
; PSW.CY, DPTR
;
; Stack:
; 1 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
UTIL_DPTRSHR1:
push acc ; Save Acc
clr c ; Clear For Shift
mov a,dph ; Get High Of DPTR
rrc a ; Shift Left
mov dph,a ; Store Back To DPH
mov a,dpl ; Get Low Of DPTR
rrc a ; Shift Left
mov dpl,a ; Store Back To DPL
pop acc ; Recover Acc
ret ; Return To Caller


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



Related topics:
8051 Program - arithmetic shift right dptr   |   8051 Program - rotate dptr left 4bits   |   8051 Program - shift dptr left   |   8051 Program - shift r3r4r5r6r7 4bits left   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment