Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Helpppp my code (finding lcm usng assembly) (http://www.go4expert.com/forums/helpppp-code-finding-lcm-usng-assembly-t3727/)

msaina 3Apr2007 12:11

Helpppp my code (finding lcm usng assembly)
 
The code is working to some point.Here is the code.Its an assignment and i have to forward it in 5 hours.
Code:

#include <stdio.h>

char format[] = "L.C.M = %d\n";
int a,b;


void main(){

        printf("Enter the first number ");
        scanf("%d",&a);
        printf("Enter the second number ");
        scanf("%d",&b);


        __asm{
      xor eax, eax
     
myLoop:
          add eax, a
          mov ebx, b
          mov ecx, eax

          div ebx

          cmp edx, 0
          mov eax, ecx

          jnz myLoop

         
          push eax
          mov eax, offset format
          push eax
          call printf
          pop ecx
          pop ecx


        }
}


DaWei 3Apr2007 22:47

Re: Helpppp my code (finding lcm usng assembly)
 
And we're to guess at what point it fails? You won't help us help you by giving a clue? I can name two things that will make it fail, but they're not guesses, they're facts, so my guess is: they don't count.


All times are GMT +5.5. The time now is 02:42.