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.


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


    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
            adc     edx,0
            loop    lp0
    Last edited: Feb 17, 2008
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook