17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6.0 Instruction Set Reference (Continued)<br />

SHR<br />

Shift Right<br />

Syntax<br />

SHR Rsd, b<br />

Affected Flags<br />

N,Z,C<br />

Description<br />

-register<br />

Shifts the contents of the register Rsd b bits to the right and<br />

places the result back into that register. Zeros are shifted in<br />

from the left, (i.e., from the MSB). The value b may specify<br />

from 0 to 7 bit shifts. The Carry flag contains the last bit<br />

shifted out.<br />

Example<br />

Right justify the Address Stack Pointer from the Internal<br />

Stack Pointer register (lSPI, R30.<br />

MOVE ISP, R20 ;Load [ASP] from (lSPI<br />

SHR R20,4 ;right justify [ASP]<br />

Instruction Format<br />

1 1111010111010101<br />

. Opcode .<br />

15 7<br />

T-states<br />

2<br />

Bus Timing<br />

Figure 7<br />

Operation<br />

1 1<br />

b<br />

4<br />

1 1<br />

Rsd<br />

o<br />

SUB<br />

Syntax<br />

SUB n, rsd<br />

Subtract Immediate<br />

Affected Flags<br />

N,Z,C,V<br />

-immediate, limited register<br />

Description<br />

Subtracts the immediate value n from the register rsd and<br />

places the result back into the register rsd. Note that only<br />

the active registers RO-R15 may be specified for rsd. The<br />

value of n is limited to 8 bits; (signed range: + 127 to<br />

-128). Negative numbers are represented using the two's<br />

complement format.<br />

Example<br />

Subtract the constant 3 from register 10.<br />

SUB 3, R10 ; R10 - 3 - R10<br />

Instruction Format<br />

1 0 1 0 11 1 0 1<br />

. Opcode .<br />

15 11<br />

T-states<br />

2<br />

Bus Timing<br />

Figure 7<br />

Operation<br />

rsd-n-rsd<br />

n<br />

rsd<br />

3 0<br />

TL/F/9336-15<br />

2-121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!