Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Inline Assembly with Visual C++ 2008

Inline Assembly with Visual C++ 2008

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpgraphics
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aurelcly
    wrote on last edited by
    #1

    Good Afternoon I have an compilation error in my code with inline assembly.I want to get IVT(Interrupt Vector Table)Address using VC++ 2008 I have "Illegal 16 bits instruction" with line MOV AX,ES:[BX]. Can you help me please. #define WORD unsigned short WORD address; __asm { push ES MOV AX,0 MOV ES,AX MOV BX,address MOV AX,ES:[BX] // Compilation Error } Thank you.

    L M 2 Replies Last reply
    0
    • A aurelcly

      Good Afternoon I have an compilation error in my code with inline assembly.I want to get IVT(Interrupt Vector Table)Address using VC++ 2008 I have "Illegal 16 bits instruction" with line MOV AX,ES:[BX]. Can you help me please. #define WORD unsigned short WORD address; __asm { push ES MOV AX,0 MOV ES,AX MOV BX,address MOV AX,ES:[BX] // Compilation Error } Thank you.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      AFAIK on recent Windows platforms assembly instructions operate by default on either 8-bit or 32-bit quantities, not 16-bit. And the 32-bit version of the CPU registers are called EAX, EBX, etc. If you really want a 16-bit operation, you need a prefix instruction byte, I don't know what syntax it takes though. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      Prolific encyclopedia fixture proof-reader browser patron addict?
      We all depend on the beast below.


      1 Reply Last reply
      0
      • A aurelcly

        Good Afternoon I have an compilation error in my code with inline assembly.I want to get IVT(Interrupt Vector Table)Address using VC++ 2008 I have "Illegal 16 bits instruction" with line MOV AX,ES:[BX]. Can you help me please. #define WORD unsigned short WORD address; __asm { push ES MOV AX,0 MOV ES,AX MOV BX,address MOV AX,ES:[BX] // Compilation Error } Thank you.

        M Offline
        M Offline
        Michel Godfroid
        wrote on last edited by
        #3

        Yes, I remember MS-DOS fondly. The Interrupt Vector Table was sitting at 0000:0000 to 0000:0400. Sorry to disappoint you, but things have changed a bit in the last 20 years or so. I assume you're not programming for WinMe :laugh: (I think that was the last operating system that supported this) or the 16-bit VDM (Which was probably disposed of in Windows Vista??) If you are, try to lay hands on an old copy of Visual C++. I think the GNU C compiler can still generate 16 bit code for real mode. Have a look at this: Get interrupt vector information in Windows[^] (This is probably only valid for 32-bit versions of Windows, the ULONG's look suspiciously short, but you'll probably find all the info in the latest and greatest DDK -- too lazy to look it up). Oh, yes, before you ask (I just know this is coming): you cannot change this IDT, except in a device driver.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups