User Tools

Site Tools


c:assembler_example

C - Assembler example

prog1.c
#include <stdio.h>
 
int main() {
  printf("Hello World!!!\n");
  return 0;
}
prog2.c
# include <stdio.h>
 
int main()
{
  int i=0;
  int cnt;
 
  for (cnt=0; cnt < 10; cnt++) {
    asm("addl $1, %0" : "+g" (i));
    printf("i = %d\n", i);
  }  
 
  return 0;
}
c/assembler_example.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki