Instruction Summary

SICP > Computing with Register Machines > Designing Register Machines > Instruction Summary
Previous: Using a Stack to Implement Recursion Next: A Register-Machine Simulator

    A controller instruction in our register-machine language has one of the following forms, where each inputi is either (reg register-name) or (const constant-value).

    These instructions were introduced in section [*]:

    (assign register-name (reg register-name))
    
    

    (assign register-name (const constant-value))

    (assign register-name (op operation-name) input1 ... inputn)

    (perform (op operation-name) input1 ... inputn)

    (test (op operation-name) input1 ... inputn)

    (branch (label label-name))

    (goto (label label-name))

    The use of registers to hold labels was introduced in section [*]:

    (assign register-name (label label-name))
    
    

    (goto (reg register-name))

    Instructions to use the stack were introduced in section [*]:

    (save register-name)
    
    

    (restore register-name)

    The only kind of constant-value we have seen so far is a number, but later we will use strings, symbols, and lists. For example, (const "abc") is the string "abc", (const abc) is the symbol abc, (const (a b c)) is the list (a b c), and (const ()) is the empty list.


    Previous: Using a Stack to Implement Recursion Next: A Register-Machine Simulator

      webmaster@arsdigita.org