beautypg.com

Sub/subb src, Sub/subb src -36, Maxq family user’s guide – Maxim Integrated MAXQ Family User Manual

Page 213

background image

18-36

MAXQ Family User’s Guide

SUB/SUBB src

Subtract /Subtract with Borrow

Description:

Subtracts the specified src from the active accumulator (Acc) and returns the result back to the active accumula-

tor. The SUBB additionally subtracts the borrow (Carry Flag), which may have resulted from previous subtraction.

For the complete list of src specifiers, reference the MOVE instruction. The MAXQ20 may use the PFX[n] register to

supply the high byte of data for 8-bit sources.

Status Flags:

C, S, Z, OV

SUB Operation:

Acc

← Acc - src

Encoding:

15

0

MAXQ10
Example(s):

; Acc = 23h to start, A[1]= 12h

SUB

A[1]

; Acc = 11h, C=0, S=0, Z=0

SUB

A[1]

; Acc = FFh, C=1, S=1, Z=0

MAXQ20
Example(s):

; Acc = 2345h to start, A[1]= 1250h

SUB

A[1]

; Acc = 10F5h, C=0, S=0, Z=0, OV=0

SUB

A[1]

; Acc = FEA5h, C=1, S=1, Z=0, OV=0

SUB

A[2]

; A[2] =7FFFh

;

→ Acc = 7EA6h; C=0, S=0, Z=0, OV=1

SUBB Operation: Acc

← Acc - (src + C)

Encoding:

15

0

MAXQ10
Example(s):

; Acc = 23h, A[1]= 12h, C=1

SUBB

A[1]

; Acc = 10h, C=0, S=0, Z=0

SUBB

A[1]

; Acc = FEh, C=1, S=1, Z=0

SUBB #0Dh

; Acc = F0h, C=0, S=1, Z=0

MAXQ20
Example(s):

; Acc = 2345h, A[1]= 1250h, C=1

SUBB

A[1]

; Acc = 10F4h, C=0, S=0, Z=0

SUBB

A[1]

; Acc = FEA4h, C=1, S=1, Z=0

Special Notes:

The active accumulator (Acc) is not allowed as the src for these operations.

f101

1010

ssss

ssss

f111

1010

ssss

ssss

Maxim Integrated