C++ to Assembly code

closed account (NCRLwA7f)
hello everyone, does anyone know how I can start a c++ program and drop down to assembly code for a few functions and pick right back up to c++?

so, for example, let's say I wanted to do something like this:
**note: this may not be logical...but let's pretend

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

char myArray[5] = {a,b,c,d,e}
//c++ code

//drop to assembly code//

lea esi, myArray ;load address of myArray
again:
mov bl,[esi]    ;moves ascii char to bl register
cmp bl,0        ;check if end of array
je fallout      
XOR bl, 00100000b ;converts lowercase to upper
inc esi        ;bump address to next char in array
jmp again

fallout


//back to c++//

or how about if I want to see my c++ code all converted to assembly, what would I have to do to have it all print out in assembly code.
I'm using xcode on mac, idk if that matters or not.


closed account (NCRLwA7f)
yes, This is good, I didn't know what it was called....I was under the impression that you could call a function that would do it.....obviously, its a little more involved, but this is very helpful none the less
Topic archived. No new replies allowed.