How to Create .H files and use Assembler functions?

This is a discussion on How to Create .H files and use Assembler functions? within the C Programming forums, part of the General Programming Boards category; Hello I have DevC++. I created a function on Assembly and it generated and obj file I added this obj ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    16

    How to Create .H files and use Assembler functions?

    Hello I have DevC++. I created a function on Assembly and it generated and obj file

    I added this obj file with the project settings but I dont know how to construct the .H file and how to call it from the main.C


    This is my assembly code.-

    Thanks for your help
    Code:
    .386 
    .model flat, stdcall
    option casemap:none
    
    
    
    .data
    
    
    .code
    
    Myproc proc var1:REAL4, var2:REAL4
        LOCAL retval:REAL4
        finit
        fld var1
        fld var2
        fadd
        fstp retval
        fwait                ;<- is this really needed?
        mov eax, retval
        ret
    Myproc endp
    
    
    end;

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Find and read the assembler's manual -- surely the calling convention is documented there.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    16
    Ohh that helps a lot.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yes, you're absolutely right. Reading documentation on your brand of ASM does help. Hell, I've never learned ASM, but I bet if I was to learn it, finding documentation on it would be a pretty good start. But then, I've a clear grasp of the obvious. Something you apparently lack.

    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Hey, I know where to find everything to know about c/asm. Do you want me to tell you where?










    I will.....

















    tell you that http://www.google.com is a great place to start looking. nobody around here is gonna hold your hand and tell you step by step how to do what you want to do. I've seen a good 5 or 6 posts by you on this subject and have yet to see much effort on your part. so do what we have all done and learn to google
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  6. #6
    Registered User
    Join Date
    Apr 2005
    Posts
    16
    ohh that helps a lot.

  7. #7
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    did you just copy that from your last post?


    5 bucks says this thread gets locked
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  8. #8
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Best bet you've ever made.

    CLOSED

Popular pages Recent additions subscribe to a feed

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