asm keyword in c programming language


asm keyword in c programming language

Keyword asm is used to write assembly language code in c programming.

(1) What will be output of following c program?

#include<stdio.h>
int main(){

asm{
         mov ax,10;
         shl,2;
    }

printf("%d",_AX);
return 0;
}

Output: 40
Explanation: ax and bx is general purpose register. Statement mov ax, 61 means value 61 is storing at register ax. Statement shl 2 is equivalent to a<<2

If you want to know more about asm keyword in c you can ask here.

Post a Comment