Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help programing in assembly language

  1. Feb 16, 2008 #1
    *****need help programing in assembly language*****

    Hi there everyone. I am really new to this assembly language and i dont know how to code this simple programe.. Please help me with this. I would very much appreciate it.. here is the question..



    Need to design assembly language programe IA-32 that could find the number of 0's [binary] in each integer in x and put and display the value in y.

    .DATA

    X SWORD -100,200,300,400,-500
    Y BYTE 5 DUP (?)
     
  2. jcsd
  3. Feb 17, 2008 #2

    rcgldr

    User Avatar
    Homework Helper

    Bit oriented method:

    Assume value in EAX, zero bit count will be in EDX

    Code (Text):

            mov     ecx,32
            mov     edx,0
    lp0:    rol     eax,1
            cmc
            adc     edx,0
            loop    lp0
     
     
    Last edited: Feb 17, 2008
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Need help programing in assembly language
Loading...