Sign Extended Instruction

From: Bryan Parkoff (spamtrap_at_crayne.org)
Date: 03/17/05


Date: Thu, 17 Mar 2005 22:27:48 +0000 (UTC)


    It would be nice to have CBW instruction and MOVSZ instruction. Low
byte's 7th bit is turned on to show negative before high byte is set to $FF,
otherwise low byte's 7th bit is turned off to show positive before high byte
is set to $00.
    I have to find other way to overwrite $FF to low byte after low byte is
read to detect 7th bit rather than to use high byte without having to use
CBW instruction nor MOVSZ instruction. It is because I am very curious to
study how binary in this logic work. I try to compare x86 to other
processors which other processors do not have sign extended instruction so
they have to write their own routine.
    The routine is to read low byte's 7th bit. If 7th bit is true, it
branches to overwrite low byte with $FF, otherwise if 7th bit is false, it
branches to overwrite low byte with $00. I think that branch is only the
option to test 7th bit, but it can waste couple clock cycles.
    Is there a way to use other instructions such as AND, OR, XOR, NEG, NOT,
etc to manipulate low byte's 7th bit by filling $FF or $00 without using
branches, CBW instruction, nor MOVSZ instruction. I would like to see how
it works.
    I am not sure if IA-64 has any sign extended instruction. Please let me
know as soon as possible. Thanks...

Bryan Parkoff



Relevant Pages

  • Re: Sign Extended Instruction
    ... > It would be nice to have CBW instruction and MOVSZ instruction. ... The sbb instruction is the same as sub except that it ...
    (comp.lang.asm.x86)
  • Re: Sign Extended Instruction
    ... >> It would be nice to have CBW instruction and MOVSZ instruction. ... > mov cl, 0x7F ...
    (comp.lang.asm.x86)