SUB (BINARY)

SUB, SUBP, DSUB, DSUBP (Binary)

 

SUB instruction subtracts S2 from S1 and save the result in the Destination (assigned device address).

 

 

S1, S2

Source

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

SUB(P)

DSUB(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

o

4

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

o

o

-

o

o

o

-

 

Example)

If X01 is ON, subtract D2 from D1 and then send the result to M20.