Click here to Skip to main content
15,905,229 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello, i am new here.
I am learning to write code in c ++.

how to write this in c ++ :

MOV ECX, OFFSET BYTE_BCAD72
CALL SUB_4ABCGA


What I have tried:

<pre>MOV ECX, OFFSET BYTE_BCAD72
CALL SUB_4ABCGA
Posted
Updated 12-Feb-17 17:25pm

you'd use __asm or __asm__ depending on your compiler

having said that, neither BYTE_BCAD72 or SUB_4ABCGA symbols would be defined in your code, so it probably wouldn't do what you wanted anyway, and ECX would be trashed too ...
 
Share this answer
 
Comments
ashley121 12-Feb-17 23:22pm    
Thank you for fast answer sir.
ashley121 12-Feb-17 23:46pm    
is this possible use ecx to call 4ABCGA ?
Quote:
how to write this in c ++ :
You don't, because these 2 lines have no meaning.

Learn properly C++

Here is links to references books on C and C++ by the authors of the languages. Note than C is the ancestor of C++, so knowing C is always useful with C++.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]

C++ Programing Language[^]
 
Share this answer
 
Comments
ashley121 12-Feb-17 23:23pm    
Thank you sir.
Those two lines of code are assembly language, not any version of C. This is the kind of stuff that C/C++ compiles down to.

These two lines of code are meaningless without the much larger block of code around them. There is no way to "convert" those lines of code to C++. You have to evaluate the code that they are in and then write C++ code equivalent to the entire block, if possible.
 
Share this answer
 
Comments
ashley121 12-Feb-17 23:50pm    
ty sir, is this possible use ecx to call 4ABCGA ?
Dave Kreskowiak 13-Feb-17 8:15am    
You didn't listen to a single word I said. Those two lines of code have absolutely no meaning what-so-ever. It's IMPOSSIBLE to convert them to C/C++.

ECX is a CPU register, the two labels BYTE_BCAD72 and SUB_4ABCGA are not defined in your code to there is no value to move into ECX and no way to call a sub that you don't have defined.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900