SUB

SUB R[x], R[y], R[z] - Substraction without Carry

 

Operating Mode

 

R[x] := R[y] - R[z]

PC := PC + 1

 

Description

 

Substracts R[z] from R[y] and writes result to Register R[x].

 

Status Register

 

Carry - Bit := 1 if R[y] - R[z] < 0

Zero - Bit := 1 if result = 0

 

Binary Command

15 14 13 12 11

10 9 8

7 6

5 4 3

2 1 0

00110

Adr(x)

--

Adr(y)

Adr(z)

Example

 

SUB R[3], R[6],R[4]   

15 14 13 12 11

10 9 8

7 6

5 4 3

2 1 0

00110

011

--

110

100

Note
Arithmetic and Logical Commands always affect the Status Bits Carry and Zero.