Hi all How to write a pragram to subtraction immediate data from accumulator with borrow in C51?
"So anyone can for explain a simple program." The subject of your question is a perfect example. The 8051 is an 8-bit processor, so all its instructions deal with only 8 bits at a time. Therefore, if you want to handle data larger than 8 bits in Assembler, you have to "manually" code it 8 bits at a time. The Subtract-with-Borrow (and, similarly, Add-with-Carry) instruction allows you to do subtraction on data larger than 8 bits by handling 8 bits at a time, and including a "borrow" from the previous 8-bit operation. In 'C', you don't mess about with all this detail - you just use the 16-bit data type (int) or 32-bit data type (long) built into the language!
long a, b, c; a = b - c; // 32-bit subtraction in 'C' is just a simple use of the '-' operator!