beautypg.com

Shl (shift left) – Echelon Neuron User Manual

Page 131

background image

SHL (Shift Left)

The SHL instruction shifts the byte in TOS one bit to the left. The SHL

instruction uses the implicit addressing mode. This instruction moves a zero into

bit 0 of TOS, and discards bit 7. This instruction also clears the Carry flag.
Figure 11 shows the operation of the SHL instruction.

TOS

7

0

0

0

C

Figure 11. The SHL Instruction

The SHL instruction applies to Series 3100, 5000, and 6000 devices.

Syntax:
The SHL instruction requires no operands:

SHL

Table 52 describes the attributes of the SHL instruction.

Table 52. SHL Instruction

Instruction

Hexadecimal

Opcode

Instruction

Size (Bytes)

CPU Cycles

Required

Affect on

Carry Flag

SHL

3B

1

2

Cleared


Example:
The following example pushes the number 150 (h’96) onto the data stack, and

then uses the SHL instruction to shift the TOS value left. After the SHL

instruction completes, TOS has the value 44 (h’2C) and the Carry flag is cleared.

push #d’150 ; ( d’150, -- )

shl ; ( d’44, -- )

Neuron Assembly Language Reference

121