![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I have confused with carry bit in many cases, still I don’t know what the real meaning is. Ex: before this subtraction occurred TEMP = 5 & COUNT = 1 Code: movf TEMP,W subwf COUNT,F btfss STATUS,C Please explain this to me. Thanks | |
| |
| | (permalink) |
| The subtract instruction sets or clears the carry flag. If the flag is set after the subtract, there was no borrow e.g 10-4 = 6 carry flag set also 10-10 = 0 carry flag set If the flag is clear after the subtract there was a borrow e.g. 4-10 = -6 Carry flag cleared In your example Wreg = 5, Count = 1 1-5 = -4, Carry is clear Last edited by geko; 28th November 2007 at 10:17 AM. | |
| |
| | (permalink) |
| OK thanks Geko for the reply. Can you tell me whats my result in my example? is it -4? | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| Ok thanks geko now I got it. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| HD44780 lcd help | jay543_uk | Micro Controllers | 12 | 8th November 2007 04:26 PM |
| 16 bit serial in parallel out shift registers | forder | Electronic Projects Design/Ideas/Reviews | 13 | 27th October 2007 12:24 PM |
| RS232 Converter | e.chain | Micro Controllers | 0 | 6th October 2007 07:19 PM |
| carry and digit carry definition | max_imum2000 | General Electronics Chat | 6 | 8th May 2006 05:40 PM |
| PIC subtraction: Carry flag | eblc1388 | Micro Controllers | 4 | 19th June 2005 02:47 PM |