Clemson University -- CPSC 231 -- Fall 2009 binding - assignment of name, value, or other attribute to an object object +------+ .-----. | name |---->< value > the name can be symbolic, binary address, ... +------+ `-----' the value can be text, binary value, ... naming - resolution: what size unit is assigned a name - bit, byte, word, block? - range: how many different objects can you name? - order: binary numbers are ordered, add offset to one to construct another - dimensionality: true segmentation uses two-dimensional names - homogeneity: array name is name of collection of homogeneous data, while struct/record name is name of collection of heterogeneous data - context-dependent name: abbreviated name must use some form of context to disambiguate (that is, to resolve the name among multiple objects) (note: context search rules called "scoping") - aliases: multiple names for same object - protection: do you associate access rights with names or with objects? (e.g., consider file system) binding type static binding - done once dynamic binding - done several times (dynamic binding of names usually requires a naming table) binding time - when done - e.g., compile time, run time early binding late binding, sometimes called lazy evaluation - done only when needed (e.g., "just-in-time" compiler) static, early binding - e.g., compile-time binding in a strongly-typed language, catch errors early, can execute efficiently dynamic, late binding - e.g., run-time binding in an interpretative language, flexible, easier to debug, but often slow static binding dynamic binding +-----------------------+-----------------------+ assemble time | symbol name to address| | +-----------------------+-----------------------+ link time | external addr. resol. | | | relocation | | +-----------------------+-----------------------+ load time | relocation | | +-----------------------+-----------------------+ run time | "dynamic" linking | value to mem location |\ dynamic (can be sub- | - is really a misnomer| parameter passing || assignment divided, e.g.| since binding done | I/O buffers |/ of value procedure- | at run time on first| | entry time) | call - this is lazy | choosing ISR (through |\ | evaluation | int. vect. table) || dynamic | | segmentation/paging || naming | | (thru seg/pg table) || (separate | | file system directory || name table) | | file index nodes |/ | | | | | linked list with dyn. |\ name table | | memory allocation |/ is in links +-----------------------+-----------------------+