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 />

SBCA Subtract with Carry and Accumulator<br />

Syntax<br />

SBCA Rs, Rd<br />

SBCA Rs, [mlr]<br />

Affected Flags<br />

N,Z,C,V<br />

Description<br />

-register, register<br />

-register, indexed<br />

Subtracts the active accumulator and the carry flag from the<br />

source register Rs, placing the result into the destination<br />

specified. The destination may be either a register, Rd, or<br />

data memory via an index register mode, [mlr]. Negative<br />

results are represented using the two's complement format.<br />

Note that register bank selection determines which accumulator<br />

is active.<br />

Example<br />

Subtract the constant 109 from the index register IW, (which<br />

is 16 bits wide).<br />

SUBA A, A ;Clear the accumulator<br />

SUB 109, R12 ;Iow byte of IW-109<br />

SBCA R13, R13 ;high byte of IW-borrow<br />

Instruction Format<br />

SBCA Rs, Rd<br />

15 9<br />

SBCA<br />

Rs, [mlr]<br />

1<br />

Rd<br />

1 11011101011111 1 1 1<br />

_ Opcode . m • Ir .<br />

15 8 6 4<br />

T-states<br />

SBCA<br />

SBCA<br />

Rs, Rd<br />

Rs, [mlr]<br />

Bus Timing<br />

SBCA Rs, Rd<br />

SBCA Rs, [mlr]<br />

00 - post-decrement<br />

01 - no change<br />

10 - post Increment<br />

11 - pre-Increment<br />

-2<br />

-3<br />

-Figure 7<br />

-Figure 12<br />

4<br />

Rs<br />

Rs<br />

t<br />

00 - IW<br />

01 - IX<br />

10 - IY<br />

11 - IZ<br />

Operation<br />

SBCA Rs, Rd<br />

Rs - accumulator - carry bit ~ Rd<br />

SBCA Rs, [mlr]<br />

Rs - accumulator - carry bit ~ data memory<br />

o<br />

o<br />

TL/F9336-13<br />

SHL<br />

Syntax<br />

SHL<br />

Shift Left<br />

Rsd, b<br />

Affected Flags<br />

N,Z,C<br />

-register<br />

Description<br />

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

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

from the right, (i.e., from the LSB). 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 />

Place a new internal Address Stack Pointer into the Internal<br />

Stack Pointer register (iSP l. R30. Assume that the new<br />

[ASP] is located in register 20.<br />

MOVE ISP,RB ;read (iSP) for [DSP]<br />

AND 00001111 B,RB ;save [DSP] only<br />

SHL R20,4 ;Ieft justify [ASP]<br />

ORA R20,ISP ;combine [ASP] + [DSPl.<br />

; then place into (iSP)<br />

Instruction Format<br />

11111010111010111<br />

Opcode<br />

15<br />

T-states<br />

2<br />

Bus Timing<br />

Figure 7<br />

Operation<br />

7<br />

1 1<br />

(B-b)<br />

Rsd<br />

4 o<br />

TL/F/9336-14<br />

2-120

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

Saved successfully!

Ooh no, something went wrong!