From "The Art of Computer Programming"
🎧 Listen to Summary
Free 10-min PreviewMIX Input/Output, Utility, and Conversion Operations
Key Insight
MIX includes miscellaneous utility operators such as shift commands (C=6), which shift bytes left or right in rA (SLA, SRA) or across the combined rA and rX registers (SLAX, SRAX, SLC, SRC), with M specifying the number of bytes to shift. Linear shifts introduce zeros, while circular shifts wrap bytes from one end to the other, all without affecting register signs. The MOVE instruction (C=7) transfers a number of words (specified by F) from location M to the address in rI1, incrementing rI1 by F, and handles potential data overlap. Basic program control is provided by NOP (C=0) for no operation and HLT (C=5, F=2) to halt machine execution.
The input-output system supports various optional devices, each with a unit number (0-20) and a fixed block size, such as punched cards (unit 0, 16 words), magnetic tapes (units 2-5, 100 words), and a line printer (unit 18, 16 words). For units 16-20, I/O is character-code based, where each byte represents one alphameric character, allowing five characters per MIX word. The character set includes codes 00 for blank, 01-29 for letters, and 30-39 for digits, with input setting word signs to positive and output ignoring them.
Key I/O operators include IN (input, C=36, F=unit) and OUT (output, C=37, F=unit), which initiate asynchronous block data transfers between memory (starting at M) and the specified unit; the machine waits if the unit is busy, and operations complete at an unknown future time. IOC (input-output control, C=35, F=unit) performs control functions like rewinding magnetic tape (M=0), skipping tape blocks (M<0 or M>0), positioning disk/drum units based on rX, or advancing a line printer to a new page. Conditional jump instructions, JRED (jump ready, C=38, F=unit) and JBUS (jump busy, C=34, F=unit), allow programs to check I/O unit status. Additionally, conversion operators NUM (C=5, F=0) transform 10-byte character code from rAX into a numeric value in rA, while CHAR (C=5, F=1) converts a numeric value in rA into a 10-byte character code across rAX.
📚 Continue Your Learning Journey — No Payment Required
Access the complete The Art of Computer Programming summary with audio narration, key takeaways, and actionable insights from Donald E. Knuth.