This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Wednesday 11 November 2015

MIDTES TEKNIK KOMPILASI

SOAL :

1.       Diketahui persamaan :
Z:=(X2+Y)3-K/(L*M3)

Buatlah persamaan tersebut kedalam bentuk :

a. Triples Notation
b. Indirect Triples
c. Quaduples Notation
d. Kode Antara Assembly Accumulator Tunggal
Jawaban :
Z:=(X2+Y)3-K/(L*M3)
a. Triple Notation


1.
+,
X,
Y


2.
*,
1,
1


3.
*,
M,
M


4.
*,
M,
3


5.
*,
L,
4


6.
/,
K,
5


7.
-,
3,
6


8.
:=,
Z,
7








b.  
 Indirect triple




List Instruksi


List Eksekusi
1.
+,
X,
Y


1.
1
2.
*,
1,
1


2.
2
3.
*,
M,
M


3.
3
4.
*,
M,
3


4.
4
5.
*,
L,
4


5.
5
6.
/,
K,
5


6.
6
7.
-,
3,
6


7.
7
8.
:=,
Z,
7


8.
8







c.     Quadruple Notation


1.
+,
X,
Y,
T1


2.
*,
T1,
T1,
T2


3.
*,
M,
M,
T3


4.
*,
T3,
M,
T4


5.
*,
L,
T4,
T5


6.
/,
K,
T5,
T6


7.
-,
T2,
T6,

























Asembly Accumulator Tunggal                     
1.         LDA    X
            ADD   Y
            STO     T1
2.         LDA    T1
            MUL   T1
            STO     T2
3.         LDA    M
            MUL   M
            STO     T3
4.         LDA    T3
            MUL   M
            STO     T4
5.         LDA    L
            MUL   T4
            STO     T5
6.         LDA    K
            DIV     T4
            STO     T6
7.         LDA    T2
            SUB    T6
            STO     Z