avr: added clobbered regs to calls.

This commit is contained in:
Martin Preuss
2023-04-20 00:45:01 +02:00
parent 39c4bcd720
commit 1af9a78818

View File

@@ -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