Skip to content

Instantly share code, notes, and snippets.

@annezao
Last active August 19, 2016 14:40
Show Gist options
  • Save annezao/36032613dbafa7941065a5489fc9ce0a to your computer and use it in GitHub Desktop.
Save annezao/36032613dbafa7941065a5489fc9ce0a to your computer and use it in GitHub Desktop.
#include <stdio.h>
int op, saida;
void main( )
{
saida = 0;
op = 192; // 11000000
asm(".intel_syntax noprefix");
asm ("mov %al, op"); // move op para registrador al
asm ("ror %al, 2"); // rotaciona al duas vezes
asm("mov saida, %al"); // saida = 00110000
asm(".att_syntax noprefix");
printf("Valor de saida: %u \n", saida);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment