Find the answer to your Linux question:
Results 1 to 3 of 3
register unsigned var=1234; register unsigned dwords=5; while (dwords--) { var+=5; __asm rol var,1 } I see gcc supports inline assembly, but I don't understand its format at all. TIA!!...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    11

    How do you do __asm rol var,1 in GCC?


    register unsigned var=1234;
    register unsigned dwords=5;
    while (dwords--) {
    var+=5;
    __asm rol var,1
    }

    I see gcc supports inline assembly, but I don't understand its format at all.

    TIA!!

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,846
    I thought you just did

    Code:
    asm
    {
        rol var,1
    }
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Sep 2011
    Posts
    11
    I'll have to try, but you're saying the only requirement is to place it within the brackets? The information I've seen on gcc inline assembly is cryptic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •