Thread: assmbly program.....Need to run

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    1

    assmbly program.....Need to run

    for some reason i am not able to run progam on my computer can somebody run this program and give me the output ... thanks

    %TITLE"5 TO 100"
    IDEAL
    MODEL SMALL

    DATASEG
    SUM dw 0

    code seg
    mov ax, 100
    pushloop: push ax
    sub ax, 5
    jnz pushloop
    mov ax, 0
    poploop: pop bx
    add ax, bx
    cmp bx, 100
    jl poploop
    mov [sum], ax

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    950 I believe?

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    I get 1050
    Code:
    #include <stdio.h>
    int main()
    {
    	int Result=0;
    	for (int i=100;i>0;i-=5)
    		Result+=i;
    	printf("%d\n", Result);
    
    	return 0;
    }

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I fail to see why that is so complicated. It accomplishes next to nothing. Use TASM, MASM or NASM format and it will work.

  5. #5
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    Quote Originally Posted by Bubba
    I fail to see why that is so complicated. It accomplishes next to nothing. Use TASM, MASM or NASM format and it will work.
    I fail to see why it's in the C++ forum.

    and many things not written in C/C++ are fast enough...
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Moved from C++ board - not a C++ question.
    Also gopipunjabi, get an assembler and find out for yourself.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  2. Re-doing a C program to run in Win2000 or XP
    By fifi in forum C Programming
    Replies: 5
    Last Post: 08-17-2007, 05:32 PM
  3. Replies: 3
    Last Post: 07-11-2005, 03:07 AM
  4. plz help me run this program!!!
    By galmca in forum C Programming
    Replies: 8
    Last Post: 02-01-2005, 01:00 PM
  5. Cannot run program in background?
    By registering in forum Linux Programming
    Replies: 3
    Last Post: 06-16-2003, 05:47 AM