kristofer sweger Home
ANSIPLUS Home


Installation Check and Interrupt 2Fh API

ANSIPLUS responds to the Interrupt 2Fh test for ANSI.sys installation. When Int 2Fh is called with AX=1A00h, ANSIPLUS will return AL=0FFh to indicate that ANSI.sys is installed.

Besides responding to the MS-DOS ANSI.sys Int 2Fh functions, the ANSIPLUS driver also supports several Int 2Fh calls of its own, which provide infrequently needed or special functions that programmers and the ANSIPLUS utility programs may need, but that general users will not need. This application program interface (or "API") currently includes functions for detecting the presence and version number of the ANSIPLUS driver, reporting on the status of the ANSIPLUS driver, disabling or enabling the driver or certain driver features, accessing screen lines saved for scroll-back, accessing the clipboard, controlling the screen saver blanking time, key repeat rate or smooth scrolling rate, loading the VGA/EGA character generator without affecting colors, and emulating 4DOS/NDOS key stacking.

The descriptions following document each current ANSIPLUS Interrupt 2Fh call. Each description gives the ANSIPLUS driver versions that support the call, reason for the function, register arguments, and returned result registers:

1A00h ANSIPLUS Installation Check
1A01h ANSI.sys Get/Set Display Information
1A02h ANSI.sys Miscellaneous Requests
1AA3h Get/Set ANSIPLUS Internal Variables
1AA4h Get/Set ANSIPLUS Smooth Scrolling Rate
1AA5h Get/Set ANSIPLUS Clipboard
1AA6h Enable/Disable ANSIPLUS Driver
1AA7h Enable/Disable ANSIPLUS Features
1AA8h Get Next ANSIPLUS Scrollback Line
1AA9h Get ANSIPLUS Scrollback Information
1AAAh ANSIPLUS Screen Saver Blanking Time
1AABh Set ANSIPLUS Key Repeat Rate
1AACh ANSIPLUS Load Character Generator
1AADh ANSIPLUS Device Status Report
D44Fh Emulate 4DOS Keystack
E44Fh Emulate NDOS Keystack

AX=1A00h: ANSIPLUS Installation Check

Version: 2.00 or later
Purpose: Provide emulation of the MS-DOS ANSI.sys installation check, with an extension to identify ANSIPLUS. The Int 29h segment returned by this function is used by ANSIPLUS utility programs to access variables within the running ANSIPLUS driver.
Arguments: AX = 1A00h
BX = "AN" (414Eh)
CX = "SI" (5349h)
DX = "++" (2B2Bh)
Results: AL = 0
CH = major ANSIPLUS version number (3.10 or later)
CL = minor ANSIPLUS version number (3.10 or later)
DL = 00h for full capability driver (4.00 or later)
      = 01h for reduced capability driver (4.00 or later)
      = 2Bh full capability driver (before 4.00)
      = other: reserved for future use
ES:BX = ANSIPLUS Int 29h entry point

If the BX, CX and DX arguments do not all match the magic values above, then BX, CX , DL and ES will not be altered on return.

CX was not returned for driver versions before 3.10, so register CX will return 5349h for the earlier versions. The minor version number returned in CL is coded as two hexadecimal nibbles. Thus, for Release 3.10, CL will return 10h.

A further installation confirmation can be made by checking the 8 bytes at ES:[BX-12] for the string "ANSIPLUS". The ANSIPLUS version number will be a 4 character string at ES:[BX-4], containing, for example, "4.03".

AX=1A01h: ANSI.sys Get/Set Display Information

Version: 2.00 or later
Purpose: Emulate the ANSI.sys get/set display information function, which is called by the MS-DOS MODE program.
Arguments: AX = 1A01h
CL = 5Fh to set display information
      = 7Fh to get display information
DS:DX = address of generic IOCTL parameter block as for Int 21h, AX=440Ch, CX=035Fh or 037Fh. (This block is called the "DISPLAYMODE" structure in Microsoft’s MS-DOS Programmer’s Reference.)
Results: CF clear if successful
CF set if error, AX = error code

AX=1A02h: ANSI.sys Miscellaneous Requests

Version: 2.00 or later
Purpose: Emulates the ANSI.sys miscellaneous requests function. These requests are really not supported by or relevant to ANSIPLUS, so when this function is called by MS-DOS it really does nothing useful.
Arguments: AX = 1A02h
DS:DX = parameter block
Results: CF clear if successful
CF set if error, AX = error code

AX=1AA3h: Get/Set ANSIPLUS Internal Variables

Version: 4.03 or later
Purpose: Get or set certain ANSIPLUS internal variables directly with a simple call from an application, without using escape sequences.
Arguments: AX = 1AA3h
BH = 0: Get the current and default colors
      = 1: Set the current and default colors
      = 2: Get the current subscreen region
      = 3: Set the subscreen region
      = 4: Get driver feature bits 0-31
      = 5: Set driver feature bits 0-31
      = 6: Get driver feature bits 32-63
      = 7: Set driver feature bits 32-63
      = 8: Get virtual environment and DOS type (4.07 or later)
      = other: currently ignored, but reserved for expansion
CX = default (CH) and current (CL) colors for BH=1. If CH is zero, only the current foreground/background will be set
      = top left row (CH) and column (CL) of subscreen region (BH=3)
      = driver feature bits 0-15 (BH=5)
      = driver feature bits 32-47 (BH=7)
DX = bottom right row (DH) and column (DL) of subscreen region (BH=3)
      = driver feature bits 16-31 (BH=5)
      = driver feature bits 48-63 (BH=7)
Results: BX = true screen total rows and cols (BH=2)
CX = default (CH) and current (CL) colors (BH=0)
      = top left row (CH) and column (CL) of subscreen region (BH=2)
      = driver feature bits 0-15 (BH=4)
      = driver feature bits 32-47 (BH=6)
      = DOS major (CH) and minor (CL) version (BH=8)
DX = bottom right row(DH) and column (DL) of subscreen region (BH=2)
      = driver feature bits 16-31 (BH=4)
      = driver feature bits 48-63 (BH=6)
BH = virtual environment (for argument BH = 8 only):
      0 = no virtual environment detected
      1 = Windows 3.x enhanced mode
      2 = Windows 9x
      3 = Windows NT/2K/XP
      4 = Windows Vista+
      5 = OS/2
      6 = DOSEMU
      7 = DOSBOX
      8 = VMware
      9 = VirtualPC
      10 = VirtualBox
      11 = QEMU
      12 = Bochs
      13 = Parallels
BL = DOS type (for argument BH = 8 only):
      0 = true MS-DOS
      1 = FreeDOS
      2 = Windows NT/2K/XP
      3 = Windows 3.x or 9x
      4 = DR-DOS
      5 = OS/2
      6 = DESQview
      7 = DOS Shell

AX=1AA4h: Get/Set ANSIPLUS Smooth Scrolling Rate

Version: 4.02 or later
Purpose: Provides a way to interrogate or change the ANSIPLUS smooth scrolling rate.
Arguments: AX = 1AA4h
BL = 0 to get the current smooth scrolling rate
      = 1 to set the smooth scrolling rate
BH = new smooth scrolling rate in scan lines per retrace (if BL = 1).
Results: BH = current smooth scrolling rate

AX=1AA5h: Get/Set ANSIPLUS Clipboard

Version: 4.00 or later
Purpose: Provide access to the ANSIPLUS clipboard for utility programs and applications.
Arguments: AX = 1AA5h
DH = subfunction code:
      = 0: get clipboard information
      = 1: get clipboard text
      = 2: set clipboard text
      = 3: append text to clipboard
      = 4: clear clipboard
      = 5: paste clipboard to keyboard
ES:BX = pointer to data area to receive data (subfunction 1) or to source of data (subfunctions 2 and 3)
CX = size of area to receive data (subfunction 1) or number of bytes to add to clipboard (subfunctions 2 and 3)
Results: AL = 0 if successful
      = 1 if subfunction not supported (reduced capability driver)
      = 2 if insufficient space for requested data transfer
      = other (0A5h): not supported by driver (version before 4.00)
ES:BX = pointer to the ANSIPLUS local clipboard data
CX = number of bytes currently in the ANSIPLUS local clipboard
DX = total capacity of the ANSIPLUS local clipboard

AX=1AA6h: Enable/Disable ANSIPLUS Driver

Version: 4.00 or later
Purpose: If a second copy of ANSIPLUS is installed as a TSR when another is already running, the first copy’s system interrupt hooks must be disabled or both drivers will assume they have control over the keyboard and other system interrupts, resulting in conflicts. Whenever an ANSIPLUS driver is installed on top of another, it will first issue an Int 2Fh, AX=1AA6h call to disable the previously installed ANSIPLUS driver. Multiple ANSIPLUS drivers are generally not installed, but this can be the case, for example, under DESQview if ANSIPLUS was installed before DESQview was started, and then an ANSIPLUS driver is loaded in a DESQview window so that the window can use the features of ANSIPLUS.
Arguments: AX = 1AA6h
BH = 0 to get the current ANSIPLUS hooked interrupts mask
      = 1 to set the ANSIPLUS interrupts mask
      = other: currently ignored, but reserved for expansion
BL = new ANSIPLUS interrupts mask for BH=1
Results: BL = current ANSIPLUS interrupts mask

ANSIPLUS interrupts mask

Bit 0 = Int 09h key events
     1 = Int 10h video
     2 = Int 15h system services
     3 = Int 16h keyboard input
     4 = Int 1Ch user timer tick
     5 = Reset all bits if Int 29h is ever called
     6 = Int 29h DOS fast TTY output
     7 = Int 33h, 74h, or other mouse event

A bit value of 1 means the interrupt is disabled (ignored by the driver), and zero means it is enabled (used by the driver). For bit 5, a value of 1 means that the entire mask will be reset to zero if the Int 29h entry point is ever called, which indicates that the driver is the one currently being used by DOS, so it should be enabled.

Only the first (newest) ANSIPLUS driver on the Int 2Fh chain will respond to this call.

AX=1AA7h: Enable/Disable ANSIPLUS Features

Version: 3.10 or later
Purpose: Provides a "back door" method for an application or utility program to control ANSIPLUS features independent of settings made by escape sequences. Currently, this function can temporarily disable addition of lines to scroll-back, as might occur when the screen is cleared, etc., without affecting any other ANSIPLUS feature settings or capabilities. The ANSIPLUS utility programs do this to keep their menus from being added to scroll-back. Effective with Release 4.00, this function also can lock key reassignment and key stacking in a disabled state as a defense against "ANSI bombs" that might contain ANSIPLUS escape sequences to re-enable those features.
Arguments: AX = 1AA7h
BL = 0 to prevent scroll-back saves
      = 1 to allow scroll-back saves
      = 2 to disable key reprogramming and lock changes by escape sequence
      = 3 to allow control of key reprogramming by escape sequence
      = 4 to disable and lock key stacking by escape sequence
      = 5 to allow key stacking by escape sequence
Results: none

AX=1AA8h: Get Next ANSIPLUS Scrollback Line

Version: 3.10 or later
Purpose: Retrieve lines from the scroll-back store in order from the oldest to the newest (see also Int 2Fh, AX=1AA9h).
Arguments: AX = 1AA8h
Results: AL = 0 if successful
      = 1 if an unsupported video mode is active
      = 2 if the screen is currently scrolled back
      = 3 if unsupported because of reduced capability driver
      = other value (0A8h) if unsupported function (before 3.10)
ES:BX = pointer to the screen line (characters and attributes)
CX = line length in bytes
      = 0 if no line or an unsupported video mode

AX=1AA9h: Get ANSIPLUS Scrollback Information

Version: 3.10 or later
Purpose: Provides a way to get at the lines currently saved for scroll-back. Also initializes the Get Next Scrollback Line function (see Int 2Fh, AX=1AA8h).
Arguments: AX = 1AA9h
Results: AL = 0 if successful
      = 1 if an unsupported video mode is active
      = 2 if the screen currently is scrolled back
      = 3 if unsupported because of reduced capability driver
      = other value (0A9h) if unsupported function (before 3.10)
BX = number of lines currently in the scrollback store
CX = number of bytes needed for each returned line

AX=1AAAh: ANSIPLUS Screen Saver Blanking Time

Version: 3.01 or later
Purpose: Provides a way to interrogate or change the ANSIPLUS screen saver blanking time.
Arguments: AX = 1AAAh
BX = 0FFFFh to get blanking time
      = any other value to set blanking time
CX = blanking time in timer ticks (if BX is not 0FFFFh).

The blanking time must be in the range 1..7FFFh, which corresponds to a period of up to 30 minutes.

Results: BX = current blanking time
CX = blanking time when last set

BX and CX are unchanged if the function is not supported

AX=1AABh: Set ANSIPLUS Key Repeat Rate

Version: 3.01 or later
Purpose: Provides a way to change the ANSIPLUS key repeat rate.
Arguments: AX = 1AABh
BX = repeat rate in characters per second
      = 0 to use the BIOS (keyboard controller) repeat rate.
Results: None

AX=1AACh: ANSIPLUS Load Character Generator

Version: 3.00 or later
Purpose: Provides a direct way to load the VGA/EGA character generator that bypasses the existing video BIOS. When the Int 10h load character generator function is called, video BIOSes have the side effect of resetting the display mode, which will reload the OEM color palette. By calling this function instead of Int 10h with AX=1100h, the character table can be changed rapidly without resetting the display mode or affecting current colors. All register arguments are identical to Int 10h/AX=1100h, except for AX, which must be 1AACh.
Arguments: AX = 1AACh
BH = number of bytes per character pattern
BL = VGA/EGA character table to load
CX = number of characters to load (1-256)
DX = starting character code (offset into map 2 block)
ES:BP = address of user table to load
Results: AX = 1100h

All other registers unchanged

AX=1AADh: ANSIPLUS Device Status Report

Version: 2.00 or later
Purpose: Provides direct access to the ANSIPLUS device status report that is independent of device redirection and does not require input and parsing of returned parameters from the keyboard input stream.
Arguments: AX = 1AADh
BL = report request code, equal to the ANSIPLUS Esc [#n parameter. The
acceptable range for the Release 4.03 driver is thus 129..150. See Table 5-11 for the list of ANSIPLUS status query selectors.
CX = color selector or key code, if applicable for the request
Results: AX = first reported result
BX = second result
CX = third result (if applicable, otherwise unchanged)
DX = fourth result (if applicable, otherwise unchanged)

AX=D44Fh: Emulate 4DOS Keystack

Version: 3.01 or later
Purpose: Allow addition of keys and delays to the keystroke buffer to emulate the 4DOS KSTACK.com TSR interface. See also Int 2Fh, AX=E44Fh.
Arguments: AX = D44Fh
BX = 0 for installation check
      = 1 to add keys to the keystroke buffer
CX = character count (for BX=1)
DS:DX = pointer to char/scan codes to add (for BX=1)
Results: AX = 44DDh (for BX=0)

No returned results if BX=1

Each word in the table pointed to by DS:DX is one of:

Keys are added to the end of the ANSIPLUS key input buffer, up to the configured capacity of the buffer. If the buffer becomes full, any extra stacked keys will be lost. Each key stacking call adds to the buffer, even if the buffer already contained stacked keys. An enhanced keyboard is required.

AX=E44Fh: Emulate NDOS Keystack

Version: 3.01 or later
Purpose: Allow addition of keys and delays to the keystroke buffer to emulate the NDOS key KSTACK.com TSR interface. See also Int 2Fh, AX=D44Fh.
Arguments: AX = E44Fh
BX = 0 for installation check
      = 1 to add keys to the keystroke buffer
CX = character count (for BX=1)
DS:DX = pointer to char/scan codes to add (for BX=1)
Results: AX = 44EEh (for BX=0)

No returned results if BX=1


© Copyright 2000-2010, Kristofer Sweger. All rights reserved.
Rev. 5/07/19