====== D2H Box Function ====== **BCD Encode (Decimal to Hex)** Category: [[en-us_products:mpino_studio2:box_functions:conversion|Conversion Box Functions]] ===== Behavior ===== Converts a decimal integer from 0 to 9999 into four-digit BCD and stores it in a WORD. ===== Syntax and Arguments ===== **Syntax:** ''D2H D0 D1'' * 1st = source: WORD address holding a decimal integer from 0 to 9999 * 2nd = destination: WORD address that stores the BCD result ===== Behavior Example ===== ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | Left condition ON | D0=1234 | ''D2H D0 D1'' | D1=0x1234 | {{ :en-us_products:mpino_studio2:conversion-examples.svg?1000 |Inputs and results for Conversion Box Functions }} ===== Cautions ===== * Use the WORD data formats required by the command for the source and destination. * Use an input value from 0 to 9999. ===== Box Functions in the Same Category ===== * [[en-us_products:mpino_studio2:box_functions:conversion:inv|INV View details]] — Invert * [[en-us_products:mpino_studio2:box_functions:conversion:neg|NEG View details]] — Negate * [[en-us_products:mpino_studio2:box_functions:conversion:h2d|H2D View details]] — BCD Decode (Hex to Decimal)