Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>cbw convert byte to word flags: not altered</b> http://www.X-Hacker.org [<<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 byte in the AL register into the AH
    register. In other words, 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

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson