Simulation (Stage 3.3) -- Adding useful variable (label) names

One of the standards in programming is to use variable names that are "self-documenting". The code segment

C	EQU	0x7200	; Specify location to store the result

	section const	; Start of CONSTANTs section
A	DC.W	639	; Specify and initialize a constant value
B	DC.W	-215	; Specify and initialize a constant value

can't be said to fit that bill.

In addition to the labels A, B and C not being "self-documenting", they also cause problems to the SDS simulator which can't distinguish between a request to use the label A and the hexadecimal address A (actually 0xA but hexadecimal values are assumed within the SDS toolset windows).

In Laboratory 1, "self-documenting" labels is a mute point. It is more important to use label names that are easy to remember so that I can get the simulator to find the locations in memory without me having to remember the specific details of the absolute addresses associated with each label. I decided to use the label names FIRST, SECOND and SUM in my code. The UPPERCASE label names conform with the standard programming practice of using UPPERCASE for CONSTANTS.

	.EXPORT SUM
SUM 	EQU	0x7200		; Specify location to store the result

	section const	; Start of CONSTANTs section
	.EXPORT FIRST	
FIRST	DC.W	639	; Specify and initialize a constant value
SECOND 	DC.W   -215	; Specify and initialize a constant value


Last modified: July 12, 1996 08:26 PM by M. Smith.
Copyright -- M. R. Smith