CS 310 Assembly Language Program Style Guidelines

  1. Your program style, readability, and documentation will impact your program grade by as much as 15%.

  2. Every assembly language program must include a program header comment with this format, as the first information in the file:
    ; Name:
    ; TA's name:
    ; Section Time:
    ; Assignment (number):
    ; Date:
    ;
    ; Program name:
    ;
    ; Program Description:
    ; Input: 
    ;      (Describe the set of inputs and error checking if any)
    ; Output:
    ;      (Describe what appears on the screen as output)
    

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

  4. Add a comment before each section of the program, describing what it does, normally specifying it in high level language (HLL) statements.

  5. Comments on a single instruction or two should not just explain that you are adding 1 to R2. Instead, use HLL code as much as possible: count++

  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 and readable manner.

  7. Per subroutine and main program (where applicable):
    ; Description:
    ; Assumptions:    List any assumptions that you make. For example, if you
    ;                 assume that a particular input data item is always valid,
    ;                 state that.
    ; Parameters:     Description of each parameter, and how it is passed, and
    ;                 if it is a register, then is it modified in the subroutine
    ; Return Value:   Description
    ; Stack Diagram:  When we pass parameters via the stack or construct a
    ;                 "stack frame" or "activation record" then diagram this
    ; Register Usage: Specify the role of each register that you are using