Hardware Reference
In-Depth Information
debug or modify the code. Nothing should be taken for granted and all loose
ends should be explained!
During
the
development
phase,
it
is
worth
including
a
brief
develop-
ment history within the main program header,
as shown in the following
example:
' *******************************************
' * Program: DSM3.BAS *
' * Version: 0.1 *
' * Copyright USET 1999 *
' *******************************************
'
'
' Development history
' 12/01/99 Creation date
' 13/01/99 Structure defined
' 14/01/99 New sub-programs added
' 16/01/99 64K block save and load added
' 18/01/99 Viw sample added
' 20/01/99 Block size increased to 256K
' 28/01/99 Mixed language interface added
' 28/01/99 Interrupt enable/disable added
' 29/01/99 Various flags added
' 29/01/99 Assembly language modules added
' 04/02/99 Block size modified to 128K
' 05/02/99 View sample removed
' 10/02/99 Multiple blocks added
' 15/02/99 Save data file added
Names
Names used for variables, symbols, and labels should be meaningful and any
abbreviations used should be as obvious as possible. In the case of the names
used for constants, where standard abbreviations are in common use (e.g.
ESC for Escape), they should be adopted. In a large program, there may be
a large number of labels and/or constants and it will be necessary to distinguish
between them.
As an example of the use of names, comments, and headers consider the
following examples which, while functionally identical, illustrate the extremes
of programming style:
Case converter subroutine
;
;
CASE CONVERTER
;
con:
CMP AL,6lH
; Compare A with 6lH
JE
exit
; Return if carry set
CMP AL,7BH
; Compare A with7 BH
JNE exit
; Return if carry reset
SUB AL,20H
; Subtract 20H from A
exit:
RET
; Return
Search WWH ::




Custom Search