Answer the question
In order to leave comments, you need to log in
How can I change the program to count units in a 32-bit number?
Good day, gentlemen
, there is a program where the units are counted, I need to count the zeros
, I realized that a jnc transition is used to search for the unit, but I don’t know how to find all the zeros?
.data;
msg_title db "Title", 0
buffer db 256 dup(?)
format db "%d", 0
.code
start:
mov edx, 819 ;число, в котором будем считать единицы
mov ecx, 0
mov ebx, 1
loop_start:
cmp ecx, 32
jge loop_end
rol edx, 0
jnc bit0
inc ebx
bit0:
inc ecx
jmp loop_start
loop_end:
fn MessageBox,0,str$(ebx),"Result",MB_OK
invoke ExitProcess, 0
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question