diff --git a/avr/common/utils_copy_from_flash.asm b/avr/common/utils_copy_from_flash.asm new file mode 100644 index 0000000..5624fb5 --- /dev/null +++ b/avr/common/utils_copy_from_flash.asm @@ -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 + + diff --git a/avr/common/utils_copy_sdram.asm b/avr/common/utils_copy_sdram.asm new file mode 100644 index 0000000..5a35681 --- /dev/null +++ b/avr/common/utils_copy_sdram.asm @@ -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 + +