creating assembly functions

How can I create an assembly function?

How can I call it from c?

Thanx..

Parents
  • 1) I like to use a text editor, and run the source file through the assembler.

    2) Declare the name of the function PUBLIC with an underscore in front:

    PUBLIC  _MyFunc
    _MyFunc:
            RET
    


    Then in C, you can write a header file with extern references to match, and call the function as you would any C function.

    extern void MyFunc (void);

    If you want to pass parameters, study the manual for the C parameter passing convention, and write your assembler function accordingly.

Reply
  • 1) I like to use a text editor, and run the source file through the assembler.

    2) Declare the name of the function PUBLIC with an underscore in front:

    PUBLIC  _MyFunc
    _MyFunc:
            RET
    


    Then in C, you can write a header file with extern references to match, and call the function as you would any C function.

    extern void MyFunc (void);

    If you want to pass parameters, study the manual for the C parameter passing convention, and write your assembler function accordingly.

Children
More questions in this forum