CS 352H: Assembly Language Program Style Guidelines

(with many thanks to the original guidelines provided at the University of Michigan for EECS/CS 100 and Steve Keckler)


(1) Every assembly language program must include a program header comment with this format, as the first information in the file:
#
# Author name:
# Section number:
# Assignment number:
# Date:
#
# Program name:
#
# SUMMARY
#         Say what the program does.
#
# INPUT
#         Describe the set of inputs.  Describe input error
#      checking, if any.
#
# OUTPUT
#         Describe what appears on the screen as output.
#
# ASSUMPTIONS
#         List assumptions you make about the program.  For
#      example, if you assume that a particular input
#      data item is always valid, state that.
#

(2) Symbolic names must be meaningful. Use a mixture of upper and lower  case to maximize readability. Some good examples:
    SaveR1
    ASCIItoBinary
    InputRoutine
    OPMULT

(3) Explain what each register is used for, in comments.

(4) Add a comment before each section of the program, describing what it does.

(5) Add comments after most of your commands, describing what they do.

(6) All code and comments should fit on the page; i.e., they should not wrap around or be truncated. Long statements that would run off the page should be split in an aesthetically  pleasing manner.

Remember the program style accounts for 20% of the program grade.


Last modified: 09/01/09
Don Fussell, fussell@cs.utexas.edu