beautypg.com

Sr/sra/sra2/sra4, Sr/sra/sra2/sra4 -32, Maxq family user’s guide – Maxim Integrated MAXQ Family User Manual

Page 209

background image

18-32

MAXQ Family User’s Guide

(MAXQ10 Version)

Shift Accumulator Right/

SR/SRA/SRA2/SRA4

Shift Accumulator Right Arithmetically

One, Two, or Four Times

Description:

Shifts the active accumulator right once for the SR, SRA instructions and two or four times, respectively, for the SRA2,

SRA4 instructions. The SR instruction shifts a 0 into the accumulator msb, while the SRA, SRA2, and SRA4 instruc-

tions effectively shift a copy of the current msb into the accumulator, thereby preserving any sign orientation. For

each shift iteration, the accumulator lsb is shifted into the Carry (C) flag.

Status Flags:

C, S (changes for SR only), Z

SR Operation:

7

Active Acc (Acc) 0 Carry Flag

Acc.[6:0]

← Acc.[7:1]

Acc.7

← 0

C

← Acc.0

Encoding:

15

0

Example(s):

; Acc = 45h, C=1, S=0, Z=0

SR

; Acc = 22h, C=1, S=0, Z=0

SR

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

SRA Operation:

7

Active Acc (Acc) 0 Carry Flag

Acc.[6:0]

← Acc.[7:1]

Acc.7

← Acc.7

C

← Acc.0

Encoding:

15

0

Example(s):

; Acc = 03h, C=0, Z=0

SRA

; Acc = 01h, C=1, Z=0

SRA

; Acc = 00h, C=1, Z=1

0

1000

1010

1010

1010

1000

1010

1111

1010

Maxim Integrated