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
|
604
|
11 SAFE_2BYTE_COPY MACRO from,to
|
|
12 local retry
|
0
|
13 retry:
|
604
|
14 movff from+1,WREG ; high byte in WREG, ...
|
|
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 ; did the high byte changed?
|
|
19 bnz retry ; YES - retry
|
|
20 ENDM
|