ASM w/ C++ issues

This is a discussion on ASM w/ C++ issues within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Dino I get the following error when running the above: Code: [Session started at 2008-09-19 17:16:13 -0500.] ...

  1. #16
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Dino View Post
    I get the following error when running the above:
    Code:
    [Session started at 2008-09-19 17:16:13 -0500.]
    
    c_asm_misc has exited due to signal 4 (SIGILL).
    Intel Dual Core Xeon Mac.
    With what compiler and OS configuration? If it's 64-bit, then it won't be right, since push ECX will actually push a sign-extended 64-bit version of ECX.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #17
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Ah. Mac OS X (Tiger) 10.4.11 with Intel Dual Core Xeon processors.
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  3. #18
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,411
    Quote Originally Posted by matsp View Post
    movzx - Move with Zero Extension: It loads the 16-bit value into a 32-bit register, and fills the remaining 16 bits with zero. It's counterpart for signed numbers is movsx, which fills the upper 16 bits with the content of bit 15 of the low 16 bits.
    Hmmm. But doesn't it just usually work to move a number directly into a register without 0-ing? I don't know if I've tried...

    jae - Jump Above or Equal. It's the same as JGE but for unsigned numbers.
    Aha!
    But then again, I've never encountered JGE before...

    And I can't continue to use ECX after the call, since it's one of the registers that can be used in the callee without preservation, so it would require another load before inc can be used on it. Of course, I could have picked another register...
    Another register is what I was thinking ;)

    And I never knew inc could work with other things than registers... that's cool.
    Thanks for the information. One step closer to an assembly expert
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc asm code syntax
    By Uberapa in forum C Programming
    Replies: 4
    Last Post: 06-15-2007, 01:16 AM
  2. Understanding ASM
    By kuphryn in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 07-12-2002, 07:39 PM
  3. Inline asm
    By wavering in forum C Programming
    Replies: 2
    Last Post: 01-29-2002, 01:42 AM
  4. asm mov
    By manu in forum C++ Programming
    Replies: 1
    Last Post: 12-15-2001, 11:59 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 05:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21