Monday, May 30, 2016

8051 Program - load dptr from (dptr) rom

; Description:
; Load DPTR From DPTR In Code Space
;
; Entry Requirements:
; DPTR Points To 16 Bit Value In Code Space To Load
;
; On Exit:
; DPTR = (DPTR)
;
; Affected:
; DPTR
;
; Stack:
; 2 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
UTIL_LDDPTRC:
push acc ; Save Acc
clr a ; Clear For MOVC
movc a,@a+dptr ; Get High Byte
push acc ; Save It
mov a,#1 ; Set For MOVC
movc a,@a+dptr ; Get Low Byte
mov dpl,a ; Move To DPL
pop dph ; Recover High To DPH
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) xram   |   8051 Program - store r6r7 to 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