Posted April 23, 200916 yr Hello,i wanted to ask if someone knows something like a comparison-list of (m)asm and c/ c++ functions. I understand both languages and can write and read it, but a list which compares functions would be nice.What i mean for example:ASMmov eax, value1cmp eax, value2//codemov eax, 5//codemov value3, eaxCif (value1 == value2) { value3 = 5; }Maybe the examples don't match very well but it should be something similar i guess (cant test it right now..).So what i am asking is if there is somewhere a list where i can see how common functions/ instructions look like in asm <-> c?It would be nice to see quickly when i have some asm instructions how the appopriate c function would look like (if-else, loops, strlen, memcpy, ...) Edited April 23, 200916 yr by unix
April 23, 200916 yr Hacker Disassembling Uncovered has a section called "Identifying Key Structures of High-Level Languages", you'll find similar information in other publications as well. Or you could do it on your own, code a small C program and analyze the disassembly.
April 23, 200916 yr Sometimes it is harder though, if using VC++ because of MS optimization. What you write in your C/C++ code will differ greatly or only a little, depending on your optimization settings.HR,Ghandi Edited April 23, 200916 yr by ghandi
April 23, 200916 yr Reminds me of VC++ "optimizing" a "mov dword ptr [00000000], eax" into my code... and no, the C code didn't contain any static zero pointer.
April 23, 200916 yr Author Thank you, guess i will look for a copy of Hacker Disassembling Uncovered as i wanted to read it anyway. Thanks Sometimes it is harder though, if using VC++ because of MS optimization. What you write in your C/C++ code will differ greatly or only a little, depending on your optimization settings. I tried that first but got "stuck" because of this.
April 23, 200916 yr this discussion is not about masm like the topic says.if i would code that in masm it would look like in c//cif (value1 == value2) { value3 = 5; };---masm---mov eax,value2.if value1 == eax mov value3,5.endif
April 24, 200916 yr c:if (value1 == value2){value3 = 5;}Fasm:(http://flatassembler.net/)format PE GUI 4.0entry startvalue1 equ 1value2 equ 1value3 db ?start:mov eax,value1cmp eax,value2jne lablemov eax,5mov byte [value3],allable:; exit Edited April 28, 200916 yr by by:70
April 27, 200916 yr Author Thanks for your replys. @diablo2oo2: Can you recommend a good book or other resource about "real" masm programming? I tried Art of Assembly Language but it seems to be High Level Assembly.. edit: except iczelions and gobbits from arteam of course. Edited April 27, 200916 yr by unix
April 28, 200916 yr http://www.movsd.com/masm32.rarMicrosoft_Macro_Assembler_Reference.rar Edited April 28, 200916 yr by by:70
April 28, 200916 yr Iczelion's-Tutorial's (recommend) http://tuts4you.com/download.php?view.1200 Edited April 28, 200916 yr by Teddy Rogers You could just link to the tutorial... :)
April 28, 200916 yr Author Thanks by:70, i like the two references Iczelion's-Tutorial's are great too, but i was looking for other ones as i am already working on them
Create an account or sign in to comment