I am a beginner in uP and I can't manage to substract 2 16bits numbers by writing a programm in assembly.
I found a solution but not using the "sub" command and I think there should exist a more simple one.
Can someone help?
You need to use an instruction common in most uP's called "subtract with borrow" or "subtract with carry." It's usually 'SBB' or 'SBC'. On the Intel 8086, you can do 16-bit math using 8-bit registers via:
presumably the 8085 code isn't too far off... "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
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.