??? 05/09/04 16:21 Read: times |
#70069 - RE: Some questions about the code Responding to: ???'s previous message |
Amir Hayat wrote:
------------------------------- ... 1) what does PASS 1 and pass 2 means as mentioned by Prahlad J. Purohit? ... When the assembler or compiler translates the mneumonic code you write into binary numbers, some of those numbers can not be known the first time through. For example, in your program you might label a section of code with a name like RESET_LEDS, so that in other parts of your program you can simply write, JNZ RESET_LEDS. But the assembler has to know the actual binary address where that section of code will be put. Conditional jumps are another good example of this problem. So the assembler initially goes through the code and translates it into binary, marking unknown things (like that address) with a placeholder. After if has gone through once (PASS 1) it can then go back through again (PASS 2) and fill in those values it couldn't know the first time through. You should also know that there can be more than 2 passes in an assembly/compilation. As an exercise, write a simple program like using one of the ports as a ripple counter and then translate it into machine code yourself. This sort of thing will become much clearer. |
Topic | Author | Date |
what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding![]() | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
RE: what these terms do in coding | 01/01/70 00:00 | |
Some questions about the code | 01/01/70 00:00 | |
RE: Some questions about the code | 01/01/70 00:00 | |
Some questions about the code | 01/01/70 00:00 | |
Some more questions about the Main Loop | 01/01/70 00:00 |