X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/21c909d111de095a396f08de06b30d666f4ccf9f..28cf89bfbf775cb8cf82c545f9afa68a82259a09:/macros.inc diff --git a/macros.inc b/macros.inc index b109165..d1178b7 100644 --- a/macros.inc +++ b/macros.inc @@ -67,6 +67,14 @@ 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 ; @@ -77,6 +85,21 @@ 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"