Instruction manual

to be tested by adding the high order ad-
dress and the low address
of
each loca-
tion
to
a
"counter"
byte.
After
all loca-
tions to be tested have been filled
with
their calcuiated data byte, the routine
then recalculates the
data
byte
that
should be stored in each
location
and
checks
it
against the actual
contents
of
the location. If the
data
in memory is dif-
ferent from the calculated value, then
the location and offending bit pattern
are printed. As previously mentioned,
there can be
differences
due to
"stuck"
bits
or
interaction
of
memory locations.
Each time that
the
routine is successful-
ly executed,
it
will print a
"pius"
on the
system terminal.
To
completely . test
the memory (adding all 256 possible
"counter"
byte
combinations
to
the ad-
dress),
it
is necessary
to
have
256
"plusses"
printed on your terminal. The
program
listing
is exhaustively com-
mented and should be pretty much self
expanitory for even a novice machine
language programmer.
To
test
4K
of
memory occupying
hex
locations
200
to
2FFF,
enter
00
at
0080,
20
at 0081, 00 at 0082, and 30 at
0083 (end address plus
1)
and run at
0010. If no errors are detected, you
will
get a
string
of
plusses on your terminal.
Remember
that
256 plusses are required
to
complete
the
test. An example
of
an
error would
be
a carriage return
line
feed
on the terminal, a four
digit
address (in
hex), a space and a
two
digit
number.
The
two
digit
number represents
the
bad
bit pattern. Now convert
the
"bad
bit"
pattern to
its
binary equivalent. Each
"1"
in
the binary pattern represents a bad bit
at the memory location printed.
If
23A840 was printed on your terminal,
it
would mean
that
bit 6 was bad
at
loca-
tion
23A8. By reference
to
the
memory
board
documentation,
you
should
be
able
to
determine which
chip
on
the
board is faulty.
An
interesting
observation
was
made
during
the developement
of
the
program.
My
machine is a homebrew
S100 bus, dual processor system. I have
a 6502 and a 6800 on an S100
prototype
board, each sharing all
of
the system ex-
cept for a
little
PROM
which
is
unique
for each microprocessor. The system
clock
is derived from the
clock
generator
in the 6502
(1
MHz.). An equivalent
SUMTEST program for the 6800
would
cycle through my 24K
of
memory
with
no
errors detected. The
6502
SUMTEST pro-
gram would
consistantly
catch
several
bad bytes. Apparently there is a few
nanosecond's
difference
in
the
timing
of
the
two
microprocessors, and
that
was
just
enough for some
of
the memory
to
fail. All
of
the memory
that
tested bad on
the
6502
was purchased from one vendor
as 450 nanosecond memory. So
be
aware
that
a few nanoseconds can make
a big difference, and purchase your
memory from a reputable supplier.
19:74
Usting
1
0UI0
SUMTST
OR3
$0100
ASSEM8LE
IN
STACK
PAGE
REMEMBER
THAT
THE
ROUTINE
DESTROYS
THE
CONTENTS
OF
THE
MEMORY
TESTED,.
0100
8GNADL
,
$lJ080
START
ADDRESS
OF
MEMORY
TO
8E
TESTED
0100
8GNADH
,
$0081
011.10
ENDADL
,
$lJ082
END
ADDRESS
&1
OF
MEMORY
TO
8E
TESTED
",Ul0
ENDADH
,
$IJ",83
//l1",0
COUNTR
,
$0084
COUNTER
AND
SEED
FOR
TEST
"'1",0
TMPADL
,
$//l085
WORKING
ADDRESS
POINTER
"'1",0
TMPADH
$IJ",86
"'Ief)
TMPY
$lJ087
TEMPORARY
STORAGE
0,
Y
KIM
ROM
ROUTINES
USED
"'1",0
CRLF
$IE2F
CARRIAGE
RETURN
-
LINE
'EED
"'1",0
OUTCH
$IEA"
OUTPUT
ASCII
CHARACTER
"'UI",
PRTBYT
,
$IE38
PRINT
I
HEX
8YTE
AS
TWO
ASCII
"'1",,,,
OUTSP
$IE9E
OUTPUT
BLANK
el"''''
2",
2F
IE
IN
IT
JSR
CRLF
PRINT
CRILF
"'1",3
A",
",IJ
TEST
LDYIM
$08
INITIALIZE
INDEX
REGISTER
"'11J5
2",
4A
01
JSR
SETEM
CREATE
WORKING
ADDRESS
POINTER
IJHI8
21J
53
"'1
LOOPA
JSR
SUMUM
CALCULATE
TEST
DATA
BYTE
1J11J3
91
85
STAIY
TMPADL
STORE
THE
TEST
BYTE
010D
20
58
IJI
JSR
INCPTR
INCREMENT
THE
WORKING
POINTER
",
II'"
DIJ
F6
SNE
LOOPA
MORE
TO
8E
TESTED?
"'112
20
4A
//l1
JSR
SETEM
REINITIALIZE
WORKING
POINTER
11115
21J
53
IJ
I
LOOPS
JSR
SUMUM
RECALCULATE
THE
TEST
DATA
BYTE
//l118
51
85
EORIY
TMPADL
CHECK
MEMORY
WITH
CALCULATED
TEST
BYTE
III
IA
D0
flF
8NE
ERROR
GO
TELL
IF
TEST
FAILED
IJ
II C 20 58
01
RETURN
JSR
INCPTR
INCREMENT
THE
WORKING
POINTER
011F
Dill
F4
SNE
LOOP8
MORE
TO
8E
TESTED?
1J121
A9
28
ONCE
LDAIM
'&
PRINT
A
"PLUS"
TO
INDICATE
SUCCESS
0123
21J
A0
IE
JSR
OUTCH
PRINT
ASCII
0126
E6
84
INC
COUNTR
SET
UP
NEW
PATTERN
0128
4C
1J3
fl1
JMP
TEST
TEST
UNTIL
MANUAL
RESET
012B
84
87
ERROR
STY
HIPY
SAVE
Y
012D
48
PHA
SAVE
THE
SAD
BIT
PATTERN
",12E
21J
2F
IE
JSR
CRLF
PRINT
CR/LF
0131
A5
86
LOA
TMPADH
GET
HIGH
ADDRESS
OF
ERROR
0133
2//l
38
IE
JSR
PRTBYT
PRINT
IT
//l136
A5
85
LOA
TMPADL
GET
LOW
ADDRESS
OF
ERROR
1J138
21J
38
IE
JSR
PRTBYT
PR
INT
IT
elI3B
2fl
9E
IE
JSR
OUTSP
PRINT
A
SPACE
//l13E
68
PLA
RESTORE
THE
8AD
BIT
PATTERN
1J13F
20 38
IE
JSR
PRTBYT
PR
INT
IT
0142
2//l
2F
IE
JSR
CRLF
PR
I
NT
A CR/LF
0145
A4
87
LDY
TMPY
RESTORE
Y
1J147
4C
IC
IJI
JMP
RETURN
CONTINUE
WITH
THE
TEST
SUBROUTINES
1J14A
A5
8fl
SETEIII
LDA
BGNADL
GET
BEGINNING
ADL
1J14C
85
85
STA
TMPADL
MAKE
A
COPY
elI4E
A5
81
LDA
BGNADH
GET
BEGINNING
ADH
1J151J
85
86
STA
TMPADH
MAKE
A
COPY
l!l152
60
RTS
0153
18
SUIIIUM
CLC
GET
READY
TO
ADD
1J154
A5
86
LDA
TMPADH
GET
WORKING
POINTER
ADH
l!l156
65
85
ADC
TMPADL
ADD
IN
WORXING
POINTER
ADL
0158
65
84
ADC
COUNTR
ADD
IN
COUNTER
015A
60
RTS
RETURN
WITH
CALCULATED
TEST
DATA
BYTE
IN
A
REGISTER
815S
E6
85
INCPTR
INC
TMPADL
INCREMENT
WORK
POINTER
ADL
0150
D0
02
BNE
CMPADL
PAGE
NOT
CROSSED
elI5F
E6
86
INC
Tl'IPADH
INCREMENT
WORK
POINTER
ADH
1J161
A5
85
CIIIPADL
LOA
TMPADL
GET
ADL
OF
WORK
POINTER
0163
C5
82
CMP
ENDADL
SEE
IF
END
OF'
MEIIIORY
TO
BE
TESTED
0165
DIJ
114
BNE
RTN
RETURN
IF
NO
MATCH
0167
A5
86
LOA
Tl'IPADH
GET
ADH
OF
END
0'
MEMORY
TO
BE
TESTED
//l169
C5
83
CMP
ENDADH
SEE
IF
ADH'S
MATCH
1l16B
61l
RTN
RTS
RETURN
WITH
~ESULTS
OF
CMP
IN
Z
FLAG
MICRO
--
The 6502 Journal
December, 1979