X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=avr-asm-macros.S;h=afaf78ce1905b360abb9d9227bf4d1940f1fcdb5;hp=829562b7d1b680241df3d8786e8f443ba3edbd4b;hb=e9e07569721b9e005d6b602e26a03e930e796577;hpb=c239a90de4f9ea98d7c0f5962d200c1a6a6033d1 diff --git a/avr-asm-macros.S b/avr-asm-macros.S index 829562b..afaf78c 100644 --- a/avr-asm-macros.S +++ b/avr-asm-macros.S @@ -1,7 +1,7 @@ /* avr-asm-macros.S */ /* This file is part of the AVR-Crypto-Lib. - Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) + Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,31 +17,34 @@ along with this program. If not, see . */ -/* +/* * File: avr-asm-macros.S * Author: Daniel Otte * Date: 2008-08-13 * License: GPLv3 or later * Description: some macros which are quite usefull - * + * */ - -#include +//#ifndef AVR_ASM_MACROS__S__ +//#define AVR_ASM_MACROS__S__ +.nolist +#include +.list /******************************************************************************* * MACRO SECTION * *******************************************************************************/ .macro push_ p1:req, p2:vararg push \p1 -.ifnb \p2 +.ifnb \p2 push_ \p2 .endif .endm .macro pop_ p1:req, p2:vararg pop \p1 -.ifnb \p2 +.ifnb \p2 pop_ \p2 .endif .endm @@ -50,13 +53,13 @@ push \from .if \to-\from push_range "(\from+1)",\to -.endif +.endif .endm .macro pop_range from:req, to:req pop \to .if \to-\from - pop_range \from,"(\to-1)" + pop_range \from,"(\to-1)" .endif .endm @@ -64,7 +67,7 @@ in r0, _SFR_IO_ADDR(SREG) in \reg1, _SFR_IO_ADDR(SPL) in \reg2, _SFR_IO_ADDR(SPH) - sbiw \reg1, \size + sbiw \reg1, \size cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -75,7 +78,7 @@ in r0, _SFR_IO_ADDR(SREG) in \reg1, _SFR_IO_ADDR(SPL) in \reg2, _SFR_IO_ADDR(SPH) - adiw \reg1, \size + adiw \reg1, \size cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -88,7 +91,7 @@ in \reg1, _SFR_IO_ADDR(SPL) in \reg2, _SFR_IO_ADDR(SPH) subi \reg1, lo8(\size) - sbci \reg2, hi8(\size) + sbci \reg2, hi8(\size) cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -100,7 +103,7 @@ in \reg1, _SFR_IO_ADDR(SPL) in \reg2, _SFR_IO_ADDR(SPH) adiw \reg1, 63 - adiw \reg1, (\size-63) + adiw \reg1, (\size-63) cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -113,7 +116,7 @@ in \reg2, _SFR_IO_ADDR(SPH) adiw \reg1, 63 adiw \reg1, 63 - adiw \reg1, (\size-63*2) + adiw \reg1, (\size-63*2) cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -131,7 +134,7 @@ add \reg1, r16 adc \reg2, r17 pop r17 - pop r16 + pop r16 cli out _SFR_IO_ADDR(SPH), \reg2 out _SFR_IO_ADDR(SREG), r0 @@ -144,4 +147,5 @@ *******************************************************************************/ +//#endif /* AVR_ASM_MACROS__S__ */