head	1.2;
access;
symbols
	isorc2008_submission:1.1.1.1
	handbook_alpha_edition:1.1.1.1
	jtres2007_submission:1.1.1.1
	bg1_07:1.1.1.1
	bg1_06:1.1.1.1
	bg1_05:1.1.1.1
	TAL_101:1.1.1.1
	TAL_100:1.1.1.1
	jtres_submission:1.1.1.1
	wises06_submission:1.1.1.1
	lctes2006_submission:1.1.1.1
	rtgc_isorc2006:1.1.1.1.0.4
	isorc2006:1.1.1.1.0.2
	rtgc_paper:1.1.1.1
	bg1_00:1.1.1.1
	nohandle:1.1.1.1
	thesis:1.1.1.1
	arelease:1.1.1.1
	avendor:1.1.1;
locks; strict;
comment	@;; @;


1.2
date	2008.02.23.23.31.25;	author martin;	state dead;
branches;
next	1.1;
commitid	126547c0accc4567;

1.1
date	2004.02.19.13.20.52;	author martin;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2004.02.19.13.20.52;	author martin;	state Exp;
branches;
next	;


desc
@@


1.2
log
@JOP goes GPL
@
text
@//
//	mulshft_sw.asm
//
//		'software' version of ishl, ishr, iushr and imul:
//		As replacement of mulshft.vhd if size problems.
//

ishl:
			ldi	31			// to be optimized!!!
			and	
			stm	a			// counter
			stm	b			// value

			ldm	a
			nop
			bz	ishl_end
			nop
			nop

ishl_loop:
			ldm	b			// shift
			dup
			add
			stm	b

			ldm	a
			ldi	-1
			add
			stm	a

			ldm	a
			nop
			bnz	ishl_loop
			nop
			nop
ishl_end:
			ldm	b nxt

ishr:
			ldi	31			// to be optimized!!!
			and	
			stm	a			// counter
			dup
        	ldi	-2147483648		//  0x80000000
			and
			stm	c			// sign
			stm	b			// value

			ldm	a
			nop
			bz	ishr_end
			nop
			nop

ishr_loop:
			ldm	b			// shift
			shr
			ldm	c
			or				// plus sign
			stm	b

			ldm	a
			ldi	-1
			add
			stm	a

			ldm	a
			nop
			bnz	ishr_loop
			nop
			nop
ishr_end:
			ldm	b nxt

iushr:
			ldi	31			// to be optimized!!!
			and	
			stm	a			// counter
			stm	b			// value

			ldm	a
			nop
			bz	iushr_end
			nop
			nop

iushr_loop:
			ldm	b			// shift
			shr
			stm	b

			ldm	a
			ldi	-1
			add
			stm	a

			ldm	a
			nop
			bnz	iushr_loop
			nop
			nop
iushr_end:
			ldm	b nxt

imul:
			stm	b
			stm	a
			ldm	a
        	ldi	-2147483648		//  0x80000000
			and
			dup					// make a positiv
			nop
			bz	imul_apos
			nop
			nop
			ldm	a
			ldi -1
			xor
			ldi 1
			add
			stm	a
imul_apos:
			ldm	b
        	ldi	-2147483648		//  0x80000000
			and
			dup					// make b positiv
			nop
			bz	imul_bpos
			nop
			nop
			ldm	b
			ldi -1
			xor
			ldi 1
			add
			stm	b
imul_bpos:
			xor					//	sign
			stm	e

			ldi	0
			stm	c
			ldi	32			//	loop counter
imul_loop:
			ldm	c
			dup
			add
			stm	c
			ldm	a
        	ldi	-2147483648		//  0x80000000
			and
			nop
			bz	imul_noadd
			nop
			nop
			ldm	c
			ldm	b
			add
			stm	c
imul_noadd:
			ldm	a
			dup
			add
			stm	a
			ldi	1
			sub
			dup
			nop
			bnz	imul_loop
			nop
			nop
			pop				// remove loop counter
			ldm	e
			nop
			bz	imul_nosign
			nop
			nop
			ldm	c
			ldi -1
			xor
			ldi 1
			add	nxt
imul_nosign:
			ldm	c	nxt
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@initial cvs import.
@
text
@@
