DM-COP8/20D National Semiconductor, DM-COP8/20D Datasheet - Page 160

no-image

DM-COP8/20D

Manufacturer Part Number
DM-COP8/20D
Description
CABLE FOR DEBUG MODULE 20-DIP
Manufacturer
National Semiconductor
Datasheet

Specifications of DM-COP8/20D

Accessory Type
20-DIP Target Cable
For Use With/related Products
MetaLink Debug Module
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
*DM-COP8/20D
MULTIPLY (16X16) SUBROUTINE
MULTIPLICAND IN [1,0] MULTIPLIER IN [3,2]
PRODUCT IN [5, 4, 3, 2]
CNTR:
MULT:
MLOOP:
TEST:
2.19.4 Binary Division
The following program shows a subroutine for a 16-by-16-bit binary division. A 16-bit
quotient is generated along with a 16-bit remainder. The dividend is left shifted up into
an initially-cleared 16-bit test window where the divisor is test-subtracted. If the test
subtraction generates no high-order borrow, then the real subtraction is performed with
the result stored back in the test window. At the same time, a quotient bit (equal to 1) is
inserted into the low end of the dividend window to record that a real subtraction has
taken place. The entire dividend and test window is then shifted up (left shifted) one bit
position with the quotient following the dividend.
Note that the four left shifts (LD, ADC, X) in the LSHFT section of the program are
repeated as straight-line code rather than a loop in order to optimize throughput time.
2-122
COP8SAx7 MICROCONTROLLER
.SECT
.DSB 1
.SECT
LD
LD
LD
LD
LD
RC
LD
RRC
X
LD
RRC
X
LD
RRC
X
LD
RRC
X
LD
IFNC
JP
RC
LD
LD
ADC
X
LD
ADC
X
DRSZ
JP
RET
MEMCNT, REG
CODE, ROM
CNTR,#17
B,#4
[B+],#0
[B],#0
X,#0
A,[B]
A
A,[B-]
A,[B]
A
A,[B-]
A,[B]
A
A,[B-]
A,[B]
A
A,[B]
B,#5
TEST
B,#4
A,[X+]
A,[B]
A,[B+]
A,[X-]
A,[B]
A,[B]
CNTR
MLOOP

Related parts for DM-COP8/20D