plz give some help

ok here is what i want to do.
the program should ask for 20 numbers, the user gives them using ENTER to seperate, and these numbers should be STORED (that's my problem). next if they are stored, the user chooses to sort or to find the max/min, the avg, and how many times one number 'belongs' to the 20 given in the begining.

i am a rookie in asm, yet i understand some of framepointer, and i think if I do this

sub $fp,fp,80 #80 because we have 20 numbers x 4 bytes (a word)
then how should I store them?
thanks in advance..
and if you have sth to suggest in the other options, do it!

oh, i want my C back! :(

if only:
for(i=1;i<21;i++){
printf("give %d number", i);
scanf("%d",&a[i]);
}

Comments

  • : ok here is what i want to do.
    : the program should ask for 20 numbers, the user gives them using ENTER to seperate, and these numbers should be STORED (that's my problem). next if they are stored, the user chooses to sort or to find the max/min, the avg, and how many times one number 'belongs' to the 20 given in the begining.
    :
    : i am a rookie in asm, yet i understand some of framepointer, and i think if I do this
    :
    : sub $fp,fp,80 #80 because we have 20 numbers x 4 bytes (a word)
    : then how should I store them?
    : thanks in advance..
    : and if you have sth to suggest in the other options, do it!
    :
    : oh, i want my C back! :(
    :
    : if only:
    : for(i=1;i<21;i++){
    : printf("give %d number", i);
    : scanf("%d",&a[i]);
    : }
    :
    I assume that you've probably known how use "loop" in Asm. Then you should store the number by:
    - Push: push a value.
    - Pop: get a value.
    If you've pushed a,b,c,d in that order, then you should take in this order: d,c,b,a.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion