avr: added common code.
This commit is contained in:
35
avr/common/utils_copy_from_flash.asm
Normal file
35
avr/common/utils_copy_from_flash.asm
Normal file
@@ -0,0 +1,35 @@
|
||||
; ***************************************************************************
|
||||
; copyright : (C) 2023 by Martin Preuss
|
||||
; email : martin@libchipcard.de
|
||||
;
|
||||
; ***************************************************************************
|
||||
; * This file is part of the project "AqHome". *
|
||||
; * Please see toplevel file COPYING of that project for license details. *
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
|
||||
.cseg
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Utils_CopyFromFlash
|
||||
;
|
||||
; IN:
|
||||
; - X: dest in RAM
|
||||
; - Z: src in FLASH
|
||||
; - R18: number of bytes to copy
|
||||
; OUT:
|
||||
; - nothing
|
||||
; USED: R17, R18, X, Z
|
||||
|
||||
Utils_CopyFromFlash:
|
||||
lpm r16, Z+
|
||||
st X+, r16
|
||||
dec r18
|
||||
brne Utils_CopyFromFlash
|
||||
ret
|
||||
|
||||
|
||||
34
avr/common/utils_copy_sdram.asm
Normal file
34
avr/common/utils_copy_sdram.asm
Normal file
@@ -0,0 +1,34 @@
|
||||
; ***************************************************************************
|
||||
; copyright : (C) 2023 by Martin Preuss
|
||||
; email : martin@libchipcard.de
|
||||
;
|
||||
; ***************************************************************************
|
||||
; * This file is part of the project "AqHome". *
|
||||
; * Please see toplevel file COPYING of that project for license details. *
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
|
||||
.cseg
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Utils_Copy_SDRAM
|
||||
;
|
||||
; IN:
|
||||
; - X: dest in RAM
|
||||
; - Y: src in RAM
|
||||
; - R18: number of bytes to copy
|
||||
; OUT:
|
||||
; - nothing
|
||||
; USED: R17, R18, X, Y
|
||||
Utils_Copy_SDRAM:
|
||||
ld r17, Y+
|
||||
st X+, r17
|
||||
dec r18
|
||||
brne Utils_Copy_SDRAM
|
||||
ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user