Compilerbau WiSe 2002/03Übungsblatt 10 |
program check = begin var a: real; proc doit(a: real) begin a := 1.2; out (a); end; proc twice(p: proc, val: real) begin p(val); out(val); done; a := 2.2; doit(a); out(a); twice(doit,a); out(a); end.Was wird im Falle von call by name, call by reference und call by value jeweils ausgegeben? Erläutern Sie die jeweilige Semantik.
doit(a)
und p(val)
erzeugt, und woher
stammen die im Code abgelegten Informationen?
Adr. | Wert | Subst.-Bit |
---|---|---|
0 | 1 | |
1 | 3 | |
2 | 2 | |
3 | 4 | |
4 | 5 | 1 |
5 | 7 | 1 |
6 | 6 | |
7 | 8 | |
8 | 9 | |
... |
IR1=5, IR2=3, IR3=7
LDA,I 3
im Akkumulator?LDA,I 4
im Akkumulator?LDA,I 2,2
im Akkumulator?