Nama
: Carolina de jesus
Nim
: 13110191
Mid : teknik kompilasi
Soal
:
1
. Z=(x2 + y)-K/(L*M3)
Ubahlah persamaan diatas menjadi
A . Triples notation
B . Indirect triples
C . Quadruples notation
D . kode antara Assembly dan Accumulative tunggal
Penyelesaian
a
. Triples Notation b . Indirect triples List eksekusi
1 . +, x2 x 1 . +, Y 1
. 1
2 . *, 1, 1 2 . *, 1 2 . 2
3 . *, M, M 3 . *, M 3
. 3
4 . *, M, 3 4 . *, 3 4
. 4
5 . *, L, 4 5 . *, 4 5
. 5
6 . /, k, 5 6
. /,
5 6
. 6
7 . -, 3, 6
7 . -, 6 7
. 7
8 . :=, Z, 7 8 . :=, 7 8 . 8
c
. Quadruples Notation
1 . +, x, y T1
2 . *, T, T1 T2
3 . *, M, M, T3
4 . *, T3, M T4
5 . *, L, T4 T5
6 . /, K, T5 T6
7 . :=, T2, T6 Z
1
. LDA X
ADD X
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
6
. LDA K
DIV T4
STO T6
7
. LDA T2
SUB T6
STO Z
.
Tidak ada komentar:
Posting Komentar