Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If you are working in Visual Studio, then everything is simple:
int main()
{
short a=0;
__asm
{
mov ax, a
inc ax
mov a, ax
}
cout<<a; //1
}
1 rule of assembler inserts - "it would be better if you didn't do assembler inserts".
Are you sure you need it? For example, working with SSE is quite possible with the help of C++ libraries.
Some analogue of push pop can be considered the _allcoa function that allocates memory on the stack. Working with objects through assembler is of course possible. Read about call conventions, name mangling, alignment. If you want to work with objects using inheritance and virtual functions, then you need to understand the structure of the virtual function table.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question