Id: befehle.tex,v 1.4 2004/10/26 11:33:45 waldmann Exp
Betrachten einfaches (Keller-)Maschinenmodell,
ähnlich zu offizieller JVM.
ein Rechenschritt ist:
Befehl B aus Programmspeicher C holen und ausführen:
B := C [PC]; execute(B); PC := PC+1;
push(x) ==> S[SP] := x; SP := SP+1;
und pop(y) ==> SP := SP-1; y := S[SP];
push(i);
und Drop: pop();
pop(B); pop(A); push (A+B);
ähnlich Sub, Mul
pop(A); push(M[A]);
pop(A); pop(B); M[A] := B;
d. h. Benutzung so:
push (Wert); push (Adresse); Store
PC := PC + r
ändert Stack nicht
pop (A); if 0 == A then Jump r;
verbraucht top of stack
Im Zweifelsfall: RTFC (Read The F...ing Code): http://141.57.11.163/cgi-bin/cvsweb/tool/src/JVM/#dirlist