??? 05/06/09 16:45 Read: times |
#165112 - Probably helper function from your C RTL. Responding to: ???'s previous message |
It is a call to a helper function.
Most probably, the function performs an 16-bit unsigned test if one number is greater than another. Most probably, the first number is stored in A and B, and the second number in R3 and R4. Most probably, the helper function is part of the C runtime library for your compiler, i.e. if you write code looking like: unsigned short a,b; a = yerror; b = 0x59; if (a > b) { // do something } else { // do something else } the disassembly of the output will probably show a call to this helper function for the "if (a > b)" statement. I don't think you should make it a habit of writing comments that tells what an assembler instruction does on the bit level. You should instead try to focus on documenting why it does something - the reason for having the instruction there. Writing the comments like you do may seem to help during the first days of programming. But when you do start writing own code, you will after a while find that the comments don't add any value since you have just translated between two languages: 8051 assembler and english. But since the source code is a living entity, there is also a good probability that you will change the assembler instruction but forget to change the comment. Then you suddently have two translations that tells different stories. When you do find code where the assembler instructions does one thing, and the comments does something else, you get into big troubles. Have you found a bug in the assembler instructions, i.e. the comments did tell what was expected to happen? Or have you just found a documentation error? |
Topic | Author | Date |
Deciphering non-commented code from previous programmer! | 01/01/70 00:00 | |
Probably helper function from your C RTL. | 01/01/70 00:00 | |
commenting better later on | 01/01/70 00:00 | |
this is for u | 01/01/70 00:00 | |
1)wrong, 2) irrelevant | 01/01/70 00:00 | |
huh? | 01/01/70 00:00 | |
Your puzzlement is justified! | 01/01/70 00:00 | |
Thank you![]() | 01/01/70 00:00 |