Download Print this page

RCA COSMAC User Manual page 22

Hide thumbs Also See for COSMAC:

Advertisement

COSMAC Microprocessor
21
A final value of "0" in DF indicates that the subtrahend was larger than the minuend. In this case the value
in D is exactly 100 (hexadecimal) greater than the true (negative) difference.
A
00
33
N
5
6
p
0
-
X
1
ADDAcSS
M
I
F
00
30
01
RIO)
00
71
00
31
00
RI1 )
00
33
I-
ALU
1-)
A
00
33
N
5
c6
p
a
l -
x
1
ADDRESS
M
I
F
00
30
01
RIO)
00
71
00
31
00
R(1 )
00
33
I -
ALU
1-)
00
32
92
R(2)
00
32
OF
=-
t
00
32
92
R(2)
00
32
OF
=
a
~
00
33
57
R(3)
-
-
0
92
00
33
57
R(3)
-
-
0
C5
1
57
Fig. 20 - Example of instruction F5 - SUBTRACT D.
SUBTRACT M
D·M(R(X))
~
D;
C
~
DF
SM
When I=F and N=7, the memory byte addressed by R(X) is subtracted from the byte in D. The result
byte replaces the minuend in D. This operation is identical to F5 with the operands reversed.
A
00
33
N
7
6
p
a
-
x
1
ADDHcSS
M
I
F
00
30
01
RIO)
00
71
00
31
00
R(1)
00
33
~
ALU
HI-
ADDRESS
M
00
30
01
R(O)
00
71
00
31
00
R(1 )
00
33
N
p
a
00
32
92
R(2)
00
32
OF
=-
t
00
32
92
R(2)
00
32
00
33
57
R(3)
-
-
0
92
00
33
57
R(3)
57
Fig.
21 -
Example of instruction F7 - SUBTRACT M.
SHIFT RIGHT
ISHI FT D RIGHT 1 BIT; LSB
~
DF; 0
~
MSB I SHR
When I=F and N=6, the 8 bits in D are shifted right one bit position. The original value of the low·order
D bit is placed in DF. The final value of the high·order D bit is always
"0".
In this instruction, unlike other
instructions in this group, M(R(X)) is not used. This instruction can be used to test successive bits of the
operand or to divide by 2.
RIO)
-
R(1)
-
R(2)
-
R(3)
-
-
-
-
-
1
6
P
a
x
1
I
F
DF~
Cirili
R(O)
R(1)
R(2)
R(3)
m
6
P
a
x
1
I
F
-
-
-
-
-
-
-
-
~
LU-
OF
=
1
o
79
Fig.
22 -
Example of instruction F6 - SHIFT RIGHT.

Advertisement

loading