Jump to content

Simple Loop Program

- - - - -

  • Please log in to reply
No replies to this topic

#1
fantasticbag

fantasticbag

    Newbie

  • Members
  • PipPip
  • 10 posts
I've been asked for my project to create a program that will:

1. Read a number, n;
2. Go round a loop in which a further n numbers are read. Each positive number should
be added to a variable, postot, and each negative number to negtot;
3. Write out the postot and negtot variables.

This is the first program I've made in assembly code. It complies just fine yet when I run it I'll succesfully set the ECX to 'n'. replica handbags Replica Louis vuitton handbags|Wholesale replica handbags|Designer replica bags|--fantastic-replica.netOnce the loop completes the ECX will have reverted to some huge number rather than the 'n-1' I was expecting.

I suspect the scanf or printf subroutines may be intephering with the ECX. How can I run this program without the ECX being screwed around with?

Edited by fantasticbag, 05 January 2010 - 01:51 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users