assembly - Find middle value of a list -
i'm having trouble figuring out how find middle value in list of double words has amount of 50 numbers. when try implement code follows
mov eax, dword[volumes+100] add eax, dword[volumes+104] div dword[satwo] mov dword[vmid], eax
where volumes 100 , 104 25th , 26th elements in list. divide 2 , store middle value in vmid. problem arises when debug program vmid 0 not correct.
don't div. use right shift instead.
if numbers unsigned, carry flag contains overflow, use rcr. otherwise sar. if speed issue, check combinations of clearing carry flag , rcr.
Comments
Post a Comment