8

I am reading the book "The 8086 / 8088 Primer Second Edition" by Stephen P Morse. In it on page 54, it says

The 8086 provides instructions to facilitate the task of sign extension. These instructions were initially named SEX (sign extend) but were later renamed to [...] CBW (convert byte to word), and CWD (convert word to double word).

What Intel chip provided the primitive SEX (as documented) and what was the last chip produced before Intel underwent the SEX change documenting the new SEX-equivalent differently.

3
  • 9
    The naming of opcodes is completely transparent to the chip itself. The chip uses numbers to identify specific operations, and the name we assign to any particular number in a document (or in a program like an assembler) is somewhat arbitrary. Changing the name of an opcode does not actually require any change to the chip itself, only to the documentation and tools people who work with the chip will use.
    – Ken Gober
    Oct 14, 2018 at 20:09
  • @KenGober good point, I tried to reflect that better. Oct 15, 2018 at 1:37
  • 6
    Clickbait title much?
    – user253751
    Oct 17, 2018 at 4:50

2 Answers 2

12

What Intel chip provided the primitive SEX and what was the last chip produced before Intel underwent the SEX change?

None, as that's a function which is only needed if a CPU operates on words longer than 8 bit - something no previous 8 bit (intel) CPU did.

It was a new instruction created for the 8086, so a 8 bit value could be sign extended to 16 bit for further 16 bit operations. Mr. Morse, who did the whole instruction level design for the 8086, named it SEX in his design, but got overruled later on.


So if you excuse extending the pun, it was never a girl, the proud father just hoped for one :)


As a side note, as Martin Rosenau reminded me in his comment, the Motorola 6809, released the same year as the 8086, did call their sign extension operation SEX, which extended an 8 bit value in accumulator B into the 16 bit accumulator D (where B is the lower half anyway).

3
  • Some sort of useful link here catb.org/jargon/html/S/SEX.html
    – UncleBod
    Oct 15, 2018 at 3:51
  • 3
    On the 6809 CPU the SEX instruction (named exactly like this) extends the 8-bit value in B register into a 16-bit value in A:B register pair. cwd on the 8086 also operates with a register pair as destination. An instruction doing the same (sign-extending the L register into H:L pair) would have been thinkable on the 8080, too. So the SEX or CBW instruction does not necessarily require a 16-bit CPU. Oct 15, 2018 at 5:36
  • @MartinRosenau you're perfectly right, that's why it isn't about '8 bit CPU' but 8bit vs. 16 bit operation
    – Raffzahn
    Oct 15, 2018 at 11:52
1

The first CMOS microprocessor, the CDP1802, has a 4-bit "X" register which is used to select one of 16 registers for use with many opcodes including those for arithmetic and bitwise operations. That particular chip uses 16 opcodes 0xE0 through 0xEF, called "SEX 0" through "SEX 15", to set X to one of 16 values. I'm unaware of any Intel chips making use of that mnemonic, however.

15
  • 1
    Oh, I didn't know that the 1802 was designed by Intel. - Serious, while the information provided is nice and great to know, it is in no way related to the question. It's neither the same instruction, not (as requested) by an Intel CPU. Bottom line - itshould be a comment (and would get my upvote as such).
    – Raffzahn
    Oct 14, 2018 at 17:37
  • 4
    "I'm unaware of any Intel chips making use of that mnemonic" <-- answers the question
    – fadden
    Oct 14, 2018 at 17:51
  • 2
    @Raffzahn comments are not meant to be kept so could be deleted at anytime so this would not be of any use as a comment
    – mmmmmm
    Oct 14, 2018 at 19:28
  • 3
    @Raffzahn Comments are for requesting additional information and suggesting improvements. People add extra information in them, and I don't like to delete ones that do, but it's not what they're for and there are systems that can delete them. This qualifies as an answer to the question, since it provides one as fadden has correctly stated: the answer is "Intel chips, to my knowledge, didn't use SEX."
    – wizzwizz4
    Oct 14, 2018 at 20:35
  • 3
    @DrSheldon: The site is intended not only to collect answers to immediate questions, but also to serve as a searchable collection of answers for future people with questions. Whether or not the original poster is interested in non-Intel processors' SEX instructions, it would seem likely that other people who find the question would be.
    – supercat
    Oct 15, 2018 at 0:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .