Friday, November 13, 2009 1:13 AM,
In correcting one of the programs turned in for program 2, we noticed that at least one student used a label that is off-limits. I did say this in class, but just in case you missed it: You have a lot of freedom to come up with labels that make sense. One set of words that can not be used are words that have a different meaning to the assembler, such as the opcodes (ADD, TRAP, JSR, etc.) or HALT, GETC, IN, RET, etc. We call such words "reserved words." They would confuse the assembler and that is not allowed. Recall that the assembler is looking at ASCII codes corresponding to characters, character by character. If we allowed HALT to be a label, how would the assembler know whether we wanted it to create a symbol table entry or generate the bit pattern 1111 0000 0010 0101 ? Since the assembly code MUST be unambiguous, we adopt the rule that reserved words in the assembly language can not be used as labels. Something to keep in mind as you create meaningful labels. Good luck on the 2nd exam. Yale Patt