??? 10/01/09 11:21 Read: times |
#169332 - tried it Responding to: ???'s previous message |
Yes, I tried it. What I found out was that after it came to the correct
Here's the original: AHUNDS: MOV A, R0 FZERO: CJNE A, #0, FONE MOV R3, #ZERO FONE: CJNE A, #1, FTWO MOV R3, #ONE FTWO: MOV R3, #TWO RET oaky, let's say it goes into FZERO, and matches #0. it does the next instruction (MOV R3, #ZERO), and then goes to (FONE). since it doesn;t match, it proceeds to (FTWO), where R3 -which originally had #ZERO- gets overwritten by #TWO. Did I get it right? So that's why it's important to do a RET right after R3 is written so it won't be rewritten by the last value. Tell me if my explanation was wrong. Thanks for the idea, by the way. Regards, JR |