Instrukcje wykonywane przez maszyne RAM +---+----------------+------------------------------------------+ | 1 | load =i | r0 := i | | | load p | r0 := rp | | | load *p | r0 := r[rp] | +---+----------------+------------------------------------------+ | 2 | store p | rp := r0 | | | store *p | r[rp] := r0 | +---+----------------+------------------------------------------+ | 3 | add =i | r0 := r0 + i | | | add p | r0 := r0 + rP | | | add *p | r0 := r0 + r[rP] | +---+----------------+------------------------------------------+ | 4 | sub =i | r0 := r0 - i | | | sub p | r0 := r0 - rP | | | sub *p | r0 := r0 - r[rP] | +---+----------------+------------------------------------------+ | 5 | mult =i | r0 := r0 * i | | | mult p | r0 := r0 * rP | | | mult *p | r0 := r0 * r[rP] | +---+----------------+------------------------------------------+ | 6 | div =i | r0 := floor(r0 / i) | | | div p | r0 := floor(r0 / rP) | | | div *p | r0 := floor(r0 / r[rP]) | +---+----------------+------------------------------------------+ | 7 | read p | rP := wartosc z tasmy wejsciowej | | | read *p | r[rP] := wartosc z tasmy wejsciowej | +---+----------------+------------------------------------------+ | 8 | write =i | zapisz na tasme wyjsciowa i | | | write p | zapisz na tasme wyjsciowa rP | | | write *p | zapisz na tasme wyjsciowa r[rP] | +---+----------------+------------------------------------------+ | 9 | jump etykieta | skocz do etykiety | +---+----------------+------------------------------------------+ |10 | jzero etykieta | skocz do etykiety gdy r0 = 0 | +---+----------------+------------------------------------------+ |11 | jgtz etykieta | skocz do etykiety gdy r0 > 0 | +---+----------------+------------------------------------------+ |12 | halt | zatrzymaj program | +---+----------------+------------------------------------------+