??? 05/21/04 10:51 Read: times |
#70812 - Here is your code Responding to: ???'s previous message |
OK Adnan,
I give in. Here is what you want : ; UTIL_INC24 increments the 3 byte wide Hex digit by 1 count everytime it is called. ; Call with R0 pointing to the LSB of the Hex digit that is to be incremented. After the routine completes and returns your three byte wide Hex digit would have incremented by one. UTIL_INC24: MOV A, @R0 ; Get Low Byte ADD A, #1 ; Add 1 MOV @R0, A ; Store Back INC R0 ; Point To next Byte MOV A, @R0 ; Get the Byte ADDC A, #0; Add CY, If Set MOV @R0, A ; Store Back INC R0 ; Point to High Byte MOV A, @R0 ; Get the byte ADDC A, #0 ; Add CY , if set MOV @R0, A ; Store back RET All that remains to be done is now to shave-off last few lines ( you do that !) to make it work for a two byte wide digit. Trust your problem is solved. Raghu |