Assembly Language Program Style Guidelines
(with many thanks to the original guidelines provided at the University of
Michigan for EECS/CS 100)
(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:
; Program name:
; Say what the program
; Describe the set
of inputs. Describe input error
; checking, if any.
; Describe what appears
on the screen as output.
; List assumptions
you make about the program. For
; example, if you assume that a particular
; 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:
(3) Explain what each register is used for, in comments.
(4) Add a comment before each section of the program, describing what
(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.
Here is a sample assembly program you
should use as a guideline. Remember the program style accounts for 20%
of the program grade.