		.386p
		ASSUME	CS:CODE

		PUBLIC	InnerSgn,Inner

CODE		SEGMENT
		ALIGN	4
InnerSgn	PROC
#V2		EQU	ESP+20
#V1		EQU	ESP+16
#RETADR		EQU	ESP+12
#ESI		EQU	ESP+8
#EDI		EQU	ESP+4
#EBX		EQU	ESP

		PUSH	ESI
		PUSH	EDI
		PUSH	EBX

		MOV	ESI,[#V1]
		MOV	EDI,[#V2]

		MOV	EAX,[ESI]
		MOV	EDX,[EDI]
		IMUL	EDX
		MOV	EBX,EAX
		MOV	ECX,EDX

		MOV	EAX,[ESI+4]
		MOV	EDX,[EDI+4]
		IMUL	EDX
		ADD	EBX,EAX
		ADC	ECX,EDX

		MOV	EAX,[ESI+8]
		MOV	EDX,[EDI+8]
		IMUL	EDX
		ADD	EAX,EBX
		ADC	EDX,ECX

		AND	EDX,EDX
		SETE	CL
		AND	EAX,EAX
		SETNE	CH
		AND	CL,CH
		AND	ECX,1
		LEA	EAX,[EDX+ECX]

		POP	EBX
		POP	EDI
		POP	ESI
		RET
InnerSgn	ENDP



		ALIGN	4
Inner		PROC
#V2		EQU	ESP+20
#V1		EQU	ESP+16
#RETADR		EQU	ESP+12
#ESI		EQU	ESP+8
#EDI		EQU	ESP+4
#EBX		EQU	ESP

		PUSH	ESI
		PUSH	EDI

		MOV	ESI,[#V1]
		MOV	EDI,[#V2]

		MOV	EAX,[ESI]
		MOV	EDX,[EDI]
		IMUL	EDX
		MOV	ECX,EAX

		MOV	EAX,[ESI+4]
		MOV	EDX,[EDI+4]
		IMUL	EDX
		ADD	ECX,EAX

		MOV	EAX,[ESI+8]
		MOV	EDX,[EDI+8]
		IMUL	EDX
		ADD	EAX,ECX

		POP	EDI
		POP	ESI
		RET
Inner		ENDP
CODE		ENDS
		END
