Texas Instruments MSP50C614 SUB Subtract, Dest, src , src1 , next a, An ~ , An , adrs , next a

Models: MSP50C614

1 414
Download 414 pages 24.44 Kb
Page 266
Image 266

Individual Instruction Descriptions

4.14.79 SUB

 

Subtract

 

 

 

 

 

 

 

Syntax

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[label]

name

 

dest, src, src1, [next A]]

 

 

Clock, clk

Word, w

With RPT, clk

Class

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB

 

An[~], An, {adrs} [, next A]

 

Table 4±46

 

Table 4±46

1a

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB

 

An[~], An[~], imm16 [, next A]

 

2

 

2

N/R

2b

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB

 

An[~], An[~], PH [, next A]

 

1

 

1

nR+3

3

 

 

SUB

 

An[~], An, An~ [, next A]

 

 

1

 

1

nR+3

3

 

 

SUB

 

An[~], An~, An [, next A]

 

 

1

 

1

nR+3

3

 

 

SUB

 

Rx, imm16

 

 

2

 

2

N/R

4c

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB

 

Rx, R5

 

 

1

 

1

N/R

4d

Execution

[premodify AP if mod specified]

 

 

 

 

 

 

 

 

dest dest ± src1

(for two operands)

 

 

 

 

 

 

dest src ± src1

(for three operands)

 

 

 

 

 

 

PC PC + w

 

 

 

 

 

 

 

Flags Affected

dest is An:

 

dest is Rx:

 

src1 is {adrs}:

Opcode

 

OF, SF, ZF, CF are set accordingly RCF, RZF are set accordingly TAG bit is set accordingly

Instructions

 

16

 

15

14

 

13

 

12

 

11

10

9

 

8

7

6

5

 

4

 

3

 

2

 

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB An[~], An, {adrs} [, next A]

0

 

0

0

 

0

 

~A

 

next A

 

An

 

 

 

 

 

adrs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

dma16 (for direct) or offset16 (long relative) [see section 4.13]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB An[~], An[~], imm16 [, next A]

1

 

1

1

 

0

 

0

 

next A

 

An

0

1

0

 

0

 

0

 

1

 

A~

~A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB An[~], An[~], PH [, next A]

1

 

1

1

 

0

 

0

 

next A

 

An

0

1

1

 

0

 

0

 

0

 

A~

~A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB An[~], An, An~ [, next A]

1

 

1

1

 

0

 

0

 

next A

 

An

0

0

1

 

0

 

0

 

0

 

0

~A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB An[~], An~, An [, next A]

1

 

1

1

 

0

 

0

 

next A

 

An

0

0

1

 

0

 

0

 

0

 

1

~A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB Rx, imm16

 

1

 

1

1

 

1

 

1

 

1

 

1

0

 

0

0

0

1

 

 

 

Rx

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SUB Rx, R5

 

1

 

1

1

 

1

 

1

 

1

 

1

0

 

0

1

0

1

 

 

 

Rx

 

0

0

Description

Subtract value of src from value of dest and store result in dest. If three

 

operands are specified, then subtract value of src1 from value of src (i.e.,

 

src-src1) and store result in dest string. Premodification of accumulator

 

pointers

is allowed

with

some

operand

types. Note

that

subtraction is

performed in 2's complement and therefore the CF (carry flag) may get set even when subtracting a smaller value from a larger value.

4-174

Page 266
Image 266
Texas Instruments MSP50C614 manual SUB Subtract, Dest, src , src1 , next a, An ~ , An , adrs , next a