Professional Documents
Culture Documents
Monitoria
Monitoria
#include <vcl.h>
#pragma hdrstop
#include "timer.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
float dato[5];
int i=0;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
float V1=0.0,V2=0.0,Res=0.0;
V1= StrToFloat(Edit1->Text);
V2= StrToFloat (Edit2->Text);
asm
{
fld V1
fld V2
fadd
fstp Res
}
dato[0]=Res;
asm
{
fld V1
fld V2
fsub
fstp Res
}
dato[1]=Res;
asm
{
fld V1
fld V2
fmul
fstp Res
}
dato[2]=Res;
asm
{
fld V1
fld V2
fdiv
fstp Res
}
dato[3]=Res;
Timer1->Enabled=True;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
switch(i)
{
case 0:
Edit3->Text=dato[i]; //dato=0
i++;
break;
case 1:
Edit3->Text=dato[i];
i++;
break;
case 2:
Edit3->Text=dato[i];
i++;
break;
case 3:
Edit3->Text=dato[i];
i++;
break;
case 4:
i=0;
Timer1->Enabled=False;
break;
}
}
//---------------------------------------------------------------------------