C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 12-04-2005, 05:44 PM   #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
gopipunjabi is offline   Reply With Quote
Old 12-04-2005, 06:07 PM   #2
Registered User
 
Tonto's Avatar
 
Join Date: Jun 2005
Location: New York
Posts: 1,465
950 I believe?
Tonto is offline   Reply With Quote
Old 12-04-2005, 07:52 PM   #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;
}
Quantum1024 is offline   Reply With Quote
Old 12-04-2005, 09:06 PM   #4
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,812
I fail to see why that is so complicated. It accomplishes next to nothing. Use TASM, MASM or NASM format and it will work.
__________________
If you aim at everything you will hit something but you won't know what it is.
Bubba is offline   Reply With Quote
Old 12-04-2005, 09:16 PM   #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?
ChaosEngine is offline   Reply With Quote
Old 12-05-2005, 02:24 AM   #6
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,662
Moved from C++ board - not a C++ question.
Also gopipunjabi, get an assembler and find out for yourself.
Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Client-server system with input from separate program robot-ic Networking/Device Communication 3 01-16-2009 03:30 PM
Re-doing a C program to run in Win2000 or XP fifi C Programming 5 08-17-2007 05:32 PM
Program with rand() func produces same results every run benj05 C++ Programming 3 07-11-2005 03:07 AM
plz help me run this program!!! galmca C Programming 8 02-01-2005 01:00 PM
Cannot run program in background? registering Linux Programming 3 06-16-2003 05:47 AM


All times are GMT -6. The time now is 09:23 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22