X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=avr-asm-macros.S;h=829562b7d1b680241df3d8786e8f443ba3edbd4b;hb=3d99e4ba447ef04801609c5459b7c0c332ae332f;hp=57007accffe5d57d7fa0a375020839a56511b2dd;hpb=17332291e15183d71d88ed868275e3cb53917180;p=avr-crypto-lib.git diff --git a/avr-asm-macros.S b/avr-asm-macros.S index 57007ac..829562b 100644 --- a/avr-asm-macros.S +++ b/avr-asm-macros.S @@ -1,6 +1,6 @@ /* avr-asm-macros.S */ /* - This file is part of the This file is part of the AVR-Crypto-Lib. + This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -120,6 +120,24 @@ out _SFR_IO_ADDR(SPL), \reg1 .endm +.macro stack_free_large3 size:req, reg1=r30, reg2=r31 + in r0, _SFR_IO_ADDR(SREG) + in \reg1, _SFR_IO_ADDR(SPL) + in \reg2, _SFR_IO_ADDR(SPH) + push r16 + push r17 + ldi r16, lo8(\size) + ldi r17, hi8(\size) + add \reg1, r16 + adc \reg2, r17 + pop r17 + pop r16 + cli + out _SFR_IO_ADDR(SPH), \reg2 + out _SFR_IO_ADDR(SREG), r0 + out _SFR_IO_ADDR(SPL), \reg1 +.endm + /******************************************************************************* * END of MACRO SECTION *