Bajardi: Ulashov Shahboz Guruh: 217-20 Mavzu: Assembler tilida asosiy operatorlar bilan ishlash




Download 24,41 Kb.
Sana09.07.2024
Hajmi24,41 Kb.
#267223
Bog'liq
22 Ulashov 3-topshiriq


O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

Komputerni tashkil etish fanidan

Amaliy ish

Bajardi: Ulashov Shahboz
Guruh: 217-20
Mavzu: Assembler tilida asosiy operatorlar bilan ishlash



  1. 22 10abc-6a;

unit Unit1;
interface
{$APPTYPE CONSOLE}
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
var a,b,c:Integer;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
begin
read (a,b,c);
asm
mov eax, 2
mul c
mov c,eax
mov eax,b
add c, eax
mov eax, c
mul a
mov c, eax
mov eax, b
add c,eax
end;
writeln(c);
end.

Dasturning CPU (Markaziy protsessordagi ) da ifodalanishi:


.LC0:
.string "a="
.LC1:
.string "b="
.LC2:
.string "c="
.LC3:
.string "d="
main:
push rbp
mov rbp, rsp
sub rsp, 16
mov esi, OFFSET FLAT:.LC0
mov edi, OFFSET FLAT:_ZSt4cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
lea rax, [rbp-8]
mov rsi, rax
mov edi, OFFSET FLAT:_ZSt3cin
call std::basic_istream >::operator>>(int&)
mov esi, OFFSET FLAT:.LC1
mov edi, OFFSET FLAT:_ZSt4cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
lea rax, [rbp-12]
mov rsi, rax
mov edi, OFFSET FLAT:_ZSt3cin
call std::basic_istream >::operator>>(int&)
mov esi, OFFSET FLAT:.LC2
mov edi, OFFSET FLAT:_ZSt4cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
lea rax, [rbp-16]
mov rsi, rax
mov edi, OFFSET FLAT:_ZSt3cin
call std::basic_istream >::operator>>(int&)
mov eax, DWORD PTR [rbp-16]
lea edx, [rax+rax]
mov eax, DWORD PTR [rbp-12]
add edx, eax
mov eax, DWORD PTR [rbp-8]
imul edx, eax
mov eax, DWORD PTR [rbp-12]
add eax, edx
mov DWORD PTR [rbp-4], eax
mov esi, OFFSET FLAT:.LC3
mov edi, OFFSET FLAT:_ZSt4cout
call std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)
mov rdx, rax
mov eax, DWORD PTR [rbp-4]
mov esi, eax
mov rdi, rdx
call std::basic_ostream >::operator<<(int)
mov eax, 0
leave
ret
__static_initialization_and_destruction_0(int, int):
push rbp
mov rbp, rsp
sub rsp, 16
mov DWORD PTR [rbp-4], edi
mov DWORD PTR [rbp-8], esi
cmp DWORD PTR [rbp-4], 1
jne .L5
cmp DWORD PTR [rbp-8], 65535
jne .L5
mov edi, OFFSET FLAT:_ZStL8__ioinit
call std::ios_base::Init::Init() [complete object constructor]
mov edx, OFFSET FLAT:__dso_handle
mov esi, OFFSET FLAT:_ZStL8__ioinit
mov edi, OFFSET FLAT:_ZNSt8ios_base4InitD1Ev
call __cxa_atexit
.L5:
nop
leave
ret
_GLOBAL__sub_I_main:
push rbp
mov rbp, rsp
mov esi, 65535
mov edi, 1
call __static_initialization_and_destruction_0(int, int)
pop rbp
ret
Download 24,41 Kb.




Download 24,41 Kb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Bajardi: Ulashov Shahboz Guruh: 217-20 Mavzu: Assembler tilida asosiy operatorlar bilan ishlash

Download 24,41 Kb.