35.3.1.6. INTEGER ARITHMETICAL ON 68K



	
	
Code			Size	Mnemonic		Description
1101nnn0ss<-EA->	B,W,L	ADD	Dn,		Dn +  -> 
1101nnn1ss<-EA->	B,W,L	ADD	,Dn		 + Dn -> Dn
				
1101nnns11<-EA->	W,L	ADDA	,An		 + An  -> An
00000110ss<-EA->	B,W,L	ADDI	#Im,	 + #Im -> 
0101xxx0xx<-EA->	B,W,L	ADDQ	#x,		 + #x  -> 
							 #x=1..8
1101yyy1ss000xxx	B,W,L	ADDX	Dy,Dx		Dx + Dy + X -> Dx
1101yyy1ss001xxx	B,W,L	ADDX	-(Ay),-(Ax)	 +  + X 
							-> 
	- - - - - - - - -
1000nnn111<-EA->	32->16	DIVS	,Dn		Dn/ -> Dn
							[signed]
1000nnn011<-EA->	32->16 	DIVU	,Dn		Dn/ -> Dn
							[unsigned]

1100nnn111<-EA->	16->32	MULS	,Dn		Dn *  -> Dn
							[signed]
1100nnn011<-EA->	16->32	MULU	,Dn		Dn *  -> Dn
							[unsigned]
        - - - - - - - - - 
01000100ss<-EA->	B,W,L	NEG			0 -  -> 
01000000ss<-EA->	B,W,L	NEGX			0 -  - X -> 

1001nnn0ss<-EA->	B,W,L	SUB	,Dn		Dn -  -> Dn
1001nnn1ss<-EA->	B,W,L	SUB	Dn,		 - Dn -> 
1001nnns11<-EA->	W,L	SUBA	,An		An -  -> An
00000100ss<-EA->	B,W,L	SUBI	#Im,	 - #Im -> 
0101xxx1ss<-EA->	B,W,L	SUBQ	#x,		 - #x  -> 
							#x = 1..8
1001yyy1ss000xxx	B,W,L	SUBX	Dy,Dx		Dx - Dy - X -> Dy
1001yyy1ss001xxx	B,W,L	SUBX	-(Ay), -(Ax)	-(Ax) - -(Ay) -X -> (Ay)


 =============== Since MC68020: ======================
0100110000<-EA->	L	MULS.L	,Dn		Dn *  -> Dn
0lll10000000hhhh					(32x32->32) Signed

0100110000<-EA->	L	MULS.L	,Dn:Dh	Dn *  -> Dn:Dh
0lll11000000hhhh					(32x32->64) Signed

0100110000<-EA->	L	MULU.L	,Dn		Dn *  -> Dn
0lll00000000hhhh					(32x32->32) Unsigned

0100110000<-EA->	L	MULU.L	,Dn:Dh	Dn *  -> Dn:Dh
0lll01000000hhhh					(32x32->64) Unsigned

0100110001<-EA->	L	DIVS.L	,Dq		Dq /  -> Dq
0qqq100000000rrr

0100110001<-EA->	L	DIVS.L	,Dr:Dq	Dr:Dq /  -> Dr:Dq
0qqq110000000rrr

0100110001<-EA->	L	DIVU.L	,Dq		Dq /  -> Dq
0qqq000000000rrr

0100110001<-EA->	L	DIVU.L	,Dr:Dq	Dr:Dq /  -> Dr:Dq
0qqq010000000rrr
			

@	
35.3.1.7.	INTEGER ARITHMETICAL ON Z80


Operation		Description			Code
ADC	A,r		A <- A + r + Cy			88+r
ADC	A,n		A <- A + n + Cy			CE n
ADD	A,(ii+n)	A <- A + (ii+n) + Cy		ii 8E
ADC	HL,rr		HL <- HL + rr + Cy		ED 01xx1010

ADD	A,r		A <- A + r			80+r
ADD	A,n		A <- A + n			C6 n
ADD	A,(ii+n)	A <- A + (ii+n)			ii 86 n 	
ADD	HL,rr		HL <- HL + rr			00xx1001
ADD	IX,ry		IX <- IX + ry			ii 00xx1001
ADD	IY,rx		IY <- IY + ry			ii 00xx1001

DEC	r		r --				00xxx101
DEC	(ii+n)		(ii+n) --			ii 35 n
DEC	rr		rr --				00xx1011
DEC	ii		ii --				ii 2B

INC	r		r ++				00xxx100
INC	(ii+n)		(ii+n) ++			ii 34 n
INC	rr		rr ++				00xx0011
INC	ii		ii ++				ii 23

NEG			A <- 0 - A			ED 44

SBC	A,r		A <- A - r - Cy			98+r
SBC	A,n		A <- A - n - Cy			DE n
SBC	A,(ii+n)	A <- A - (ii+n) - Cy		ii 9E n
SBC	HL,rr		HL <- HL - rr - Cy		ED 01xx0010

SUB	r		A <- A - r			90+r
SUB	n		A <- A - n			D6 n
SUB	(ii+n)		A <- A - (ii+n)			ii 96 n




Index Prev Next