35.3.6.6. INTEGER COMPARES AND CONDITIONAL JUMPS ON 68K




	
Code			Size	Mnemonic		Description
1011nnn0ss<-EA->	B,W,L	CMP	,Dn		setf(Dn - )
1011nnns11<-EA->	W,L	CMPA	,An		setf(An - )
00001100ss<-EA->	B,W,L	CMPI	#Im,	setf(-#Im)
1011yyy1ss001xxx	B,W,L	CMPM	(Ay)+,(Ax)+	


0110cccc<-Disp->	B,W	Bcc	ds		if (cond)
							  PC <- PC + Disp

0101cccc11001nnn	W	DBcc	Dn,ds		if (!cond)
<--Displayment->					  Dn - 1 -> Dn
							if (Dn != -1)
							  PC + Disp -> PC


	cond	cccc	Description
	F	0000	False			1		(not for Bcc)	
	T	0001	True			0		(not for Bcc)
	HI	0010	High			C + N = 0
	LS	0011	Low or Same		C + N = 1
	CC	0100	Carry Clear		C = 0
	CS	0101	Carry Set		C = 1
	NE	0110	Not Equal		Z = 0
	EQ	0111	Equal			Z = 1
	VC	1000	Overflow Clear		V = 0
	VS	1001	Overflow Set		V = 1
	PL	1010	Plus			N = 0
	MI	1011	Minus			N = 1
	GE	1100	Greater Equal		N XOR V = 0
	LT	1101	Less than		N XOR V = 1
	GT	1110	greater than		Z + (N XOR V) = 0
	LE	1111	Less or Equal		Z + (N XOR V) = 1


01001010ss<-EA->	B,W,L	TST			setf( - 0)
0100101011<-EA->	B	TAS			setf( - 0)
							bit 7, <- 1



@	
35.3.6.7.	INTEGER COMPARES AND CONDITIONAL JUMPS ON Z80



Operation		Description			Code
CALL	cc,nn		if (cc)				cc	code	
				PUSH	PC		NZ	C4 nn nn	
				PC <- nn		Z	CC nn nn
							NC	D4 nn nn
							C	DC nn nn
							PO	E4 nn nn
							PE	EC nn nn
							P	F4 nn nn
							M	FC nn nn

JP	cc,nn		if (cc)				cc	code
				PC <- nn		NZ	C2 nn nn
							Z	CA nn nn
							NC	D2 nn nn
							C	DA nn nn
							PO	E2 nn nn
							PE	EA nn nn
							P	F2 nn nn
							M	FA nn nn


JR	cond,end	if (cond)			cond	code
				PC <- PC + sext(e)	NZ	20 ee
							Z	28 ee
							NC	30 ee
							C	38 ee

CP	r		setf(A - r)			B8+r
CP	n		setf(A - n)			FE nn
CP	(ii+n)						ii CB nn BE


DJNZ	e		B <- B - 1			10 ee
			if (B != 0) 
				PC <- PC + sext(e)


RET	cc		if (cc)				cc	code
				POP	PC		NZ	C0
							Z	C8
							NC	D0
							C	D8
							PO	E0
							PE	E8
							P	F0
							M	F8

		cc	Description
		C	carry
		NC	not carry
		Z	zero
		NZ	not zero
		M	minus
		P	plus
		PE	parity even
		PO	parity odd




Index Prev Next