To Make Assembelly language program

Discussion in 'C Programming' started by VijayJaiswal, Nov 25, 2006.

  1. VijayJaiswal

    VijayJaiswal Guest

    How can i make and execute assembelly language programes in c language.
    I have not make a single assembelly program yet, so please give a small
    example. Also mension all the instructions necessary, so that i can
    make and execute assembely language programme on c compiler.
     
    VijayJaiswal, Nov 25, 2006
    #1
    1. Advertising

  2. VijayJaiswal

    Malcolm Guest

    "VijayJaiswal" <> wrote in message
    news:...
    > How can i make and execute assembelly language programes in c language.
    > I have not make a single assembelly program yet, so please give a small
    > example. Also mension all the instructions necessary, so that i can
    > make and execute assembely language programme on c compiler.
    >

    Most C compilers provide an "asm" or __asm or similar keyword as an
    extension.

    However the details of how to use it are specific to your particular
    compiler.
    --
    www.personal.leeds.ac.uk/~bgy1mm
    freeware games to download.
     
    Malcolm, Nov 25, 2006
    #2
    1. Advertising

  3. VijayJaiswal

    jacob navia Guest

    VijayJaiswal wrote:
    > How can i make and execute assembelly language programes in c language.


    Your compiler's documentation tells you how to do it.

    > I have not make a single assembelly program yet, so please give a small
    > example.


    Do your own homework. Since you say:

    I have not make a single assembelly program yet

    this means that you do not know at all assembly, i.e. you are a student
    that should answer a homework question.

    Also mension all the instructions necessary, so that i can
    > make and execute assembely language programme on c compiler.
    >


    You can't execute anything in the c compiler.
     
    jacob navia, Nov 25, 2006
    #3
  4. VijayJaiswal

    Guest

    On Nov 25, 1:43 pm, "VijayJaiswal" <>
    wrote:
    > How can i make and execute assembelly language programes in c language.
    > I have not make a single assembelly program yet, so please give a small
    > example. Also mension all the instructions necessary, so that i can
    > make and execute assembely language programme on c compiler.


    why dont you start with some simple processor (like 8085). There are
    a lots of good books available on 8085 architecture and its assembly
    programming.
     
    , Nov 25, 2006
    #4
  5. Chris Thomasson, Nov 25, 2006
    #5
  6. VijayJaiswal

    santosh Guest

    VijayJaiswal wrote:
    > How can i make and execute assembelly language programes in c language.
    > I have not make a single assembelly program yet, so please give a small
    > example. Also mension all the instructions necessary, so that i can
    > make and execute assembely language programme on c compiler.


    If you don't know assembly yet, then learn it first. Until then stay
    away from inline assembly. For x86 assembly, look at:

    http://www.drpaulcarter.com/pcasm/
    http://webster.cs.ucr.edu/
     
    santosh, Nov 25, 2006
    #6
  7. VijayJaiswal

    jacob navia Guest

    jacob navia, Nov 25, 2006
    #7
  8. VijayJaiswal

    jacob navia Guest

    santosh wrote:
    > VijayJaiswal wrote:
    >
    >>How can i make and execute assembelly language programes in c language.
    >>I have not make a single assembelly program yet, so please give a small
    >>example. Also mension all the instructions necessary, so that i can
    >>make and execute assembely language programme on c compiler.

    >
    >
    > If you don't know assembly yet, then learn it first.


    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    EXACTLY!

    "I do not know how to drive a car. Please tell me (with examples)
    how can I win the F1 race so that I can impress my girlfriend"
     
    jacob navia, Nov 25, 2006
    #8
  9. "jacob navia" <> wrote in message
    news:45683ece$0$25948$...
    > Chris Thomasson wrote:
    >> http://appcore.home.comcast.net/

    >
    > ?????
    > What has THAT to do with the subject?
    >
    > I do not understand the connection...


    Humm. It shows you how to create C API from a assembly language library. It
    shows how to use assembly from C.

    Is that not helpful to you? It has full source code for the assembly and the
    C.
     
    Chris Thomasson, Nov 25, 2006
    #9
  10. VijayJaiswal

    Malcolm Guest

    "santosh" <> wrote in message
    news:...
    > VijayJaiswal wrote:
    >> How can i make and execute assembelly language programes in c language.
    >> I have not make a single assembelly program yet, so please give a small
    >> example. Also mension all the instructions necessary, so that i can
    >> make and execute assembely language programme on c compiler.

    >
    > If you don't know assembly yet, then learn it first. Until then stay
    > away from inline assembly. For x86 assembly, look at:
    >

    That's not necessarily good advice.
    A C compiler will give you IO facilities that make it much easier to write a
    trivial assembler routine. For instance, an assembly program to add two
    numbers together is no good unless you can see the result.
    --
    www.personal.leeds.ac.uk/~bgy1mm
    freeware games to download.
     
    Malcolm, Nov 25, 2006
    #10
  11. VijayJaiswal

    santosh Guest

    Malcolm wrote:
    > "santosh" <> wrote in message
    > news:...
    > > VijayJaiswal wrote:
    > >> How can i make and execute assembelly language programes in c language.
    > >> I have not make a single assembelly program yet, so please give a small
    > >> example. Also mension all the instructions necessary, so that i can
    > >> make and execute assembely language programme on c compiler.

    > >
    > > If you don't know assembly yet, then learn it first. Until then stay
    > > away from inline assembly. For x86 assembly, look at:
    > >

    > That's not necessarily good advice.
    > A C compiler will give you IO facilities that make it much easier to write a
    > trivial assembler routine. For instance, an assembly program to add two
    > numbers together is no good unless you can see the result.


    What prevents one from calling scanf() printf() etc. from within one's
    assembly routines? Granted the ABI will tie you to a particular
    implementation, but that's not a big deal when you're doing assembly to
    start with.

    Also, it's very simple to write small assembly subroutines to convert
    string input to a value as well as the reverse, as long as you confine
    yourself to integers. I myself did it within a couple of weeks of
    starting on assembly. Also note that the authors of the assembly
    programming books whose sites I mentioned in my previous post provide a
    significant amount of premade library routines to do such common tasks
    and provide them freely. So the problems you state aren't really there.

    Typically inline assembly builds on pre-existing knowledge of assembly.
    The OP has mentioned that he hasn't written a single assembler program
    yet, which likely means that he knows no assembly. Hence my suggestion
    to him to learn standalone assembly first before tackling the
    complexities of a compiler's inline assembly feature.
     
    santosh, Nov 25, 2006
    #11
  12. VijayJaiswal

    Jack Klein Guest

    On 25 Nov 2006 04:10:10 -0800, ""
    <> wrote in comp.lang.c:

    >
    >
    > On Nov 25, 1:43 pm, "VijayJaiswal" <>
    > wrote:
    > > How can i make and execute assembelly language programes in c language.
    > > I have not make a single assembelly program yet, so please give a small
    > > example. Also mension all the instructions necessary, so that i can
    > > make and execute assembely language programme on c compiler.

    >
    > why dont you start with some simple processor (like 8085). There are
    > a lots of good books available on 8085 architecture and its assembly
    > programming.


    I have no idea what your answer means. The OP did not mention a
    processor, how did you know he isn't working on an 8085 platform to
    begin with?

    Is there some reason that you think that C somehow supports 8085
    assembly language, even though it does not support any other
    processor's assembly language?

    Finally, I am fairly sure there are absolutely no manufacturers of the
    8085 processor left today, making the idea a particularly futile one.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://c-faq.com/
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Nov 26, 2006
    #12
  13. VijayJaiswal

    Malcolm Guest

    "santosh" <> wrote in message
    news:...
    > Malcolm wrote:
    >> "santosh" <> wrote in message
    >> news:...
    >> > VijayJaiswal wrote:
    >> >> How can i make and execute assembelly language programes in c
    >> >> language.
    >> >> I have not make a single assembelly program yet, so please give a
    >> >> small
    >> >> example. Also mension all the instructions necessary, so that i can
    >> >> make and execute assembely language programme on c compiler.
    >> >
    >> > If you don't know assembly yet, then learn it first. Until then stay
    >> > away from inline assembly. For x86 assembly, look at:
    >> >

    >> That's not necessarily good advice.
    >> A C compiler will give you IO facilities that make it much easier to
    >> write a
    >> trivial assembler routine. For instance, an assembly program to add two
    >> numbers together is no good unless you can see the result.

    >
    > What prevents one from calling scanf() printf() etc. from within one's
    > assembly routines? Granted the ABI will tie you to a particular
    > implementation, but that's not a big deal when you're doing assembly to
    > start with.
    >

    You need an assembler that links to some sort of library, and to work out
    the linking and calling convention. It's the way to go after you have got
    things up and running, but if you are not clear on how to load a value into
    the accumulator, it's quite a tall order to set up a call to printf() to
    print it out.
    --
    www.personal.leeds.ac.uk/~bgy1mm
    freeware games to download.
     
    Malcolm, Nov 26, 2006
    #13
  14. In article <>,
    Jack Klein <> wrote:

    >Finally, I am fairly sure there are absolutely no manufacturers of the
    >8085 processor left today, making the idea a particularly futile one.


    Still sold, though. For example,
    http://www.loadparts.com/Catalog/8/1238.asp
    has more than 4500 of them.

    There are far too many hits for me to figure out whether there are
    any remaining manufacturers.
    --
    "law -- it's a commodity"
    -- Andrew Ryan (The Globe and Mail, 2005/11/26)
     
    Walter Roberson, Nov 26, 2006
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ed
    Replies:
    24
    Views:
    1,013
    Dimitri Maziuk
    Mar 27, 2006
  2. Abby
    Replies:
    1
    Views:
    495
    Jack Klein
    Aug 29, 2003
  3. DaveInSidney
    Replies:
    0
    Views:
    424
    DaveInSidney
    May 9, 2005
  4. pabbu
    Replies:
    8
    Views:
    733
    Marc Boyer
    Nov 7, 2005
  5. Shravani
    Replies:
    8
    Views:
    806
    Bartc
    Mar 16, 2008
Loading...

Share This Page