Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

x86 flags after bit shifts with count = 0 (Developers)

posted by mht Homepage, Wroclaw, Poland, 05.12.2008, 08:55

Original Intel manual does not say explicitly that flags are left unchanged. It explains that SHR ARG, COUNT (other shift instructions are described similarly) is performed as follows:

argbefore := ARG;
temp := COUNT;
while (temp <> 0) do
begin
  CF := LowestBit(ARG);
  ARG := ARG div 2;
  temp := temp - 1;
end;
if (COUNT = 1) then
  if (HighestBit(argbefore) <> HighestBit(ARG)) then
    OF := 1
  else
    OF := 0
else
  OF := UNDEFINED;


and also says elsewhere that for all shift instructions, AF is undefined and SF, ZF and PF are set as usual.

 

Complete thread:

Back to the forum
Board view  Mix view
22752 Postings in 2119 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum