====== SHR Box Function ====== **Shift Right** Category: [[en-us_products:mpino_studio2:box_functions:bit_operations|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 | {{ :en-us_products:mpino_studio2:bit-operation-examples.svg?1000 |Inputs and results for Bitwise Operation Box Functions }} ===== 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 ===== * [[en-us_products:mpino_studio2:box_functions:bit_operations:wand|WAND View details]] — Word AND * [[en-us_products:mpino_studio2:box_functions:bit_operations:wor|WOR View details]] — Word OR * [[en-us_products:mpino_studio2:box_functions:bit_operations:wxor|WXOR View details]] — Word XOR * [[en-us_products:mpino_studio2:box_functions:bit_operations:wnot|WNOT View details]] — Word NOT * [[en-us_products:mpino_studio2:box_functions:bit_operations:shl|SHL View details]] — Shift Left * [[en-us_products:mpino_studio2:box_functions:bit_operations:rol|ROL View details]] — Rotate Left * [[en-us_products:mpino_studio2:box_functions:bit_operations:ror|ROR View details]] — Rotate Right