Maxim Integrated DS4830A Optical Microcontroller User Manual

Page 204

Advertising
background image

DS4830A User’s Guide

204

Note 4: Any index represented by <b> or found inside [ ] brackets is considered variable, but required.
Note 5: The active accumulator (Acc) is not allowed as the dst if A[AP] is specified as the src.
Note 6: The '{L/S}' prefix is optional.
Note 7: Instructions that attempt to simultaneously push/pop the stack (e.g. PUSH @SP--, PUSH @SPI--, POP @++SP, POPI @++SP) or modify

SP in a conflicting manner (e.g., MOVE SP, @SP--) are invalid.

Note 8: Special cases: If ‘MOVE APC, Acc’ sets the APC.CLR bit, AP will be cleared, overriding any auto-inc/dec/modulo operation specified for

AP. If ‘MOVE AP, Acc’ causes an auto-inc/dec/modulo operation on AP, this overrides the specified data transfer (i.e., Acc will not be
transferred to AP).

ADD / ADDC src

Add / Add with Carry


Description:

The ADD instruction sums the active accumulator (Acc or A[AP]) and the specified src data
and stores the result back to the active accumulator. The ADDC instruction additionally
includes the Carry (C) Status Flag in the summation. For the complete list of src specifiers,
reference the MOVE instruction. Because the source field is limited to 8 bits, the PFX[n]
register is used to supply the high-byte of data for 16 bit sources.


Status Flags:

C, S, Z, OV


ADD
Operation:

Acc

 Acc + src


Encoding:

15

0

f100

1010

ssss

ssss


Example(s):

; Acc = 2345h for each example

ADD A[3]

; A[3]=FF0Fh

;

 Acc =2254h,C=1, Z=0, S=0, OV=0

ADD #0C0h

;

 Acc =2405h,C=0, Z=0, S=0, OV=0

ADD A[4]

; A[4]=C000h

;

 Acc = E345h, C=0, Z=0, S=1, OV=0

ADD A[5]

; A[5]=6789h

;

 Acc = 8ACEh, C=0, Z=0, S=1, OV=1

ADDC
Operation:

Acc

 Acc + C + src


Encoding:

15

0

f110

1010

ssss

ssss


Example(s):

; Acc = 2345h for each example

ADDC A[3]

; A[3] = DCBAh, C=1

;

 Acc = 0000h, C=1, Z=1, S=0, OV=0

ADDC @DP[0]--

; @DP[0] = 00EEh, C=1

;

 Acc = 2434h, C=0, Z=0, S=0, OV=0


Special Notes:

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

Advertising