Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
SUBWF MyFile, W ;subtract W from the file
BTFSS STATUS, C ;Test for borrow (NOT carry)
GOTO WBigger ;W was bigger then file
;W was smaller or equal to file
This sample subtracts W from the content of MyFile. If W is bigger then MyFile then there will be an underflow of MyFile and the borrow flag will be set. On a pic borrow is opposite of carry (so carry is clear on borrow and set on no borrow).
We test for the flag and jump accordingly
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.