SamanthaL said:
Wow. Thank you! I knew it was something simple like that I wasn't seeing!
So the difference between l and f is the actual literal vs the address? When I'm assigning b'11111111' to Test_Case, b'11111111' is the literal and Test_Case is an address where that literal is stored. Am I understanding that correctly?
Ok while what you've said here is correct, being apparently new it's hard to tell if you've got it all exactly right so may need a little more..
Say you equate Test_Case to address dec 64. Then you load your b'11111111' there.
So there's decimal 255 in location 64.
It is the instruction that determines how the next item is used, so even if you give it what you meant between the literal or address, it can still come up wrong if you haven't used the correct instruction.
movlw moves a LITERAL into w. It won't care if you've correctly specified an address like you wanted, it will use that address as a literal value instead of getting the value from the address.
IOW you will normally use:
movf Test_Case,w ..........moves the contents of address Test_Case into w
or
movlw b'11111111' .........moves decimal 255 into w, just specified as binary..
BUT these also still work!
movf b'11111111' .........moves the contents of address d255 into W
or
movlw Test_Case .........moves dec 64 that Test_Case equates to into W, not the value at that location.
Make sure you recognize and understand all 4 possibilities. By far the first two are used the most, and will almost always be what you meant to do. 3 and 4 are sometimes used when calculating indexes and indexing into memory arrays or similar, but they are used a lot less often. IOW the last two are almost always a mistake unless you know exactly why you would be using them.