hi tasmod,

start with this routine from Scott Datallo where 'x' is the minuend and 'y' is the subtrahend. if C = 0 after the packed bcd subtraction you'll have to borrow from the next most significant packed bcd minuend byte.

unfortunately no way of debugging my efforts
Why can't you use the MPLAB Simulator?