How MS-DOS 6.22 MORE Command Manages Screen Scrolling
In MS-DOS 6.22, the MORE utility manages screen
scrolling by functioning as a console filter that captures standard
input, monitors output line counts against the current display height,
and temporarily halts the execution stream when the screen fills. By
default, it presents text 24 lines at a time, displays a prompt, and
waits for a user keystroke before flushing the buffer and presenting the
next block of data.
Input Redirection and Temporary Files
The MORE command operates on standard input
(STDIN), which it receives either via input redirection
(such as MORE < FILENAME.TXT) or through an
inter-process pipe (such as TYPE FILENAME.TXT | MORE).
Because MS-DOS is a single-tasking operating system without native
asynchronous piping, piping output into MORE requires
disk-based intermediate storage. When a pipe (|) is used,
MS-DOS 6.22 redirects the upstream command's output into a temporary
file written to the directory specified by the TEMP or
TMP environment variable (or the root directory of the
current drive if neither is set). Once the first program finishes
writing this temporary file, DOS invokes MORE.COM to read
from it sequentially.
Line Counting and Screen Detection
Once MORE.COM begins reading the text stream, it
monitors the byte sequence for newline characters—specifically Carriage
Return and Line Feed pairs (CR/LF, ASCII 0Dh
and 0Ah).
- Screen Height Determination: Standard MS-DOS text
mode displays 25 rows and 80 columns.
MOREqueries the display state using BIOS interrupts (specificallyINT 10h) or checks the BIOS Data Area (BDA memory address0040:0084h, which stores the screen row count minus one). If the system uses an EGA or VGA display with a non-standard text mode (such as 43 or 50 lines configured viaMODE CON: LINES=n),MOREadapts its page boundary to the active screen height. - Line Counting:
MOREincrements an internal line counter each time a line feed character passes through, or whenever text exceeds 80 characters without a newline, causing an automatic hardware wrap. - Threshold Trigger: To ensure the screen does not
scroll prematurely,
MOREstops sending data when the line count reaches one less than the maximum visible rows (line 24 on a standard 25-line screen).
The Pause and Keyboard Interrupt
When the line threshold is reached, MORE.COM temporarily
suspends output and manages user intervention:
- The Prompt: The command writes the string
-- More --to standard output without an ending newline, placing the message directly on the 25th row. - Input Blocking: The program halts execution and
waits for user interaction by calling an MS-DOS keyboard interrupt
(typically
INT 21h, Function 08hor07hfor direct console input without echo). This avoids cluttering the screen with whatever key the user strikes to resume. - Screen Refresh: Upon receiving a keystroke,
MOREwrites backspace and space characters to erase the-- More --string, resets its internal line counter to zero, and resumes reading the input stream to deliver the next page.
End-of-File Handling
MORE.COM continues this cycle until it encounters an
End-of-File indicator (either an ASCII 1Ah /
Ctrl+Z character or the physical end of the input stream).
Once the entire stream is exhausted, the command terminates immediately
without pausing, control returns to COMMAND.COM, and any
temporary files created during piping are deleted by the operating
system.