beautypg.com

Texas Instruments MSP50C6xx User Manual

Page 263

background image

Individual Instruction Descriptions

4-177

Assembly Language Instructions

Syntax

Description

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

Subtract effective data memory word from An[~], store result in An

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

Subtract immediate word from An[~], store result in An[~]

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

Subtract Product High (PH) register from An[~], store result in An[~]

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

Subtract An~ word from An word, store result in An[~]

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

Subtract An word from An~ word, store result in An[~]

SUB Rx, imm16

Subtract immediate word from Rx

SUB Rx, R5

Subtract R5 from Rx

See Also

SUBB, SUBS, ADD, ADDB, ADDS

Example 4.14.80.1

SUB A1, A1, 74

Subtract 74 (decimal) immediate from accumulator A1, put result in accumulator A1.

Example 4.14.80.2

SUB A0, A0, 2, ++A

Pre–increment pointer AP0, subtract 2 from new accumulator A0, put result in accumulator A0.

Example 4.14.80.3

SUB A1, A1~, A1

Subtract accumulator A1 from accumulator A1~, put result in accumulator A1.

Example 4.14.80.4

SUB A1, A1, A1~, ––A

Pre–decrement AP1. Subtract accumulator A1~ from accumulator A1, put result in accumulator A1.

Example 4.14.80.5

SUB A3~, A3, *R4—

Subtract word at address in R4 from A3, store result in A3~, decrement value in R4 by 2 (word mode)
after the subtraction.

Example 4.14.80.6

SUB R3, R5

Subtract R5 from R3, put result in R3.