| CODE |
;high=a.b , low=c.d movlw 0xF0 andwf low,F ;c.0 andwf high,W ;a.0 ; at this point, the low nibble of `low' is zero ; W contains the high nibble of `high' xorwf high,W ;a.0^a.b ; now W contains low nibble of high, namely 0x0b ; W ^ high ; 0xa0 ^ 0xab => 0x0b xorwf high,F ;a.0 ;Now the lower nibble of a is cleared. ; W ^ high ; 0x0b ^ 0xab => 0xa0 and this is stored back in high xorwf high,W ;a.b ;Now W contains the original value of high ; W ^ high ; 0x0b ^ 0xa0 => 0xab swapf low,F ;0.c swapf high,F ;0.a addwf low,F ;0.c + a.b skpnc incf high,F ;0.a + carry |
| CODE |
;high=a.b , low=c.d movlw 0xF0 andwf low,F ;c.0 andwf high,W ;a.0 xorwf high,W ;a.0^a.b xorwf high,F ;a.0 xorwf high,W ;a.b swapf low,F ;0.c swapf high,F ;0.a addwf low,F ;0.c + a.b skpnc incf high,F ;0.a + carry [code] movf high,w addwf low,f skpnc incf high,f |