INSTRUCTION SET

RETR Return With PSW Restore (Not in 8021, 8022)

11001100111

This is a 2-cycle instruction. The stack pointer is decremented. The program counter and bits 4-7 of the PSW are then restored from the stack. Note that RETR should be used to return from an interrupt, but should not be used within the interrupt service routine as it signals the end of an interrupt routine by resetting the Interrupt in Progress flipflop.

(SP)..- (SP)-1 (PC)..- ((SP)) (pSW 4-7)"- ((SP))

RL A Rotate Left Without Carry

11 110101111

The contents of the accumulator are rotated left one bit. Bit 7 is rotated into the bit 0 position.

(An+1)"- (An)

(AO)..- (A7)n=0-6

Example: Assume accumulator contains 10110001 ..

RLNC: RL A;NEW ACC CONTENTS ARE 01100011.

RLC A Rotate Left Through Carry

11111101111

The contents of the accumulator are rotated left one bit. Bit 7 replaces the carry bit; the carry bit is rotated into the bit 0 position.

(An +1)..- (An)

n=o-S

(AO)-- (C)

(C)-- (A7)

Example: . Assume accumulator conta,ins a 'signed'number; isolate sign without changing value.

RL TC: CLR C

;CLEAR CARRY TO ZERO

RLC A

;ROTATE ACC LEFT, SIGN

 

;BIT (7) IS PLACED IN CARRY

RR A

;ROTATE ACC RIGHT - VALUE

 

(BITS 0-6) IS RESTORED,

 

;CARRY UNCHANGED, BIT 7

 

;IS ZERO

Mnemonics copyright Intel Corporation 1976.

4·30

Page 103
Image 103
Intel mcs-48 manual Retr Return With PSW Restore Not in 8021