Thread: assembly language loop

  1. #1
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693

    assembly language loop

    Can anyone tell me what is wrong with this simple program, I want it to loop 5 times and add the total amount of inputs together then output the total.


    Code:
    begin, input
    store x
    load x
    add total
    store total
    load count
    subt one
    store count
    skipcond 000
    jump begin
    output total
    halt
    x, dec 0
    count, dec 4
    one, dec 1
    total, dec 0

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    So what does it do at the moment.

    Not loop at all?
    Loop, but not 5 times?
    Not input?
    Wrong sum?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693
    Edit never mind I got it too work, for some reason I think I had to load total before I could output it.
    Last edited by camel-man; 10-27-2011 at 07:40 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Assembly Language Help ;)
    By shrink_tubing in forum C++ Programming
    Replies: 24
    Last Post: 03-11-2011, 12:47 AM
  2. assembly language
    By spongefreddie in forum C Programming
    Replies: 15
    Last Post: 02-12-2011, 08:36 PM
  3. help in assembly language
    By ema in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 12-14-2002, 02:22 AM
  4. Assembly Language...
    By Yoshi in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 12-20-2001, 10:04 AM
  5. Assembly Language
    By Breach23 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-21-2001, 11:31 AM