Next: , Previous: , Up: Design of CMU Common Lisp   [Contents]


31 Writing Assembly Code

VOP writers expect:

MOVE

You write when you port the assembler.)

EMIT-LABEL

Assembler interface like INST. Takes a label you made and says “stick it here.”

GEN-LABEL

Returns a new label suitable for use with EMIT-LABEL exactly once and for referencing as often as necessary.

INST

Recognizes and dispatches to instructions you defined for assembler.

ALIGN

This takes the number of zero bits you want in the low end of the address of the next instruction.

ASSEMBLE
ASSEMBLE-ELSEWHERE

Get ready for assembling stuff. Takes a VOP and arbitrary PROGN-style body. Wrap these around instruction emission code announcing the first pass of our assembler.

CURRENT-NFP-TN

This returns a TN for the NFP if the caller uses the number stack, or nil.

SB-ALLOCATED-SIZE

This returns the size of some storage base used by the currently compiling component.

...

;;; ;;; VOP idioms ;;;

STORE-STACK-TN
LOAD-STACK-TN

These move a value from a register to the control stack, or from the control stack to a register. They take care of checking the TN types, modifying offsets according to the address units per word, etc.