flat assembler
Message board for the users of flat assembler.

Index > Main > RCL/RCR

Author
Thread Post new topic Reply to topic
hckr83



Joined: 12 Nov 2006
Posts: 86
Location: usa
hckr83 05 Jan 2008, 17:15
For RCL and RCR, do these instructions set the carry flag to 0 or do they rotate in what CF already is into the result?

_________________
x86 CPU Emulation library: http://sourceforge.net/projects/x86lib
Post 05 Jan 2008, 17:15
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 05 Jan 2008, 18:31
The value of CF prior to execution goes into result and the bit that gets out after doing the operation is copied into the flag.

Code:
mov eax, $80000000
xor edx, edx

shl eax, 1 ; EAX = $00000000; EDX = $00000000; CF = 1
rcr edx, 1 ; EAX = $00000000; EDX = $80000000; CF = 0
    


[edit]Changed first instruction to other that shows my point more clear Razz[/edit]


Last edited by LocoDelAssembly on 05 Jan 2008, 18:42; edited 1 time in total
Post 05 Jan 2008, 18:31
View user's profile Send private message Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 05 Jan 2008, 18:38
LocoDelAssembly wrote:

mov eax, $80000000
xor edx, edx

rol eax, 1 ; EAX = $00000001; EDX = $00000000; CF = 1
rcr edx, 1 ; EAX = $00000000; EDX = $80000000; CF = 0

_________________
Any offers?
Post 05 Jan 2008, 18:38
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 05 Jan 2008, 18:44
There is another error just in the comment below Wink

I have changed the instruction. Thanks for point that out.
Post 05 Jan 2008, 18:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.