en-us_products:mpino_studio2:box_functions:bit_operations:shl
Table of Contents
SHL Box Function
Shift Left
Category: Bitwise Operation Box Functions
Behavior
Shifts a WORD left and stores the result. Bits leaving the left are discarded and zeros fill from the right. Use a shift count from 0 to 15.
Syntax and Arguments
Syntax: SHL D0 2 D1
- 1st = source: integer WORD address
- 2nd = shift count: 0 to 15
- 3rd = destination: result address
Behavior Example
| Run condition | Before | Command entered | Expected result |
|---|---|---|---|
| Left condition ON | D0=0x0003 | SHL D0 2 D1 | D1=0x000C |
Cautions
- The operation applies to all 16 bits of the WORD.
- Use a shift count from 0 to 15. Bits shifted out on the left are discarded.
Box Functions in the Same Category
- WAND View details — Word AND
- WOR View details — Word OR
- WXOR View details — Word XOR
- WNOT View details — Word NOT
- SHR View details — Shift Right
- ROL View details — Rotate Left
- ROR View details — Rotate Right
en-us_products/mpino_studio2/box_functions/bit_operations/shl.txt · Last modified: by 127.0.0.1
