IDEAL
P386
MODEL FLAT

DATASEG

CODESEG

; Input:
;	ESI: src
;       EDI: dest
;	ECX: NumPixels

PUBLIC  RenderScan_
PROC	RenderScan_
	pushad
@@l:	xor	eax,eax
	mov	bl,[esi]
	inc	esi
	mov	al,[edi]
	add	al,bl
	cmp	eax,127
	ja	@@correct
	mov	[edi],al
	inc	edi
	dec	ecx
	jnz	@@l
	popad
	ret

@@correct:
	mov	[byte ptr edi],127
	inc	edi
	dec	ecx
	jnz	@@l
	popad
	ret
ENDP
END