(original) (raw)

# 03jan20abu # (c) Software Lab. Alexander Burger ### Primary data types ### cnt xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxS010 big xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxS100 sym xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1000 pair xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0000 Bignum | V +-----+-----+ | DIG | | | +-----+--+--+ | V +-----+-----+ | DIG | | | +-----+--+--+ | V +-----+-----+ | DIG | CNT | +-----+-----+ Pair | V +-----+-----+ | CAR | CDR | +-----+-----+ Symbol | V +-----+-----+ +-----+-----+ | | | VAL | |'cba'|'fed'| +--+--+-----+ +-----+-----+ | tail ^ | | V | name +-----+-----+ +-----+-----+ +-----+--+--+ | | | ---+---> | KEY | ---+---> | | | | | +--+--+-----+ +-----+-----+ +--+--+-----+ | | V V +-----+-----+ +-----+-----+ | VAL | KEY | | VAL | KEY | +-----+-----+ +-----+-----+ NIL: / | V +-----+-----+-----+-----+ |'LIN'| / | / | / | +-----+--+--+-----+-----+ Symbol tail Internal/Transient 0010 Short name 0100 Long name 0000 Properties External 1010 Short name 1000 Properties Name final short Internals, Transients 0000.xxxxxxx.xxxxxxx.xxxxxxx.xxxxxxx.xxxxxxx.xxxxxxx.xxxxxxx0010 60 52 44 36 28 20 12 4 Externals 42 bit Object (4 Tera objects) 16 bit File (64 K files) 2 bit Status Loaded 01........ Dirty 10........ Deleted 11........ 1+2 Bytes: 1 file, 64K objects {177777} 1+3 Bytes: 16 files, 1M objects {O3777777} 1+4 Bytes: 256 files, 16M objects {OO77777777} 1+5 Bytes: 256 files, 4G objects {OO37777777777} 1+6 Bytes: 65536 files, 4G objects {OOOO37777777777} 1+8 Bytes: 65536 files, 4T objects {OOOO77777777777777} (2 + 10 + 8 + 12 + 8 + 20) xx.xxxxxxxxx.xxxxxxx.xxxxxxxxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxE010 obj file obj file obj ^6 ^5 ^4 ^3 ^2 ### Heap ### Heaps, Avail | | +-----------------------+ | | | V | V +--+--+-----+-----+-----+-----+-----+--- ---+-----+-----+-----+ | | | | | / | | ... | | | | | +-----+-----+-----+-----+-----+-----+--- ---+--+--+-----+-----+ | | | +-----> Heaps | +-----> Avail ### Stack ### Saved values: ^ | +---> LINK ----+ | val1 | val2 | ... | valN +---- LINK <-- L Bind frame: ^ [exe] | Bind | +---> LINK ----+ | [@] | @ | val1 | sym1 | ... | valN | symN +---- LINK <-- L <-- Bind eswp VarArgs frame: ^ [exe] | Bind | +---> LINK ----+ | [@] | @ | val1 | sym1 | ... | valN | symN +---- LINK <---+ <-- Bind eswp | Args | +---> LINK ----+ <-- Next | arg1 | ... | argN <-- Args +---- LINK <-- L Next Apply args: ^ | +---> LINK ----+ | ... | fun <-- Y | arg1 | ... | argN <-- Z | ... +---- LINK <-- L Apply frame: ^ Apply | +---> LINK ----+ | ... | valN <-+ (gc) | zero | | NIL | (gc) | carN --+ <-+ | ... | | val1 <-+ | (gc) | zero | | | cdr1 --|---+ (gc) | +-> car1 --+ | +-- cdr (gc) | fun <-- exe +---- LINK <-- L <-- Apply Catch frame: ^ X | Y | Z | L | [env] | fin | tag | LINK ----+ <-- Catch I/O frame: ^ put/get | pid | fd | LINK ----+ <-- InFrames, OutFrames, ErrFrames, CtlFrames Coroutine frame: ^ X | Y | Z | +---> LINK | | [@] | +---- L | [env] | seg -----|-----------------+ lim | | LINK ----+ <-- Co7 | | | Stack segment: <--------------+ <-I> tag # Tag <-II> stk # Stack pointer --+ [env] # Environment | Stack ... | X | Y | Z | +---> LINK | [@] | +---- L <-----------------------+ ### Memory ### inFile: --> fd # File descriptor ix # Read index cnt # Buffer count next # Next character line # Line number src # Source line number name # Filename buf # Buffer [BUFSIZ] outFile: --> fd # File descriptor ix # Write index tty # TTY flag buf # Buffer [BUFSIZ] child: --> pid # Process ID hear # Pipe read end tell # Pipe write end ofs # Buffer offset cnt # Buffer count buf # Buffer pointer +--------------------------+ Mic | | +-----------------+ Tell | | | +-----------------> Hear | | | | Spkr <---+ | | | | | | +-----------------+ Tell | | | +-----------------> Hear | +--------------------------+ Mic ### Database file ### +-------------+-+-------------+-+----+ Block 0: | Free 0| Next 0| << | +-------------+-+-------------+-+----+ 0 BLK 2*Blk+1 +-------------+-+ Free: | Link 0| +-------------+-+ 0 +-------------+-+---- ID-Block: | Link 1| Data +-------------+-+---- 0 BLK +-------------+-+---- EXT-Block: | Link n| Data +-------------+-+---- 0 BLK dbFile: # Size VIII (64 bytes) --> fd # File descriptor db # File number sh # Block shift siz # Block size (64 << sh) flgs # Flags: Lock(0), Dirty(1) marks # Mark vector size mark # Mark bit vector fluse # Free list use count ### Assumptions ### - 8 bit per byte - 64 bit per word - Stack grows downwards, aligned to 64 bit - Memory access legal also at 4-byte boundaries