This maps the most important of the ROM-BIOS variables and data areas.
All addresses are documented and should be valid in future BIOSes. The
map is sequential by memory address, with blank lines indicating rough
functional groups. Addresses not shown should be considered reserved.
Note: Although this table shows addresses as offsets from segment 40H,
it is valid to use offsets from absolute segment 00H. For
instance, a variable shown to be at address 40:0012 can also be
40:0000 2 Base port address of first RS-232 adapter (COM1) See COM Ports
40:0008 2 Base port addr of first parallel printer (LPT1) Printer Ports
40:0012 1 Errors in PCjr infrared keyboard link
40:0013 2 Total memory in K-bytes (same as obtained via INT 12H)
40:0015 2 Scratch pad for manufacturing error tests
40:0019 1 Current (accumulating) value of Alt+numpad pseudo-key input;
normally 0. When [Alt] is released, value is stored in
40:001a 2 Addr of keyboard buffer head (keystroke at that addr is next)
40:001c 2 Address of keyboard buffer tail
40:001e 32 Keyboard buffer. BIOS stores keystrokes here (head and tail
point to addresses from 041eH to 043dH inclusive).
40:003e 1 Diskette drive needs recalibration (bit 0=A, bit 1=B, etc.)
bits 4-5 indicate which drive is currently selected
40:003f 1 Diskette motor is running (bit 0=drive A, bit 1=B, etc.)
40:0040 1 Time until motor off. INT 08H turns motor off when this is 0.
40:0041 1 Diskette error status; same as status returned by INT 13H
40:0042 7 Diskette controller status information area
40:004a 2 Screen width in text columns
40:004c 2 Length (in bytes) of video area (regen size)
40:004e 2 Offset from video segment of active video memory page
40:0050 16 Cursor location (8 byte-pairs; low byte=clm, hi byte=row)
40:0060 2 Cursor size/shape. Low byte=end scan line; hi byte=start line.
40:0062 1 Current active video page number
40:0063 2 Port address for 6845 video controller chip; see CGA I/O Ports
40:0065 1 Current value of 6845 video ctrlr CRT_MODE (port 3x8H register)
40:0066 1 Current value of 6845 video ctrlr CRT_PALETTE (port 3x9H reg)
40:0067 5 Cassette data area or POST data area
40:006c 4 Timer tick counter (count of 55ms ticks since CPU reset)
40:0070 1 Timer overflow flag (timer has rolled over 24 hr)
40:0071 1 Ctrl-Break flag. Bit 7=1 when break was pressed. This never
gets reset unless you do it yourself.
40:0072 2 1234H means Ctrl+Alt+Del reboot is in progress. BIOS checks
this to avoid doing a "cold boot" with the time-consuming POST
4321H means reset, preserving memory
5678H, 9abcH, and abcdH (are internal PC Convertible codes)
40:0074 4 PCjr diskette or AT hard disk control area
(0074) 1 Status of last fixed-disk drive operation
(0075) 1 Number of hard disk drives for AT
40:0078 4 Printer time-out values (478H=Lpt1, 478H=Lpt2...)
40:007c 4 RS-232 time-out values (47cH=Com1, 47dH=Com2...)
40:0080 2 AT PS/2 keyboard buffer offset start address (usually 01eH)
40:0082 2 end address (usually 003eH)
40:0084 1 EGA text rows-1 (maximum valid row value)
40:0085 2 EGA bytes per character (scan-lines/char used in active mode)
40:008b 1 AT PS/2 Media control: data rate, step rate
40:008c 1 AT PS/2 Hard disk drive controller status
40:008d 1 AT PS/2 Hard disk drive error status
40:008e 1 AT PS/2 Hard disk drive interrupt control
40:0090 1 AT PS/2 Disk media state bits for drive 0
40:0092 1 AT PS/2 Disk operation started flag for drive 0
40:0094 1 AT PS/2 Present cylinder number for drive 0
40:0096 1 AT Keyboard flag bit 4=1 (10H) if 101-key keyboard is attached
40:0097 1 AT Keyboard flag for LED 'key lock' display
bits 0-2 are ScrollLock, NumLock, CapsLock
40:009c 4 AT Microseconds before user wait is done
40:00a0 1 AT User wait activity flag:
01H=busy, 80H=posted, 00H=acknowledged
40:00a1 7 AT Reserved for network adapters
40:00f0 16 (IAC) Inter-Aapplication Communication area. Programs may use
this area to store status, etc. Might get overwritten by
40:0100 1 Print-screen status:
00H=ok; 01H=printing; 0ffH=error while printing screen
40:0104 1 Phantom-floppy status; see also DOS fn 440eH
01H=drive A is acting as drive B.
40:0110 17 Used by BASIC interpreter
40:0130 3 Used by MODE command
f000:fff0 5 FAR JMP instruction to begin POST
(after a hard reset, the CPU jumps here)
f000:fff5 8 ROM-BIOS release date in ASCII (eg, "04/24/81" is original PC)
f000:fffe 1 IBM computer-type code; see also BIOS INT 15H C0H
0fcH = AT (or XT model 286) (or PS/2 Model 50/60)
0fbH = XT with 640K motherboard
0f9H = Convertible PC (easily converts into a paperweight)