This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assembler prefix for 16 and 32 bit operations

So I'm doing some very sophisticated code in assembler on my fav little processor. I recently discovered that most processors have special prefix codes so they can carry out wider operations. like the 8086 had prefix codes that allow 32 bit operations even though the CPU was in 16 bit mode.

Does anybody know where the details for these prefix codes are and documentation on how to use them.

  • You're thinking of the 80386 or later using 0x66 or 0x67 to change the data/address widths.

    The 8051 is an OLDER 8-bit processor, and doesn't have any architectural support for 32-bit registers, you'll need to use compound instruction forms, like subroutines or macros to achieve what you're looking for.

  • Does anybody know where the details for these prefix codes are
    no

    however, search and you will find rouines to do 'wide' operations.

    Erik

  • The Z80 also used prefix codes, to extend the instruction set relative in relation to the 8080.

    And the 8086 have prefixes to switch segment registers etc.

    Lots of processors has them.

    And they are obviously documented with the documentation of opcodes/assembler.

    Some 8051 chips also have prefix codes but it isn't common. And it obviously is required to read the documentation for these specific 8051 chips to find out what the extra opcode sequences are.

    No 8051, to my knowledge, have anything as fancy as the prefix functionality available in the x86 line of processors. But they might have some extras to allow use of some simple DSP mul-add or similar, complementing the normal instruction set.