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

ANDA And with Accumulator<br />

Syntax<br />

ANDA Rs, Rd<br />

ANDA Rs, [mlr)<br />

Affected Flags<br />

N,Z<br />

Description<br />

-register, register<br />

-register, indexed<br />

Logically ANDs the source register Rs to the active accumulator<br />

and places the result into the destination specified.<br />

The destination may be either a register, Rd, or data memory<br />

via an index register mode, [mlr]. Note that register bank<br />

selection determines which accumulator is active.<br />

Example<br />

This example demonstrates a way to quickly unload all 11<br />

bits of the Receiver FIFO when the FIFO is full. The example<br />

assumes that the index register IZ points to the location<br />

in data memory where the information should be stored.<br />

EXX 1,1 ;select alternate banks<br />

MOVE 00000111B, A ;place the {TSR} mask<br />

; into the accumulator<br />

Pop the first word from the receiver FIFO<br />

ANDA TSR, [IZ+] ;read bits 8, 9, & 10<br />

MOVE RTR, [IZ + ] ;pop bits 0-7<br />

Pop the second word from the receiver FIFO<br />

ANDA TSR, liZ + ]<br />

MOVE RTR, liZ + ]<br />

Pop the third word from the receiver FIFO<br />

ANDA TSR, liZ + ]<br />

MOVE RTR, liZ + ]<br />

Instruction Format<br />

ANDA Rs, Rd<br />

I<br />

Rd<br />

15 9 4<br />

ANDA<br />

RS,[mlr]<br />

1 11011101110101 1 1 1 1 1 1 1<br />

_ Opcode .m.lr. Rs _<br />

15 8 6 4 0<br />

00 - post-decrement<br />

01 - no change<br />

10 - post Increment<br />

11 - pre-increment<br />

Rs<br />

l<br />

OO-IW<br />

01 - IX<br />

10 - IY<br />

11 - IZ<br />

o<br />

TL/F/9336-7<br />

BIT Bit Test<br />

Syntax<br />

BIT rs, n -limited register, immediate<br />

Affected Flags<br />

N,Z<br />

Description<br />

Performs a bit level test by logically ANDing the source register<br />

rs to the immediate value n. The affected flags are<br />

updated, but the result is not saved. Note that only the active<br />

registers RO-R15 may be specified for rs. The value n<br />

is 8 bits wide.<br />

Example<br />

Poll the Transmitter FIFO Empty flag [TFE] in the Network<br />

Command Flag register {NCF}, R1, waiting for the Transmitter<br />

to send the current FIFO data.<br />

EXX 0,1 ;select main A, alt B<br />

Poll: BIT 10000000B,NCF ;AII data sent yet?<br />

JZ Poll ; No, poll TFE<br />

; Yes, send next byte(s)<br />

Instruction Format<br />

15 11<br />

T-states<br />

2<br />

Bus Timing<br />

Figure 7<br />

Operation<br />

rs AND n<br />

n<br />

rs<br />

3 0<br />

T-states<br />

ANDA Rs, Rd<br />

ANDA Rs, [mlr)<br />

Bus Timing<br />

ANDA Rs, Rd<br />

ANDA Rs, [mlr]<br />

-2<br />

-3<br />

Operation<br />

ANDA Rs, Rd<br />

Rs AND accumulator -<br />

ANDA Rs, [mlr)<br />

Rs AND accumulator -<br />

-Figure 7<br />

-Figure 12<br />

Rd<br />

data memory<br />

2-106

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

Saved successfully!

Ooh no, something went wrong!