;	WinSTon

;	AND <ea>,Dn
;	AND Dn,<ea>

;	XNZVC
;	-**00

PUBLIC _and_ea_dn_byte
PUBLIC _and_ea_dn_word
PUBLIC _and_ea_dn_long
PUBLIC _and_dn_ea_byte
PUBLIC _and_dn_ea_word
PUBLIC _and_dn_ea_long

;-----------------------------------------------------------------------
;AND.B <ea>,Dn
_and_ea_dn_byte PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		[edx],bl								;Dest Dn
	SET_NZ
_and_ea_dn_byte ENDP

;AND.W <ea>,Dn
_and_ea_dn_word PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		[edx],bx								;Dest Dn
	SET_NZ
_and_ea_dn_word ENDP

;AND.L <ea>,Dn
_and_ea_dn_long PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		[edx],ebx								;Dest Dn
	SET_NZ
_and_ea_dn_long ENDP

;-----------------------------------------------------------------------
;AND.B Dn,<ea>
_and_dn_ea_byte PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		bl,[edx]								;Src Dn
	WRITE_BYTE_NZ
_and_dn_ea_byte ENDP

;AND.W Dn,<ea>
_and_dn_ea_word PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		bx,[edx]								;Src Dn
	WRITE_WORD_NZ
_and_dn_ea_word ENDP

;AND.L Dn,<ea>
_and_dn_ea_long PROC NEAR
	EFFADDR_READ									;Read <ea>
	xor		al,al									;Clear NZVC(ignore X)
	mov		edx,DECODE_2[ecx]						;DReg
	and		ebx,[edx]								;Src Dn
	WRITE_LONG_NZ
_and_dn_ea_long ENDP
