emul32b.s

来自「avr的icc编译器的源代码」· S 代码 · 共 93 行

S
93
字号
	.textempy32s::empy32u::;  think of one operand as consisting of bytes (high) A B C D (low); and the other operand as consisting of bytes (high) E F G H (low)	.define	A R19	.define	B R18	.define	C R17	.define	D R16	.define	E R27	.define	F R26	.define	G R25	.define	H R24; inputs: R19..R16 multiplier;	  R27..R24 multiplicand; output: R8..R11  product;	  R7	   overflow indicator if not zero	rcall	long_prolog	push R7	; rfm - done after long_prolog so the		; end can still be a rjmp to long_epilog	rcall	tstzero1	; this along with next step are optional	breq	donemul		; exit if multiplier is zero	clr	R7		; zero value and overflow accumualtor	rcall	tstzero2	; this along with next step are optional	brne gomul	movw R16,R24	movw R18,R26	rjmp donemulgomul:	MUL	D,H	mov	R11,R0	mov	R10,R1	MUL	B,H	mov	R9,R0	mov	R8,R1	MUL	C,H	add	R10,R0	adc	R9,R1	adc	R8,R7	MUL	D,G	add	R10,R0	adc	R9,R1	adc	R8,R7	MUL	C,G	add	R9,R0	adc	R8,R1	MUL	D,F	add	R9,R0	adc	R8,R1	MUL	A,H	add	R8,R0	or	R7,R1	MUL	B,G	add	R8,R0	or	R7,R1	MUL	C,F	add	R8,R0	or	R7,R1	MUL	D,E	add	R8,R0	or	R7,R1	MUL	A,G	or	R7,R0	or	R7,R1	MUL	B,F	or	R7,R0	or	R7,R1	MUL	C,E	or	R7,R0	or	R7,R1	MUL	A,F	or	R7,R0	or	R7,R1	MUL	B,E	or	R7,R0	or	R7,R1	MUL	A,E	or	R7,R0	or	R7,R1moveresult:; funky big endian order remap. "thanks" Everett; You're welcome, Richard.  We aim to produce things in the; well-known better order	mov	r16,r11	mov	r17,r10	mov	r18,r9	mov	r19,r8donemul:	pop	R7	; rfm	rjmp	long_epilog

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?