;	WinSTon

;	ADD <ea>,Dn
;	ADD Dn,<ea>

;	XNZVC
;	*****

PUBLIC _add_ea_dn_byte
PUBLIC _add_ea_dn_word
PUBLIC _add_ea_dn_long
PUBLIC _add_dn_ea_byte
PUBLIC _add_dn_ea_word
PUBLIC _add_dn_ea_long

;-----------------------------------------------------------------------
;ADD.B <ea>,Dn
_add_ea_dn_byte PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		[edx],bl								;Dest Dn
	SET_NZV_CX_SAME
_add_ea_dn_byte ENDP

;ADD.W <ea>,Dn
_add_ea_dn_word PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		[edx],bx								;Dest Dn
	SET_NZV_CX_SAME
_add_ea_dn_word ENDP

;ADD.L <ea>,Dn
_add_ea_dn_long PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		[edx],ebx								;Dest Dn
	SET_NZV_CX_SAME
_add_ea_dn_long ENDP

;-----------------------------------------------------------------------
;ADD.B Dn,<ea>
_add_dn_ea_byte PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		bl,[edx]								;Src Dn
	WRITE_BYTE_NZV_CX_SAME
_add_dn_ea_byte ENDP

;ADD.W Dn,<ea>
_add_dn_ea_word PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		bx,[edx]								;Src Dn
	WRITE_WORD_NZV_CX_SAME
_add_dn_ea_word ENDP

;ADD.L Dn,<ea>
_add_dn_ea_long PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	add		ebx,[edx]								;Src Dn
	WRITE_LONG_NZV_CX_SAME
_add_dn_ea_long ENDP

