:

class STRING{

char *s;

public:

STRING (char * c){

s = new char[strlen(c)+1];

strcpy (s, c);

}

~STRING (){

delete []s;

}

public:

int len ()

};

. . :

#pragma inline

#include "mystr.h"

int STRING::len(){

int i;

for (i=0; s[i]; i++);

return i;

}

#pragma inline . , :

.386p

ifdef ??version

if ??version GT 500H

.mmx

endif

endif

model flat

ifndef ??version

?debug macro

endm

endif

?debug S "E:\users\lena\INSTITUT\ASM\USKOR\cl.cpp"

?debug T "E:\users\lena\INSTITUT\ASM\USKOR\cl.cpp"

_TEXT segment dword public use32 'CODE'

_TEXT ends

_DATA segment dword public use32 'DATA'

_DATA ends

_BSS segment dword public use32 'BSS'

_BSS ends

$$BSYMS segment byte public use32 'DEBSYM'

$$BSYMS ends

$$BTYPES segment byte public use32 'DEBTYP'

$$BTYPES ends

$$BNAMES segment byte public use32 'DEBNAM'

$$BNAMES ends

$$BROWSE segment byte public use32 'DEBSYM'

$$BROWSE ends

$$BROWFILE segment byte public use32 'DEBSYM'

$$BROWFILE ends

DGROUP group _BSS,_DATA

_TEXT segment dword public use32 'CODE'

@STRING@len$qv segment virtual

@@STRING@len$qv proc near

?live16385@0:

?debug L 4

push ebp

mov ebp,esp

push ecx

?debug L 6

@1:

xor eax,eax

mov dword ptr [ebp-4],eax


jmp short @3
@2:
inc dword ptr [ebp-4]
@3:
mov edx,dword ptr [ebp+8]
mov ecx,dword ptr [edx]
mov eax,dword ptr [ebp-4]
cmp byte ptr [ecx+eax],0
jne short @2
?debug L 7
mov eax,dword ptr [ebp-4]
?debug L 8
@6:
@5:
pop ecx
pop ebp
ret
?debug L 0
@@STRING@len$qv endp

v . L , , . vv v.
- , , .. ( ). - v:
mov edx,dword ptr [ebp+8]
mov ecx,dword ptr [edx]; &s
+ !
v v v v. L v v, v v T++.

#include "mystr.h"
int STRING::len(){
asm {
mov eax, -1
mov ecx, [ebp+8]
mov ecx, [ecx]
for1:
inc eax
cmp byte ptr [ecx+eax], 0
jne for1
}
}
T !