Download Print this page

RCA COSMAC User Manual page 51

Hide thumbs Also See for COSMAC:

Advertisement

50
User Manual for the
M AOORESS
M BYTE
OPERATION
COMMENTS
0000
00
0001
90
R(01.1+0
lnitialize higher byte oftable pointers STEP 1
0002
BB
O+R(BI.l
0003
BA
O+R(AI.l
0004
F8
M(R(PII+O
Init'ialize lower byte of
Q
table pointer STEP 2
0005
2A
0006
AA
D>R(AI.O
0007
F8
M(R(PII+O
Initialize loop counter to 8
STEP 3
0008
08
0009
A3
0+R(31.0
OOOA
3C
IF EFl *1
Loop here until byte ready
STEP4
noOB
OA
GO TO OOOA
OOOC
EA
A+X
Store input byte
STEP 5
0000
68
IN+M(R(XII
OOOE
lA
R(AI
+
1
Advance table pointer
STEP 6
OOOF
23
R(31-1
Decrement loop counter
0010
83
R(31.0+0
Load and test loop counter
STEP 7
0011
3A
IF O#{)O
0012
OA
GO TO OOOA
0013
F8
M(R(PII'O
Reset
Q
table pointer
STEP8
0014
2A
0015
AA
O+R(AI.O
0016
F8
MIRIPII+O
Set T table pointer
STEP 9
0017
2E
0018
AB
O+RIBI.O
0019
F8
MIRIPII+O
Set loop counter to 4
STEP 10
001A
04
001B
A3
0+RI31.0
001C
60
MIR(XII+OUT
Output; advance pointer
STEP 11
0010
4B
MIRIBII+O; RIBI
+
1
Load time interval counter
STEP 12
001E
B4
D>RI41.1
00lF
24
R(41-1
Decrement tim.e counter
STEP 13
0020
94
R(41.1+0
Load and test time counter
STEP 14
0021
3A
IF O#{)O
0022
lF
GO TO 001F
0023
23
R131-1
Decrement loop counter
STEP 15
0024
83
R(31.0+0
Load and test loop counter
STEP 16'
0025
3A
IF O#{)O
0026
lC
GO TOOO1C
0027
30
BRANCH
Repeat basic sequence
STEP 17
0028
13
TO 0013
0029
- -
002A
--
Ql
o
Table
002B
--
02
Contains State
002C
--
03
Bytes
0020
- -
04
002E
--
T1
T·Table
002F
--
T2
Contains Time Count Bytes
0030
--
T3
0031
--
T4
Fig.
56 -
Sample program code.
and 14 comprise three instructions, or six machine cycles, or 48 clock cycles. With a 1 OO-kHz clock, each
clock cycle is equivalent to 10 x 10-
6
second. Time intervals between output register states would then
equal (256 x 48 x 10 x 10-
6
x Tn), or 0.123Tn seconds. The maximum time interval that could be specified
would be obtained with a T byte value of "FF", which would yield a delay of 256 x 0.123, or 31.5 seconds.
Shorter time intervals can be achieved by using R(4).0 as Te. Longer time intervals could be obtained by
combining several scratchpad registers into a longer time interval counter.
The clock frequency can also
be adjusted to provide a desired time interval range.

Advertisement

loading