Thread: Help calling function is asm

  1. #16
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    Because you can't call them without asm. And yes I'm sure the address is right.
    Why not?

    --
    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
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    Why not?

    --
    Mats
    Because I tried it and it didn't work.

  3. #18
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    Because I tried it and it didn't work.
    Ok, so why does it then NOT work when you do it in assembler? Perhaps there is something ELSE that is wrong?

    I have used "creative use" of function pointers, like what is described in a previous post. It works. But of course, if you pass in the wrong value, or in the wrong way, then you will end up with any sort of "bad" result.

    What is the actual crash you are seeing?

    --
    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.

  4. #19
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    Ok, so why does it then NOT work when you do it in assembler? Perhaps there is something ELSE that is wrong?

    I have used "creative use" of function pointers, like what is described in a previous post. It works. But of course, if you pass in the wrong value, or in the wrong way, then you will end up with any sort of "bad" result.

    What is the actual crash you are seeing?

    --
    Mats
    The game gives me an error report message.

  5. #20
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    The game gives me an error report message.
    And the contents of that error report is?

    And is that different from what happens when you make the call in C or Assembler? [E.g is the address the same, same register content, etc, etc or are the values/addresses different]?

    --
    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.

  6. #21
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    And the contents of that error report is?

    And is that different from what happens when you make the call in C or Assembler? [E.g is the address the same, same register content, etc, etc or are the values/addresses different]?

    --
    Mats
    The error report are strange character, and I get it by using C and Asm.
    Addresses and values are same.

  7. #22
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    The error report are strange character, and I get it by using C and Asm.
    Addresses and values are same.
    So, that tells you something, right? That you are NOT using the function in the right way. What the "right way" and how that's different from how you are doing it, is something I can't figure out.

    --
    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.

  8. #23
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    It also probably tells you that the effect of the custom asm and the function pointer are the same.

    What game is this, anyway?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #24
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by CornedBee View Post
    It also probably tells you that the effect of the custom asm and the function pointer are the same.

    What game is this, anyway?
    GunZ: The Duel
    Google it =]

  10. #25
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Quote Originally Posted by brietje698 View Post
    Because you can't call them without asm. And yes I'm sure the address is right.
    I'd be surprised if the address is right. You should be jumping to address Gunz.0x00478890 or ZPostShotSpAddress, certainly not 0x00478890.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. calling function in asm
    By brietje698 in forum C++ Programming
    Replies: 10
    Last Post: 11-29-2007, 02:07 PM
  5. Replies: 28
    Last Post: 07-16-2006, 11:35 PM