Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // cifsilit.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- struct MyStruct {
- int x;
- int z;
- char y;
- short t;
- };
- int nr(MyStruct *, const char *) {
- _asm {
- mov ebx, [ebp + 8]
- mov edx, [ebp + 12]
- mov eax, 0
- mov esi, 0
- mov dword ptr[ebx], 0
- mov dword ptr[ebx + 4], 0
- mov byte ptr[ebx + 8], 0
- mov word ptr[ebx + 10], 0
- while1: mov cl, [edx + esi]
- cmp cl, '\0'
- je stopwhile
- cmp cl, 'x'
- je amgasitx
- cmp cl, 'y'
- je amgasity
- cmp cl, 'z'
- je amgasitz
- cmp cl, 't'
- je amgasitt
- cmp cl, '0'
- jl nexti
- cmp cl, '9'
- jg nexti
- inc eax
- nexti : inc esi
- jmp while1
- amgasitx : inc dword ptr[ebx]
- jmp nexti
- amgasity : inc byte ptr[ebx + 8]
- jmp nexti
- amgasitz : inc dword ptr[ebx + 4]
- jmp nexti
- amgasitt : inc word ptr[ebx + 10]
- jmp nexti
- stopwhile :
- }
- }
- int main() {
- MyStruct L;
- char *c = "xxxyyyyzt3213210";
- int alfa = nr(&L, c);
- printf("%d\n", alfa);
- printf("%d\n", L.y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement