Appendix 2: INSTRUCTION SET REFERENCE

The following lists the instruction set of the Rubato machine and a brief description of what each instruction does. The following semantic functions may prove useful in decoding the descriptions

push(a)
pushes the value a onto the expression stack
pop(a)
pops the topmost value of the expression stack onto the variable a
contents(a)
contents of the location in the data store pointed by address a
deref(m,n)
dereferences (get the address of) the object addressed by pair m,n
write(a,n)
writes n to the location in the data store pointed by address a

INSTRUCTION
DESCRIPTION
nop

No Operation, does not do anything

halt
Halts execution of a program on the Rubato machine
wait
Wait for child VIEUs to die before continuing
vieu n
Create a new VIEU to execute at address n
vieus
pop(n); create a new VIEU to execute at address n
alloc n
Allocate n objects on the current environment stack
push n
push(n)
pushi n
push(contents(n))
pusha m,n
push(deref(m,n))
pushv m,n
push(contents(deref(m,n)))
pushe
Creates a new environment record
pop
pop(a), i. e., the value a is ignored
popi a
pop(n); write(a,n)
popis
pop(a); pop(n); write(a,n)
popv m,n
pop(v); write(deref(m,n),v)
pope
Destroys environment record
jump a
jump to address a on the code store
jumps
pop(a); jump to address a on the code store
jumpt a
pop(f) jump to address a on the code store if f <> 0
jumpts
pop(a); pop(f); jump to address a on the code store if f <> 0
jumpf a
pop(f) jump to address a on the code store if f == 0
jumpfs
pop(a); pop(f); jump to address a on the code store if f == 0
jsub a
call subroutine at address a
jsubs
pop(a); call subroutine at address a
subret
return from subroutine
call m,n
(do a procedure or function call) pop(a); for i = 1 to n do pop(arg[i]); destroys m environment records; create new activation stack; jump to address a
ret
return from procedure
retf n
return from function with value n
retfs
pop(n); return from function with value n
tempo n
set tempo of current VIEU to n
tempos
pop(n); set tempo of current VIEU to n
note n
play a note with pitch n
notes
pop(n); play a note with pitch n
chord n
play a chord with pitch n
chords
pop(n); play a chord with pitch n
delay n
Set next note delay register to n
delays
pop(n); Set next note delay register to n
vel n
Set next note velocity register to n
vels
pop(n); Set next note velocity register to n
dur n
Set next note duration register to n
durs
pop(n); Set next note duration register to n
pres n
Set next note pressure register to n
press
pop(n); Set next note pressure register to n
patch n
Set next note patch register to n
patchs
pop(n); Set next note patch register to n
chan n
Set next note channel register to n
chans
pop(n); Set next note channel register to n
loadn
Read default pitch register into v; push(v)
loady
Read default delay register into v; push(v)
loadv
Read default velocity register into v; push(v)
loadp
Read default pressure register into v; push(v)
loadd
Read default duration register into v; push(v)
loada
Read default patch register into v; push(v)
loadc
Read default channel register into v; push(v)
storens
pop(v); Write v into default pitch register
storeys
pop(v); Write v into default delay register
storevs
pop(v); Write v into default velocity register
storeds
pop(v); Write v into default duration register
storeps
pop(v); Write v into default pressure register
storeas
pop(v); Write v into default patch register
storecs
pop(v); Write v into default channel register
dups
pop(a); push(a); push(a);
nots
pop(a); push(not a)
negs
pop(a); push(-a);
incs
pop(a); push(a+1)
decs
pop(a); push(a-1)
adds
pop(b); pop(a); push(a+b)
subs
pop(b); pop(a); push(a-b)
muls
pop(b); pop(a); push(a*b)
divs
pop(b); pop(a); push(a/b)
mods
pop(b); pop(a); push(a mod b)
less
pop(b); pop(a); push(a<b)
gtrs
pop(b); pop(a); push(a>b)
ands
pop(b); pop(a); push(a and b)
ors
pop(b); pop(a); push(a or b)
eqs
pop(b); pop(a); push(a == b)
neqs
pop(b); pop(a); push(a <> b)
les
pop(b); pop(a); push(a <= b)
ges
pop(b); pop(a); push(a >= b)

Next: Appendix 3: Summary and Description of MIDI
Previous: Appendix 2: INSTRUCTION SET REFERENCE
Back to: Table of Contents


Created on Sat Feb 21 20:21:24 1998 using a perl script called m2h from original troff mm document.
Click here to download a copy of m2h.

Author: Chris Tham
Email: Chris_Tham@hp.com