;	WinSTon

;	ADDQ #<data>,Dn
;	ADDQ #<data>,An
;	ADDQ #<data>,<ea>

;	XNZVC
;	*****

PUBLIC _addq_imm_dn_byte
PUBLIC _addq_imm_dn_word
PUBLIC _addq_imm_dn_long
PUBLIC _addq_imm_an_word
PUBLIC _addq_imm_an_long
PUBLIC _addq_imm_ea_byte
PUBLIC _addq_imm_ea_word
PUBLIC _addq_imm_ea_long

;-----------------------------------------------------------------------
;ADDQ.B #<data>,Dn
_addq_imm_dn_byte PROC NEAR
	mov		ebx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	mov		edx,DECODE_1[ecx]						;<ea>
	add		[edx],bl
	SET_NZV_CX_SAME
_addq_imm_dn_byte ENDP

;ADDQ.W #<data>,Dn
_addq_imm_dn_word PROC NEAR
	mov		ebx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	mov		edx,DECODE_1[ecx]						;<ea>
	add		[edx],bx
	SET_NZV_CX_SAME
_addq_imm_dn_word ENDP

;ADDQ.L #<data>,Dn
_addq_imm_dn_long PROC NEAR
	mov		ebx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	mov		edx,DECODE_1[ecx]						;<ea>
	add		[edx],ebx
	SET_NZV_CX_SAME
_addq_imm_dn_long ENDP

;-----------------------------------------------------------------------
;ADDQ.W #<data>,An
_addq_imm_an_word PROC NEAR
	mov		ebx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	mov		edx,DECODE_1[ecx]						;<ea>
	add		[edx],ebx								;- Use all 32-bits
	FRET
_addq_imm_an_word ENDP

;ADDQ.L #<data>,An
_addq_imm_an_long PROC NEAR
	mov		ebx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	mov		edx,DECODE_1[ecx]						;<ea>
	add		[edx],ebx
	FRET
_addq_imm_an_long ENDP

;-----------------------------------------------------------------------
;ADDQ.B #<data>,<ea>
_addq_imm_ea_byte PROC NEAR
	EFFADDR_READ									;Read <ea>
	mov		edx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	add		bl,dl
	WRITE_BYTE_NZV_CX_SAME
_addq_imm_ea_byte ENDP

;ADDQ.W #<data>,<ea>
_addq_imm_ea_word PROC NEAR
	EFFADDR_READ									;Read <ea>
	mov		edx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	add		bx,dx
	WRITE_WORD_NZV_CX_SAME
_addq_imm_ea_word ENDP

;ADDQ.L #<data>,<ea>
_addq_imm_ea_long PROC NEAR
	EFFADDR_READ									;Read <ea>
	mov		edx,DECODE_2[ecx]						;Data 0..7 (0 is '8')
	add		ebx,edx
	WRITE_LONG_NZV_CX_SAME
_addq_imm_ea_long ENDP
