; You should have received a copy of the GNU General Public License
; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
;
-; $Id$
+; $Id: macros.inc 241 2015-12-10 09:38:25Z rapid $
;
;------------------------------------------------
-;
+;
.macro outm8
.if @0 > 0x3f
sts @0,@1
.endm
;------------------------------------------------
-;
+;
.macro inm8
.if @1 > 0x3f
lds @0,@1
.endm
;------------------------------------------------
-;
+;
.macro sbism8
.if @0 > 0x1f
in _tmp0,@0
; load 16 bit constant to register pair
.macro ldiw
- ldi @0l, low(@1)
+ ldi @0l, low(@1)
ldi @0h, high(@1)
.endm
; load 16 bit direct from data space
.macro ldsw
- lds @0l, @1
+ lds @0l, @1
lds @0h, @1+1
.endm
; store 16 bit direct to data space
.macro stsw
- sts @0, @1l
+ sts @0, @1l
sts @0+1,@1h
.endm
; add 16 bit constant to register pair
.macro addiw
- subi @0l, low(-@1)
+ subi @0l, low(-@1)
sbci @0h, high(-@1)
.endm
; sub 16 bit constant from register pair
.macro subiw
- subi @0l, low(@1)
+ subi @0l, low(@1)
sbci @0h, high(@1)
.endm
.endm
;------------------------------------------------
-;
+;
;
;
.macro INTERRUPT
.if dist_ <= 2048
rjmp pos_
- .elif (dist_ - (FLASHEND+1)) > -2048
+ .elif (dist_ - (FLASHEND+1)) > -2048
.set disp_ = (dist_ - (FLASHEND+1)) & 0xFFF
; rjmp pos_ - (FLASHEND+1)
.dw 0xC000 | disp_
.endm
;------------------------------------------------
-;
+;
;
#if 1
.endif
.endm
+;------------------------------------------------
+; Make string.
+; makestring "String"
+
+.macro makestring
+ .if strlen(@0) % 2
+ .db @0,0
+ .else
+ .db @0,0,0
+ .endif
+.endm
+
;------------------------------------------------
; Print string.
; printstring "String"
.endm
; vim:set ts=8 noet nowrap
-