Thread: __asm don't work

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Thumbs down __asm don't work

    When i'am putting an assembler code in C++ like

    __asm
    {



    }

    and calling some of int 21h or any thing else it won't work, works only INT 3, but other functions(int 21h, int 13h......) don't. Commands MOV,XOR...... works correct. What is the problem???

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    125
    Well, can't do much about that if you don't tell what your compiler is, eh?
    Typing stuff in Code::Blocks 8.02, compiling stuff with MinGW 3.4.5.

  3. #3
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    You know that hexadecimal numbers should not be used as "variable = 21h;" but as "variable = 0x21;"?

    If you did that, then it would help what compiler you are using.

  4. #4
    There ARE two different kinds of assembly language. Make sure you're using the right kind.

  5. #5
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    There are many "kinds" of assembly. But inline assembly in for example GCC is implemented different from inline assembly in MSVC++ or Turbo C or something else. Therefor it is important to know which compiler is used.

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    0x21 is a dos interrupt ... maybe thats an issue?

  7. #7
    Unregistered
    Guest
    You can't use DOS interupts in Windows!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    (sorry for the overreacting but there are hundreds of people who asks about this all the time)

  8. #8
    Shadow12345
    Guest
    what is asm?

  9. #9
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    asm = machine code. its the lowest you can go in a readable language. you can control how every variable is created, how many bits it will use, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 07:48 PM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  3. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 04:36 PM