Thread: It's the little things my CPU does...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273

    It's the little things my CPU does...

    Hello,

    In 8086 assembly language, a right shift is accomplished by the instruction SHR. This directly equates to the C operator >>, but if I want to do the equivalent of a Rotate Carry Right (RCR) in C, how would I do it?

    An RCR shifts bits to the right but moves the carry flag into the highest bit and the lowest bit into the carry flag.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,663
    Using >> and & and | to catch the bit which falls off the end
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Suggestions for things to study
    By Mastadex in forum Windows Programming
    Replies: 5
    Last Post: 08-18-2008, 09:23 AM
  2. Run code on specific CPU?
    By pgzh in forum C Programming
    Replies: 3
    Last Post: 03-21-2008, 02:14 PM
  3. Sleep() causing unexplained reduction in cpu load
    By sajanphilip in forum C++ Programming
    Replies: 4
    Last Post: 02-26-2008, 02:58 AM
  4. Java vs C to make an OS
    By WOP in forum Tech Board
    Replies: 59
    Last Post: 05-27-2007, 03:56 AM
  5. Program chews up a lot of CPU when it closes
    By bman1176 in forum Windows Programming
    Replies: 4
    Last Post: 01-10-2002, 11:23 AM