Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

accessing c macros in asm file

c_anandsc_anands Member Posts: 53
Hello all,
I am trying to use the c macros in asm file. I have 2 different files( sample.c and macro.asm.In sample.c I have defines a macro #define NUM 5 and now I want to use this NUM in asm file.What should I do? Also tell me the way of using the asm file macro in c.
Anand.

Comments

  • whoiewhoie Member Posts: 672
    : Hello all,
    : I am trying to use the c macros in asm file. I have 2 different files( sample.c and macro.asm.In sample.c I have defines a macro #define NUM 5 and now I want to use this NUM in asm file.What should I do?

    Yes, I have had to crack this nut a couple of times myself. In order to keep the code synchronized, I use a simple text file that contains identifiers and values. Right before I compile, I run that through a little program I wrote that makes a C header file, and an assembly file. My assemblers have a directive that works much like #include does. That way, I can keep both in sync.

    The program doesn't have to be anything difficult, I just use whitespace as a delimiter, and my little tool creates the include guards and capitalizes the macro names for the C header files. For the assembly files, you will need to consult their documentation to learn the proper incantation.

    Anyways, that's just an idea, but I would be interested in hearing how others have tackled this as well.


    HTH,
    Will
    --
    http://www.tuxedo.org/~esr/faqs/smart-questions.html
    http://www.eskimo.com/~scs/C-faq/top.html
    http://www.parashift.com/c++-faq-lite/
    http://www.accu.org/


  • Shawn CarterShawn Carter Member Posts: 0

    __ \ http://forcoder.org \ free ebooks and video tutorials about [ C++, R, Swift, Delphi, Scratch, Python, Assembly, C, Visual Basic .NET, MATLAB, Java, Perl, Go, PL/SQL, Objective-C, PHP, JavaScript, Ruby, C#, Visual Basic Logo, Kotlin, Erlang, Transact-SQL, Crystal, Hack, Prolog, LabVIEW, ML, Clojure, Lua, Rust, Fortran, Julia, Scheme, Lisp, Dart, D, VBScript, FoxPro, SAS, Awk, Bash, Alice, Apex, ABAP, F#, Ada, Scala, COBOL ] _

Sign In or Register to comment.