en-us_products:mpino_studio2:box_functions:bit_operations:shr
Table of Contents
SHR Box Function
Shift Right
Category: Bitwise Operation Box Functions
Behavior
Logically shifts a D WORD right and stores the result. Bits leaving the right are discarded and zeros fill from the left.
Syntax and Arguments
Syntax: SHR D0 1 D1
- 1st = source: D 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=0x000C | SHR D0 1 D1 | D1=0x0006 |
Cautions
- The operation applies to all 16 bits of the WORD.
- Use a shift count from 0 to 15. Bits shifted out on the right are discarded, and zeros fill from the left.
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
- SHL View details — Shift Left
- ROL View details — Rotate Left
- ROR View details — Rotate Right
en-us_products/mpino_studio2/box_functions/bit_operations/shr.txt · Last modified: by 127.0.0.1
