Download Print this page

RCA COSMAC User Manual page 32

Hide thumbs Also See for COSMAC:

Advertisement

COSMAC Microprocessor
(cont'd)
M ADDRESS
M BYTE
OPERATION
COMMENTS
010A
F4
D+M(R(3))
Add
in
multiplicand.
010B
33
BDF
J
If carry in
D F, branch to
010C
10
loc 0110; otherwise:
010D
F6
D/2
Shift the result right
I
010E
30
BR
J
and go to 0113 to shift the rest
010F
13
of result.
0110
F6
D/2
Shift result right.
0111
F9
D OR immed
J
OR in high bit for carry
0112
80
(data)
from instruction at 010A (NOTE).
0113
B4
D~R(4).1
Store result back.
0114
84
R(4).~D
Fetch low byte of result.
0115
33
BDF
}
Delayed branch on shift in
0116
lA
010D or 0110, to 011A.
0117
F6
D/2
Shift low byte
I
0118
30
BR
}
and branch to 001 D
0119
10
to finish shift.
011A
F6
D/2
Shift low byte,
011B
F9
D OR immed
]
and OR in high bit
011C
80
(data)
from shift of 010D or 0110 (NOTE).
011D
A4
D~R(4).0
Put low byte back.
011E
3B
BNF
]
Branch back ("loop") if the original
011F
04
80 hasn't shifted thru yet.
0120
Product is now ready. Continue to
rest of program.
NOTE: The SHIFT RIGHT instruction will not shift the DF bit into the highest bit of D. These operations
essentially restore, if DF=l, a "1" bit into the highest bit of D after a SHI FT RIGHT.
Fig. 40 - Example of program for multiplying two bytes and adding the
result to a third byte.
31

Advertisement

loading