قطعه کد زیر را از زبان سی پلاس پلاس به اسمبلی ببرید.
int a=10 ; int *b=&a; *b = 100; cout<< a <<endl; cout<<b << endl;
زبان اسمبلی
.386 .MODEL FLAT ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD INCLUDE io.h ; header file for input/output cr EQU 0dh ; carriage return character Lf EQU 0ah ; line feed .STACK 4096 ; reserve 4096-byte stack .DATA ; reserve storage for data a dword ? b dword ? prn dword ? .CODE ; start of main program code _start: mov a,10 mov edx,offset a mov b, edx mov eax,100 mov edx,b mov [edx],eax mov eax , a dtoa prn ,eax output prn mov edx,b mov eax , [edx] dtoa prn ,eax output prn INVOKE ExitProcess, 0 ; exit with return code 0 PUBLIC _start ; make entry point public END ; end of source code