From 1af9a788187d249b9692c05528d9650a2f3b8120 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 20 Apr 2023 00:45:01 +0200 Subject: [PATCH] avr: added clobbered regs to calls. --- avr/flash.asm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/avr/flash.asm b/avr/flash.asm index ed5516b..6afa180 100644 --- a/avr/flash.asm +++ b/avr/flash.asm @@ -26,13 +26,16 @@ FLASH_BEGIN: ; ; IN: ; - Z: Address to work on (byte address as for LPM!) +; OUT: +; - nothing +; REGS: R16 (R0, R1, R15, R16, R20, R24, R25) Flash_StartPage: push zh push zl ldi r16, ((PAGESIZE*2)-1) and zl, r16 - rcall Flash_ReadPageIntoPageBuffer + rcall Flash_ReadPageIntoPageBuffer ; (R0, R1, R15, R16, R20, R24, R25, Z) pop zl pop zh ret @@ -44,12 +47,15 @@ Flash_StartPage: ; ; IN: ; - Z: Address to work on (byte address as for LPM!) +; OUT: +; - nothing +; REGS: R16 (R15, R20) Flash_FinishPage: ldi r16, ((PAGESIZE*2)-1) and zl, r16 - rcall Flash_ErasePage - rcall Flash_WritePage + rcall Flash_ErasePage ; (R15, R16, R20) + rcall Flash_WritePage ; (R15, R16, R20) ret @@ -62,7 +68,7 @@ Flash_FinishPage: ; - Z: Address to read from (byte address as for LPM!) ; OUT: ; - nothing -; MODIFIED REGISTERS: R0, R1, R15, R16, R20, R24, R25, Z +; REGS: R0, R1, R15, R16, R20, R24, R25, Z Flash_ReadPageIntoPageBuffer: in r15, SREG @@ -117,7 +123,7 @@ Flash_WriteIntoPage: ; - Z: Address of the page to erase. ; OUT: ; - nothing -; MODIFIED REGISTERS: R0, R1, R15, R16, R18, R19, R20 +; REGS: R15, R20 (R16) Flash_ErasePage: in r15, SREG @@ -137,7 +143,7 @@ Flash_ErasePage: ; - Z: Address of the page to erase. ; OUT: ; - nothing -; MODIFIED REGISTERS: R0, R1, R15, R16, R18, R19, R20 +; REGS: R15, R20 (R16) Flash_WritePage: in r15, SREG