;
;16x16 BINARY MULTIPLY
;MULTIPLICANT IN M(0,1), MULTIPLIER IN M(2,3)
;PRODUCT IN M(2,3,4,5)
;
; EDITTED MAY 11, 1994 - REVISED FOR NEW ASSEMBLER (ASMCOP v4.2) 
;

	.TITLE  BMUL
	.CHIP	ANYCOP
        .SECT   MAIN,ROM,INPAGE

	CNTR=0FF
BEGIN:	LD	CNTR,#011	;CNTR=17 COUNTS
	LD	B,#004
	LD	[B+],#000
	LD	[B],#000
	LD	X,#000
	RC
RSHIFT:	LD	A,[B]
	RRC	A
	X	A,[B-]
	LD	A,[B]
	RRC	A
	X	A,[B-]
	LD	A,[B]
	RRC	A
	X	A,[B-]
	LD	A,[B]
	RRC	A
	X	A,[B]
	LD	B,#005
	IFNC
        JP	TEST
	RC
	LD	B,#004
	LD	A,[X+]
	ADC	A,[B]
	X	A,[B+]
	LD	A,[X-]
	ADC	A,[B]
	X	A,[B]
TEST:	DRSZ	CNTR		        
	JP	RSHIFT
	RET

	.END
