User Tools

Site Tools


en-us_products:mpino_studio2:box_functions:bit_operations:shr

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

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/shr.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki