Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
;******************************************************************
;
; packed bcd subtract -> x - y = z (C = 0 = 'borrow')
;
bcdsubtract
MOVF y, W ; W = y
SUBWF x, W ; W = x-y
RLF z, F ; lsb of z has the carry
SKPDC ; if lsn of x < lsn of y
ADDLW -0x06 ; then convert lsn of the
; result to BCD.
BTFSS z, 0 ; Similarly for the msn's
ADDLW -0x60
RRF z, F ; Get the carry
MOVWF z ; and save the result