Thread: addressing modes with respect to a C language program

  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    2

    Question addressing modes with respect to a C language program

    can anyone give one example each for various addressing modes with respect to C language.....

    for example what addressing mode is used in the following statement?

    a=200+300;

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    399
    The addressing modes used is going to depend on your processor and compiler. Not to mention that the example you posted might be compiled to several instructions.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Quote Originally Posted by ckarthickit View Post
    can anyone give one example each for various addressing modes with respect to C language.....
    For starters there's no need to know about addressing modes when programming in C.
    Only assembly language programmers are concerned with them - so why bother?
    Quote Originally Posted by ckarthickit View Post
    for example what addressing mode is used in the following statement?

    a=200+300;
    Most likely the immediate mode, but the assembler is king, as it may optimize it differently.

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Generate the assembly and have a look (for your compiler / architecture).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c program help :>
    By n2134 in forum C Programming
    Replies: 9
    Last Post: 02-06-2010, 12:12 PM
  2. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM