Announcement

Collapse
No announcement yet.

PUSHAD/POPAD available?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PUSHAD/POPAD available?

    Are the verbs "PUSHAD" and "POPAD" available for use in PB/DOS 3.5's
    inline assembler? If they are, can you please provide the syntax
    for their use? I tried: ! PUSHAD, and got an assembler
    error message when trying to compile it.

    Thanks in advance!

    Cordially,


    ------------------
    Clay C. Clear
    mailto:[email protected][email protected]</A>
    Clay Clear's Software (Frames Only)

  • #2
    According the help for the ASM statement, "PowerBASIC supports assembly of all 8086/8088 opcodes directly..."

    PUSHAD and POPAD require an 80386 or later.

    You can code them directly as machine code, though. PUSHAD is the same as:

    ! db &H66
    ! db &H60

    For POPAD, use:

    ! db &H66
    ! db &H61

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      Thanks, Tom, not just for your reply, but also for the
      workaround.

      Regards,


      ------------------
      Clay C. Clear
      mailto:[email protected][email protected]</A>
      Clay Clear's Software (Frames Only)

      Comment


      • #4
        De nada. Note that the "&H60" and "&H61" are really the opcodes for
        PUSHA and POPA, respectively. What the leading "&H66" says, in this
        context, is "consider the next code as a 32-bit instruction, not a 16-bit
        instruction". You can use the leading "&H66" trick in many similar cases
        to boost a 16-bit instruction to a 32-bit instruction. For example:

        ! db &H66
        ! xor ax, ax

        What this really translates to is, "xor eax, eax".

        We can't use this technique to boost PUSHA to PUSHAD or POPA to POPAD
        because, unfortunately, PUSHA and POPA aren't 8088-level instructions
        either. They require at least an 80186. So, we have to use the full
        machine-language numeric encoding, instead of just a "&H66" prefix
        to the assembly-language mnemonics.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment


        • #5
          Cool! Thanks! As I venture further into the world of PC
          assembly programming (I'm LOADED with machine language assembly
          stuff on the Commodore-64...pretty archane knowledge <chuckle> )
          , such knowledge will come in VERY handy.

          Thanks.

          Regards,


          ------------------
          Clay C. Clear
          mailto:[email protected][email protected]</A>
          Clay Clear's Software (Frames Only)

          Comment

          Working...
          X