0
|
1 ;=============================================================================
|
|
2 ;
|
|
3 ; File isr.inc
|
|
4 ;
|
|
5 ;
|
|
6 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
|
|
7 ;=============================================================================
|
|
8 ; HISTORY
|
|
9 ; 2011-08-06 : [mH] moving from OSTC code
|
|
10
|
|
11 SAFE_2BYTE_COPY MACRO from, to
|
|
12 local retry
|
|
13 retry:
|
|
14 movff from+1,WREG ; High byte in W.
|
|
15 movff WREG,to+1 ; and destination.
|
|
16 movff from+0,to+0 ; Copy low byte.
|
|
17 movff from+1,TABLAT ; another bank-safe read.
|
|
18 xorwf TABLAT,W ; High byte changed ?
|
|
19 bnz retry
|
|
20 ENDM
|