Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- // !\\\\\\\\\\ Structs & Classes \\\\\\\\\\!
- struct stASM {
- template<typename T> T
- inline const printValue(T tValue) {
- _asm {
- mov eax, tValue
- }
- }
- template<typename T> T
- inline const subtractValue(T tSubtractFrom, T tSubtractBy) {
- _asm {
- mov eax, tSubtractFrom
- sub eax, tSubtractBy
- }
- }
- };
- // !\\\\\\\\\\\\\\ Main Code \\\\\\\\\\\\\\!
- stASM stASMObj;
- int main() {
- uintptr_t uipValue = 10;
- uintptr_t uipSubtractValue = 5;
- std::cout << "Value = " << stASMObj.printValue(uipValue) << "\n";
- std::cout << "Value - Subtract Value = " << stASMObj.subtractValue(uipValue, uipSubtractValue) << "\n";
- std::cin.get();
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement