Skip to content

Instantly share code, notes, and snippets.

@jacbar
Created March 8, 2011 13:41
Show Gist options
  • Save jacbar/860268 to your computer and use it in GitHub Desktop.
Save jacbar/860268 to your computer and use it in GitHub Desktop.
ORG 0
; MOV R0,#10h
; MOV R1,#18h
; MOV R2,#4
MOV R0,#10h
MOV DPTR,#8000h
MOV R2,#4
LCALL copy_iram_xram
SJMP $
;-------------------------------------------
; wejscie: R0 - adres zrodla,
; R1 - adres docelowy
; R2 - licznik
;
; Kopiuje z adresu zrodla do adresu docelowego R2 bitow
;-------------------------------------------
copy_iram_iram:
MOV A,@R0
MOV @R1,A
INC R0
INC R1
DJNZ R2,copy_iram_iram
RET
;-------------------------------------------
;-------------------------------------------
; wejscie: R0 - adres zrodla,
; DPTR - adres docelowy
; R2 - licznik
;
; Kopiuje z adresu zrodla do adresu docelowego
; w pamieci zewnetrznej R2 bitow
;-------------------------------------------
copy_iram_xram:
MOV A,@R0
MOVX @DPTR,A
INC R0
INC DPTR
DJNZ R2,copy_iram_xram
RET
;-------------------------------------------
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment