sbci @0h, high(-@1)
.endm
+;------------------------------------------------
+; sub 16 bit constant from register pair
+
+.macro subiw
+ subi @0l, low(@1)
+ sbci @0h, high(@1)
+.endm
+
;------------------------------------------------
; Move single bit between two registers
;
bld @0,@1
.endm
+;------------------------------------------------
+;
+;
+;
+.macro INTERRUPT
+ .set pos_ = PC
+ .org @0 ; vector address
+ .if abs(pos_ - PC) > 2048
+ jmp pos_
+ .else
+ rjmp pos_ ; jump to handler
+ .endif
+ .org pos_ ; restore PC
+.endm
+
;------------------------------------------------
; Print string.
; printstring "String"