Advertisement
rizky_herucakra

simple test, asm

Nov 16th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.21005.1
  2.  
  3.     TITLE   c:\Users\Rizky\documents\visual studio 2013\Projects\TestAssembly\TestAssembly\main.cpp
  4.     .686P
  5.     .XMM
  6.     include listing.inc
  7.     .model  flat
  8.  
  9. INCLUDELIB MSVCRTD
  10. INCLUDELIB OLDNAMES
  11.  
  12. PUBLIC  ?process@@YAXH@Z                ; process
  13. PUBLIC  ?process@@YAXM@Z                ; process
  14. PUBLIC  _main
  15. PUBLIC  ??_C@_0L@HMAHEEKL@Value?5?$DN?5?$CFd?$AA@   ; `string'
  16. PUBLIC  ??_C@_09HONNAFCA@Value?5?$DN?$CFd?$AA@      ; `string'
  17. PUBLIC  __real@40000000
  18. EXTRN   __imp__printf:PROC
  19. EXTRN   __RTC_CheckEsp:PROC
  20. EXTRN   __RTC_InitBase:PROC
  21. EXTRN   __RTC_Shutdown:PROC
  22. EXTRN   __fltused:DWORD
  23. ;   COMDAT __real@40000000
  24. CONST   SEGMENT
  25. __real@40000000 DD 040000000r           ; 2
  26. CONST   ENDS
  27. ;   COMDAT rtc$TMZ
  28. rtc$TMZ SEGMENT
  29. __RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
  30. rtc$TMZ ENDS
  31. ;   COMDAT rtc$IMZ
  32. rtc$IMZ SEGMENT
  33. __RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
  34. rtc$IMZ ENDS
  35. ;   COMDAT ??_C@_09HONNAFCA@Value?5?$DN?$CFd?$AA@
  36. CONST   SEGMENT
  37. ??_C@_09HONNAFCA@Value?5?$DN?$CFd?$AA@ DB 'Value =%d', 00H ; `string'
  38. CONST   ENDS
  39. ;   COMDAT ??_C@_0L@HMAHEEKL@Value?5?$DN?5?$CFd?$AA@
  40. CONST   SEGMENT
  41. ??_C@_0L@HMAHEEKL@Value?5?$DN?5?$CFd?$AA@ DB 'Value = %d', 00H ; `string'
  42. CONST   ENDS
  43. ; Function compile flags: /Odtp /RTCsu /ZI
  44. ; File c:\users\rizky\documents\visual studio 2013\projects\testassembly\testassembly\main.cpp
  45. ;   COMDAT _main
  46. _TEXT   SEGMENT
  47. _main   PROC                        ; COMDAT
  48.  
  49. ; 11   : int main(){
  50.  
  51.     push    ebp
  52.     mov ebp, esp
  53.     sub esp, 192                ; 000000c0H
  54.     push    ebx
  55.     push    esi
  56.     push    edi
  57.     lea edi, DWORD PTR [ebp-192]
  58.     mov ecx, 48                 ; 00000030H
  59.     mov eax, -858993460             ; ccccccccH
  60.     rep stosd
  61.  
  62. ; 12   :    process(2);
  63.  
  64.     push    2
  65.     call    ?process@@YAXH@Z            ; process
  66.     add esp, 4
  67.  
  68. ; 13   :    process(2.0f);
  69.  
  70.     push    ecx
  71.     movss   xmm0, DWORD PTR __real@40000000
  72.     movss   DWORD PTR [esp], xmm0
  73.     call    ?process@@YAXM@Z            ; process
  74.     add esp, 4
  75.  
  76. ; 14   : }
  77.  
  78.     xor eax, eax
  79.     pop edi
  80.     pop esi
  81.     pop ebx
  82.     add esp, 192                ; 000000c0H
  83.     cmp ebp, esp
  84.     call    __RTC_CheckEsp
  85.     mov esp, ebp
  86.     pop ebp
  87.     ret 0
  88. _main   ENDP
  89. _TEXT   ENDS
  90. ; Function compile flags: /Odtp /RTCsu /ZI
  91. ; File c:\users\rizky\documents\visual studio 2013\projects\testassembly\testassembly\main.cpp
  92. ;   COMDAT ?process@@YAXM@Z
  93. _TEXT   SEGMENT
  94. _f$ = 8                         ; size = 4
  95. ?process@@YAXM@Z PROC                   ; process, COMDAT
  96.  
  97. ; 7    : void process(float f){
  98.  
  99.     push    ebp
  100.     mov ebp, esp
  101.     sub esp, 192                ; 000000c0H
  102.     push    ebx
  103.     push    esi
  104.     push    edi
  105.     lea edi, DWORD PTR [ebp-192]
  106.     mov ecx, 48                 ; 00000030H
  107.     mov eax, -858993460             ; ccccccccH
  108.     rep stosd
  109.  
  110. ; 8    :    printf("Value =%d", f);
  111.  
  112.     cvtss2sd xmm0, DWORD PTR _f$[ebp]
  113.     mov esi, esp
  114.     sub esp, 8
  115.     movsd   QWORD PTR [esp], xmm0
  116.     push    OFFSET ??_C@_09HONNAFCA@Value?5?$DN?$CFd?$AA@
  117.     call    DWORD PTR __imp__printf
  118.     add esp, 12                 ; 0000000cH
  119.     cmp esi, esp
  120.     call    __RTC_CheckEsp
  121.  
  122. ; 9    : }
  123.  
  124.     pop edi
  125.     pop esi
  126.     pop ebx
  127.     add esp, 192                ; 000000c0H
  128.     cmp ebp, esp
  129.     call    __RTC_CheckEsp
  130.     mov esp, ebp
  131.     pop ebp
  132.     ret 0
  133. ?process@@YAXM@Z ENDP                   ; process
  134. _TEXT   ENDS
  135. ; Function compile flags: /Odtp /RTCsu /ZI
  136. ; File c:\users\rizky\documents\visual studio 2013\projects\testassembly\testassembly\main.cpp
  137. ;   COMDAT ?process@@YAXH@Z
  138. _TEXT   SEGMENT
  139. _i$ = 8                         ; size = 4
  140. ?process@@YAXH@Z PROC                   ; process, COMDAT
  141.  
  142. ; 3    : void process(int i){
  143.  
  144.     push    ebp
  145.     mov ebp, esp
  146.     sub esp, 192                ; 000000c0H
  147.     push    ebx
  148.     push    esi
  149.     push    edi
  150.     lea edi, DWORD PTR [ebp-192]
  151.     mov ecx, 48                 ; 00000030H
  152.     mov eax, -858993460             ; ccccccccH
  153.     rep stosd
  154.  
  155. ; 4    :    printf("Value = %d", i);
  156.  
  157.     mov esi, esp
  158.     mov eax, DWORD PTR _i$[ebp]
  159.     push    eax
  160.     push    OFFSET ??_C@_0L@HMAHEEKL@Value?5?$DN?5?$CFd?$AA@
  161.     call    DWORD PTR __imp__printf
  162.     add esp, 8
  163.     cmp esi, esp
  164.     call    __RTC_CheckEsp
  165.  
  166. ; 5    : }
  167.  
  168.     pop edi
  169.     pop esi
  170.     pop ebx
  171.     add esp, 192                ; 000000c0H
  172.     cmp ebp, esp
  173.     call    __RTC_CheckEsp
  174.     mov esp, ebp
  175.     pop ebp
  176.     ret 0
  177. ?process@@YAXH@Z ENDP                   ; process
  178. _TEXT   ENDS
  179. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement