Answer the question
In order to leave comments, you need to log in
How to move value from eax register to al register?
Hello, I have this code:
.model small
.stack 100h
.data
array db 0,0,0,0,1,1,1,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,0,1
len = $-array
.code
start
xor eax, eax ; eax = 0
xor bx, bx ; bx = 0
cycle:
sal eax ; сдвинули влево
neg bx
mov cl, array[len][bx] ; получаем байт с конца массива
neg bx
cmp cl, 0
je set0
set1: inc eax ; 1 бит в 1
set0: nop ; после сдвига 1 бит и так = 0
inc bx
cmp bx, len
jle cycle
; eax = число из битов* массива array
end start
Answer the question
In order to leave comments, you need to log in
Aggregator with the possibility of registration and IM on CMS? Oh well.
Any csm for IM fits your description. But the devil is in the details. And as it usually happens after a detailed review of the TOR, it turns out that not one CMS will work, because you need too many files.
al is part of the eax register (lower 8 bits), so the result is already there (if it fits in 8 bits).
For fidelity, you can reset the high bits of eax:
and eax, 0FFh
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question