How to execute ROL instruction in Assembly inline?

Asked

Viewed 50 times

1

Guys, I have a problem to execute the instruction to scroll left in Assembly in a C code. All the sites I research show this way, but the compiler says there are many memory references to "ROL". I have tried to run other instructions like MOV and ADD and they worked, only one that I can’t. Can anyone help?

#include <stdio.h>
int rolar(int a){
    __asm__("rol a, 1");
}
int main(void){
    int a;
    scanf("%d", &a);
    printf("%d\n", rolar(a));
    return 0;
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.