can somebody help me. i have project about using asm(x86) in c and c++ but i dont have any idea.how to use the function.and can anyone send me an example about controlling hardware via that program
You may have a look at the inline-assembly instruction
-
asm {
-
-
<operator> <target_operand>, <source_operand>
-
...
-
}
-
Depending on your compiler you may also (better?) use _asm{} or __asm{}.
Using this instruction you are able to embed assembly instruction into normal C-Code. The compiler will ignore the (assembly) instruction in the brackets and invoke the assembler instead.
Sample code would look like
-
asm {
-
-
mov al,v1
-
xchg al,v2
-
mov v1,al
-
}
-
Hope that helps a little. If you Google for "inline assembly C" you will find some more detailed tutorials on this topic ...