![]() | ![]() | ![]() |
| | |||||||
| 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) |
| Just checking to see if it is ok to do this, i have stored data into STORE1 and want to check it more than once to see what character it has stored in it. So is this ok the way i am testing the same location for different data? MOVF STORE1, W SUBLW D'13' BTFSC STATUS, Z RETURN MOVF STORE1, W SUBLW D'10' BTFSC STATUS, Z RETURN I was wondering that by calling the same STORE1 again after the sublw, the data held will have changed from the previous sublw? or does it not store the new value after the first sublw? Hope this makes sense to you guys Thanks Last edited by imhereithink; 6th September 2007 at 09:23 AM. | |
| |
| | (permalink) | |
| Quote:
As you are not writing W back into the STORE1 after each test, the original STORE1 is not changed. Also you are reloading W with STORE1 before each new test, its OK. How many tests are you planning to do on STORE1?
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | ||
| |
| | (permalink) |
| It is fine to do it that way. There is a better way and that is to use xor. Because xoring the same value twice results in the original value, you can use this to your advantage. Code: MOVF STORE1, W xorlw D'13' ; is it 13 BTFSC STATUS, Z RETURN xorlw D'13'^D'10' ; is it 10 BTFSC STATUS, Z RETURN xorlw D'10'^'A' ; is it "A" BTFSC STATUS, Z goto CommandA BTW, when you do any operation with a literal (sublw) the answer always goes in W. Mike. | |
| |
| | (permalink) |
| Thanks for clearing that up guys Eric i am planning on testing STORE1 four times, since i seem to be having sychronisation problems when reading in the received data, so i am wanting to test each bit stored for CR, LF, O, K. That way i should pick up what i am looking for even if it is out of sync. Thanks again | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Quick Question About sharing programming pins on a PIC | 2camjohn | Micro Controllers | 4 | 5th May 2007 05:39 AM |
| Quick question about logic switching FET's.. | Blueteeth | General Electronics Chat | 12 | 16th February 2007 07:43 PM |
| Quick Newbie Question | stcogolin | General Electronics Chat | 8 | 21st December 2003 05:50 PM |
| Quick Question, DC motors | flight1060 | General Electronics Chat | 2 | 12th May 2003 12:36 AM |
| quick question | droid | Micro Controllers | 1 | 25th April 2003 06:14 PM |