Need help programing in assembly language

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
Cathartics
Messages
27
Reaction score
0
*****need help programing in assembly language*****

Hi there everyone. I am really new to this assembly language and i don't 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 (?)
 
Physics news on Phys.org
Bit oriented method:

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

Code:
        mov     ecx,32
        mov     edx,0
lp0:    rol     eax,1
        cmc
        adc     edx,0
        loop    lp0
 
Last edited: