Académique Documents
Professionnel Documents
Culture Documents
1. SOURCE CODE
program practice1;
#include ("stdlib.hhf");
static
bb: int32;
cc: int32;
summ: int32;
a: int32;
b: int32:=5;
c: int32:=6;
begin practice1;
mov( b, eax ); //move b into the register
mul( b, eax ); //multiply it by b in it
mov( eax, bb ); //move eax into bb
mov( c, eax ); //move c into the register
mul( c, eax ); // multiply by c
mul( c, eax ); // multiply by another c in the register
mov( eax, cc); // multiply by another c
end practice1;
OUTPUT
2. SOURCE CODE
program practice2;
#include ("stdlib.hhf");
static
dd: int32;
cc: int32;
bb: int32;
subtr: int32;
d: int32:=8;
c: int32:=4;
begin practice2;
mov( d, eax ); // move d into the register
mul( d, eax ); // multiply another d to it
mul( d, eax ); // multiply another d
mul( d, eax ); // multiply another d
mov( eax, dd ); //move eax into dd
mov( c, eax ); // move c into register
mul( c, eax ); // multiply c with it
mul( c, eax ); //multiply another c
mov( eax, cc ); // move the eax into cc
OUTPUT
3. SOURCE CODE
program practice3;
#include ("stdlib.hhf");
static
aa: int32;
cc: int32;
bb: int32;
ab: int32;
bc: int32;
ca: int32;
sum1: int32;
sum2: int32;
answer: int32;
a: int32:=5;
b: int32:=6;
c: int32:=7;
d: int32:=2;
begin practice3;
mov( a, eax );
mul( a, eax );
mov( eax, aa );
mov( b, eax );
mul( b, eax );
mov( eax, bb );
mov( c, eax );
mul( c, eax );
mov( eax, cc );
OUTPUT