Section 9.2: Assembling and running CSC-1 programs (Frame 5)                     [prev][home][next]

Labels must be alphanumeric, starting only with a letter and followed by 0 or more letters or digits. When labels are declared, they end in a colon. Labels may be declared only once, although they may be referenced any number of times from the operand field of an instruction.

Operands are either labels or numbers. If they are labels, then they are turned into numbers by the assembler. The numbers into which labels are translated are the addresses at which those labels were declared. The LDI instruction must not have a label as its operand, since it loads a constant number into the A register. Other instructions such as RET and HLT must not have any operand at all.

Comments begin with a semicolon and go to the end of the line. A line may be entirely blank or may begin with a semicolon, in which case the whole line is treated as a comment and no code is generated for it.