Posted on 06-19-2006, by Tim
Comments are essential to LC-3 programming. They tell people looking at your code what you really mean. Assembly language is simply not pleasant to look at. Comments make a world of difference between good code and bad code. Always comment your code because it will pay off when you have to revisit your code months, even years down the road. You will save a lot of time and you'll still be able to understand what you were doing.
There is only one type of comment in LC-3: ";"
|; this is a comment |
"this is a comment" will be ignored by the assembler. Comments can occupy a whole line or they can be appended to lines of code:
|ADD R1, R1, #1 ; increment R1 by 1 |
Comments increase the readability of your code and are useful for every kind of project.
- Views: 11942