visual c++ - Get the value from inline assembly code -


i have inline assembly code this

__asm {     mov dword ptr [esp+4], 12345678h } 

i want value of @ [esp+4] in separate variable before 12345678h written there, can use further in c++ code.

according this manual found in less 5 minutes, variable identifiers valid within __asm blocks. found relevant example clicking "accessing c or c++ data in __asm blocks" link under "what want know more about?" section of manual:

a great convenience of inline assembly ability refer c or c++ variables name. __asm block can refer symbols, including variable names, in scope block appears. instance, if c variable var in scope, instruction

__asm mov eax, var

stores value of var in eax.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -