SHOW:
|
|
- or go back to the newest paste.
1 | - | .intel_syntax noprefix |
1 | + | type SmallStruct |
2 | A as byte | |
3 | - | .section .text |
3 | + | B as byte |
4 | - | .balign 16 |
4 | + | C as byte |
5 | D as byte | |
6 | - | .globl _MYASMFUNC@8 |
6 | + | end type |
7 | - | _MYASMFUNC@8: |
7 | + | |
8 | - | push ebp |
8 | + | type BigStruct |
9 | - | mov ebp, esp |
9 | + | A as long |
10 | - | sub esp, 4 |
10 | + | B as long |
11 | - | push ebx |
11 | + | end type |
12 | - | push esi |
12 | + | |
13 | - | push edi |
13 | + | function AddSmall naked ( byval tParms as SmallStruct ) as byte |
14 | - | mov dword ptr [ebp-4], 0 |
14 | + | asm |
15 | - | .L_0004: |
15 | + | mov al,[esp+4] |
16 | - | mov eax, [ebp+8] |
16 | + | add al,[esp+5] |
17 | - | add eax, [ebp+12] |
17 | + | add al,[esp+6] |
18 | - | mov [ebp-4], eax |
18 | + | add al,[esp+7] |
19 | - | .L_0005: |
19 | + | ret 4 |
20 | - | mov eax, dword ptr [ebp-4] |
20 | + | end asm |
21 | - | pop edi |
21 | + | end function |
22 | - | pop esi |
22 | + | |
23 | - | pop ebx |
23 | + | function AddBig naked ( tParms as BigStruct ) as long |
24 | - | mov esp, ebp |
24 | + | asm |
25 | - | pop ebp |
25 | + | mov edx, [esp+4] |
26 | - | ret 8 |
26 | + | mov eax,[edx] |
27 | - | .balign 16 |
27 | + | add eax,[edx+4] |
28 | ret 4 | |
29 | - | .globl _main |
29 | + | end asm |
30 | - | _main: |
30 | + | end function |
31 | - | push ebp |
31 | + | |
32 | - | mov ebp, esp |
32 | + | print AddSmall( type(100,20,5,-1) ) |
33 | - | and esp, 0xFFFFFFF0 |
33 | + | print AddBig( type(5000,200) ) |
34 | - | sub esp, 12 |
34 | + | sleep |