x86 - Assembly, easy code, Segmentation fault why -
i wrote first assembly code, tried copy easy c++ operation. values good, run ending segmentation fault. why?
;int x = 10; ;int y = 20; ;x += y; ;cout<<x<<"\n"; ;********************* global main extern readln extern println section .data x dd 10 y dd 20 section .txt main: ; second arg eax mov eax, [y] push eax ; first arg eax mov eax, [x] pop ebx add eax, ebx push eax call println add esp, 4
Comments
Post a Comment