??? 04/13/11 16:45 Read: times |
#181862 - Wrong focus for comments - and untested code Responding to: ???'s previous message |
First thing - don't write comments that describe an assembler instruction. Tell why instead.
We can see that you store a value into R0. We can see the value 25. So why duplicate the information in the comment? Why not a comment saying "Set up number of bytes to receive"? Why a comment "Wait for 8051 to set the RI flag"? Why not a comment "Wait for a character to be received"? Shouldn't you write comments that tell what/why the program does, instead of comments telling what the instruction does? Another thing - what happens if you only get 24 bytes and then a pause? What do you do? Wait for next transmission of 25 characters to eat the first character? Next - your code can't work because you haven't even used pen and paper and tried it out. You have a loop that you intend to run for 25 turns. So why do you load DPTR with 0xfe00 each time and use this address for storage and then increment DPTR? What happens with your increment when you once more loads DPTR with the original value again? |