-
Dec 4th, 2005, 12:41 PM
#1
Thread Starter
New Member
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
-
Dec 4th, 2005, 02:57 PM
#2
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.
-
Dec 4th, 2005, 04:21 PM
#3
Thread Starter
New Member
Re: need to run thsi program...help...
thanku for your hlep can tell me how i can run this on my computer ......
-
Dec 5th, 2005, 11:17 AM
#4
Addicted Member
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
-
Dec 5th, 2005, 09:20 PM
#5
Re: need to run thsi program...help...
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|