[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CBW              Convert Byte to Word                Flags: not altered

CBW

          Logic:    if (AL < 80h) then
                        AH . 0
                    else
                        AH . FFh

    CBW extends the sign bit of the AL register into the AH register. This
    instruction extends a signed byte value into the equivalent signed
    word value.

  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
   no operands                 2          -        1     CBW
  --------------------------------------------------------------------------

       Note:          This instruction will set AH to 0FFh if the sign bit
                      (bit 7) of AL is set; if bit 7 of AL is not set, AH
                      will be set to 0. The instruction is useful for
                      generating a word from a byte prior to performing
                      byte division.

See Also: CWD DIV IDIV
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson