diff src/isr.inc @ 0:11d4fc797f74

init
author heinrichsweikamp
date Wed, 24 Apr 2013 19:22:45 +0200
parents
children ca4556fb60b9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/isr.inc	Wed Apr 24 19:22:45 2013 +0200
@@ -0,0 +1,20 @@
+;=============================================================================
+;
+;   File isr.inc
+;
+;
+;   Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
+;=============================================================================
+; HISTORY
+;  2011-08-06 : [mH] moving from OSTC code
+
+SAFE_2BYTE_COPY MACRO  from, to
+        local   retry
+retry:
+        movff   from+1,WREG             ; High byte in W.
+        movff   WREG,to+1               ; and destination.
+        movff   from+0,to+0             ; Copy low byte.
+        movff   from+1,TABLAT           ; another bank-safe read.
+        xorwf   TABLAT,W                ; High byte changed ?
+        bnz     retry
+        ENDM