assembly - x86 question about bit comparisons -


im having problem final part of assignment. in stream of bits, etc etc, in stream integer number of 1's in text portion. integer , 24 correct, loop through text data , try count 1's in there. proc returning zero.

i able make sure looping , is.

the text = hello 16 1's, here proc looping through text count number of ones in it.

sub     ax,ax sub     si,si mov     bx,[bp+6]       ;get message offset      @@mainloop:     mov     cx,8     mov     dh,80h     cmp     byte ptr [bx + si],0     je      @@endchecker @@innerloop:     test    byte ptr [bx + si],dh     jz      @@zerofound     inc     ax     @@zerofound:         shr     bh,1         loop    @@innerloop          @@continue:         inc     si         jmp     @@mainloop 

the rest of proc push/pops. im wanting use test compare 100000000 byte, if 1 inc ax else shift right mask 1 , loop whole byte, inc next byte , again.

'shr bh,1' should 'shr dh,1', no?


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -