C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Still working on the shl command Shift left
// shl destination, count
// Not sure how this
#include <stdio.h>
int power2( int num, int power );
int main( void )
{
printf( "3 times 2 to the power of 5 is %d\n", \
power2( 3, 5) );
}
int power2( int num, int power )
{
__asm(
"mov num, %eax\n" //Get first argument
"mov power, %ecx\n" //Get second argument"
"shl eax, cl\n" //EAX = EAX * ( 2 to the power of CL )"
"ret " //Will it return 3^2^5??
);
return -1;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run