Results 1 to 5 of 5

Thread: need to run thsi program...help...

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    6

    need to run thsi program...help...

    i have alread wrote the program...but i am not able to run this on my computer......i need the output.....can you please run this and give me the output

    %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
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: need to run thsi program...help...

    It doesn't do anything. It keeps subtracting 5 from 100 until it hits 0 and then counts back up again until its 100.

    Then it moves 100 into a null pointer. (sum is zero and remains zero throughout) remove the [] around sum if you want to store the value in sum itself.

    Completely pointless. There is no output.
    I don't live here any more.

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    6

    Re: need to run thsi program...help...

    thanku for your hlep can tell me how i can run this on my computer ......

  4. #4
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: need to run thsi program...help...

    lol - didn't you see what he wrote - there's no output so you wouldn't be able to see what it did even if it does work - which i doubt

  5. #5
    College Grad!!! Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: need to run thsi program...help...

    Quote Originally Posted by gopipunjabi
    thanku for your hlep can tell me how i can run this on my computer ......
    You could try C++ located within Visual Studio, if you got it. However you won't see much, cause this will only show the end result as your output.

    Code:
    #include <stdio.h>
    
    int Asm_Test(void){
    
        _asm{
    
            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;
    
        }
    
    }
    
    int main(void){
    
        printf("%d\n", Asm_Test());
        return 0;
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width