1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

find the output in pen and paper.

Discussion in 'C' started by pkbis28, May 31, 2010.

  1. pkbis28

    pkbis28 New Member

    Joined:
    May 25, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    What will be output of following c program?

    Code:
    void main()
    {
    clrscr();
    asm{
          mov ax,61;
          mov bx,10;
          add bx,ax;
        }
    printf("\n%d",_BX);
    getch();
    }
     
  2. mmondal71

    mmondal71 New Member

    Joined:
    May 25, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    It may be 71.
     
  3. pkbis28

    pkbis28 New Member

    Joined:
    May 25, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    mmondal71 u r correct but will u please clarify?
     
  4. mmondal71

    mmondal71 New Member

    Joined:
    May 25, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    ax and bx is general purpose register. Statement mov ax,61 means value 61 is storing at register ax. Statement add bx, ax mean addition of content of register bx i.e 10 and content of register ax i.e. 61 and result of addition is storing at register bx.
     
  5. pkbis28

    pkbis28 New Member

    Joined:
    May 25, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    thanks. i got it.
     

Share This Page