??? 05/19/05 19:14 Read: times |
#93618 - to Mehdi Responding to: ???'s previous message |
Mehdi said:
mov a,dpl cjne a,sizelow, continue mov a,dph cjne a,sizehigh, continue sjmp stop_program The above code does not work. I cannot free up the dptr. Just wondering if there is an easier way to do this. Charles,Your code is correct completely when '=' operation doesn't meet your demands first side or second side or both are changed through the program At first I guess your dptr changes, in this situation you can use Push dph,Push dpl to store your dptr and Pop dph,Pop dpl to restore dptr in proper locations If you use EQU operation just like below sizelow EQU 4EH sizehigh EQU 4FH Then Are you sure 4EH and 4FH haven't use in other place of your code Search 4EH,4FH in your code with Edit+Find+4EH on your Assembler Are you sure your program reach to this part It is possible your program fall on to a hole and can't arrive to '=' operation It is better that you simulate your code in a simulator Use breakpoint in this part of source code and then continue Good Luck Mehdi thank you Mehdi, i got it to work. I was using your I2C code (specifically for learning) in order to build an eeprom programmer using an 89C51 and a terminal program. It is working perfectly. All of the other I2C sample code did not work at all, however your code did help me learn a great deal, I thank you! Regards, CT |
Topic | Author | Date |
compare two bytes | 01/01/70 00:00 | |
equ operator | 01/01/70 00:00 | |
re: equ operator | 01/01/70 00:00 | |
value v pointer | 01/01/70 00:00 | |
comparing two bytes | 01/01/70 00:00 | |
Is it like this? | 01/01/70 00:00 | |
bible time | 01/01/70 00:00 | |
A bit more | 01/01/70 00:00 | |
to Mehdi![]() | 01/01/70 00:00 |