Note: This library for DOS/Win16 personality only. Use Family API for portability.

Note: osFree Macro Library provides macros for most of functions

osFree Macro Library

Introduction

ALP/MASM compatible macro library for BIOS and DOS. Original MASM provides macros for BIOS and DOS interrupts as well as OS/2 and Windows macros. osFree Macro Library is a open source replacement of MASM macros. osFree macro library is for Microsoft MASM, IBM MASM, IBM ALP, JWASM and other MASM compatible assemblers. It has more type check and some BIOS bugs workaround. At the present time BIOS and DOS APIs are supported.

This library based on IBM 5150 Technical Reference #6322507 of Apr 1984, MACRO.DOC from MASM 5.x, Ralf Brown Interrupt list.

Functions, found in later BIOSes mostly not covered, but can be added in future. Main goal of osFree Macro Library is to provide support for Family API development. Macro names mostly constructed from MASM 5.x, MASM 6.x and ALP documentation.

Using macros

osFree Macro Library consist of BIOS.INC, MOUSE.INC, DPMI.INC and DOS.INC. To use macros just include BIOS.INC, DOS.INC, MOUSE.INC, DPMI.INC or all. For example:

INCLUDE BIOS.INC @SetPage ; Set default video page (zero page)

Files

osFree Macro Library provides four include files:

BIOS.INC

DOS.INC

MOUSE.INC

DPMI.INC

MACROS.INC

MACROS.INC contains generic macros. BIOS.INC contains macros for BIOS interrupts. DOS.INC contains macros for DOS interrupts. MOUSE.INC contains macros for MOUSE interrupts. DPMI.INC contains macros for DPMI interrupts.

BIOS.INC

Macro	Description
@SetMode	Set current video mode
@SetCurSz/@SetCsrSize	Set cursor size
@SetCurPos/@SetCsrPos	Set cursor position
@GetCur/@GetCsr	Get cursor shape and position
@SetPage	Set active video page
@ScrollUp	Scroll screen area up
@ScrollDn	Scroll screen area down
@Scroll	Scroll sreen area up or down
@GetChAtr	Get char and attribute from screen
@PutChAtr	Put char and attribute to screen
@PutCh	Put char to screen
@SetPalet	Set pallete
@SetColor	Set border color
@SetDot	Set pixel dot on screen
@GetDot	Get pixel dot from screen
@WrtTTY	Write char in TTY mode
@VideoState	Get video state
@GetMode	Get video mode
@GetDisplay	Get display info
@GetVideoState	Get extended video state
@GetEGAInfo	Get EGA information
@Cls	Clear screen
@AuxInit	Initialize serial port
@AuxSendChar	Send char to serial port
@AuxRecieveChar	Recieve char from serial port
@AuxStatus	Get serial port status
@PrnPrint	Print char to printer
@PrnInit	Initialize printer
@PrnStatus	Get printer status
@KbdStatus	Get keyboard status
@CharIn	Input char from keyboard
@CharPeek	Peek char from keyboard buffer
@SetTime	Set time tick
@GetTime	Get time tick
@TapeOn	Turn tape motor on
@TapeOff	Turn tape motor off
@TapeRead	Read block from tape
@TapeWrite	Write block to tape
@Equipment	Get equipment list
@MemSize	Get memory size
@DskReset	Reset disk system
@DskStatus	Get last disk operation status
@DskRead	Read sector
@DskWrite	Write sector
@DskVerify	Verify sector
@DskFormat	Format track

DOS.INC

Macro	Description
TERMINATE
FLUSH
FILE_UNLOCK
ABS_DISK_READ
ABS_DISK_WRITE
STAY_RESIDENT
TERMINATE_PROGRAM
READ_KBD_AND_ECHO
DISPLAY_CHAR
@DispCh
AUX_INPUT
AUX_OUTPUT
PRINT_CHAR
@PrtCh
DIR_CONSOLE_IO
DIR_CONSOLE_INPUT
READ_KBD
DISPLAY
@DispStr
GET_STRING
@GetStr
CHECK_KBD_STATUS
FLUSH_AND_READ_KBD
RESET_DISK
LFN_RESET_DISK
SELECT_DISK
@SetDrv
OPEN
CLOSE
SEARCH_FIRST
SEARCH_NEXT
DELETE
READ_SEQ
WRITE_SEQ
CREATE
RENAME
CURRENT_DISK
@GetDrv
SET_DTA
@SetDTA
DEF_DRIVE_DATA
DRIVE_DATA
READ_RAN
WRITE_RAN
FILE_SIZE
SET_RELATIVE_RECORD
SET_VECTOR
@SetInt
CREATE_PSP
RAN_BLOCK_READ
RAN_BLOCK_WRITE
PARSE
GET_DATE
@GetDate
SET_DATE
@SetDate
GET_TIME
@GetTime
SET_TIME
@SetTime
VERIFY
GET_DTA
@GetDTA
GET_VERSION
@GetVer
KEEP_PROCESS
@TSR
CTRL_C_CK
GET_VECTOR
@GetInt
GET_DISK_SPACE
@ChkDrv
GET_COUNTRY
GET_UPPERCASE_TABLE
SET_COUNTRY
MAKE_DIR
@MkDir
LFN_MAKE_DIR
REM_DIR
@RmDir
LFN_REM_DIR
CHANGE_DIR
@ChDir
LFN_CHANGE_DIR
CREATE_HANDLE
@MakFil
OPEN_HANDLE
@OpenFil
CLOSE_HANDLE
@ClosFil
READ_HANDLE
@Read
WRITE_HANDLE
@Write
DELETE_ENTRY
@DelFil
LFN_DELETE_ENTRY
MOVE_PTR
@MovePtrAbs
@MovePtrRel
@GetFilSz
CHANGE_MODE
LFN_CHANGE_MODE
IOCTL_DATA
IOCTL_CHAR
IOCTL_STATUS
IOCTL_STATUS
IOCTL_CHANGE
IOCTL_RBLOCK
IOCTL_RHANDLE
IOCTL_RETRY
GENERIC_IOCTL_HANDLES
GENERIC_IOCTL_BLOCK
IOCTL_GET_DRIVE_MAP
IOCTL_SET_DRIVE_MAP
XDUP
XDUP2
GET_DIR
@GetDir
ALLOCATE_MEMORY
@GetBlok
FREE_MEMORY
@FreeBlok
SET_BLOCK	Set memory block size
@ModBlok	Modify memory block
EXEC
EXEC_OVL
@Exec
@Exit
END_PROCESS
RET_CODE
@GetRet
FIND_FIRST_FILE
@GetFirst
FIND_NEXT_FILE
@GetNext
GET_VERIFY
RENAME_FILE
@MoveFil
LFN_RENAME_FILE
GET_SET_DATE_TIME
ALLOC_STRAT
GET_ERROR
CREATE_TEMP
CREATE_NEW
LOCK_FILE
UNLOCK
GET_MACHINE_NAME
PRINTER_SETUP
GET_LIST
REDIR
CANCEL_REDIR
GET_PSP
DISPLAY_ASCIZ
MOVE_STRING
CONVERT
CONVERT_TO_BINARY
CONVERT_DATE
PACK_DATE
@GetKey

MOUSE.INC

Macro	Description
@MouInit	Init driver
@MouShowPointer	Show Mouse Cursor
@MouStatus	Mouse Cursor Status
@MouSetPos	Set Mouse Cursor Position
@MouSetMickey	Set Mouse Mickey/Pixel ratio
@MouRegion	Mouse Cursor Region

DPMI.INC

Macro	Description
@DPMI_AllocDesc
@DPMI_FreeDesc
@DPMI_Seg2Desc
@DPMI_GetIncValue
@DPMI_LockSel
@DPMI_UnlockSel
@DPMI_GetBase
@DPMI_SetBase
@DPMI_SetLimit
@DPMI_SetAccRights
@DPMI_CreateCSAlias
@DPMI_GetDescriptor
@DPMI_SetDescriptor
@DPMI_DOSALLOC
@DPMI_DOSFREE
@DPMI_GetRMIntVec
@DPMI_SetRMIntVec
@DPMI_GetExcVec
@DPMI_SetExcVec
@DPMI_GetPMIntVec
@DPMI_SetPMIntVec
@DPMI_SimRMInt
@DPMI_CallRMFarProc
@DPMI_CallRMIRProc
@DPMI_AllocRMCallback
@DPMI_FreeRMCallback
@DPMI_GETRMSA
@DPMI_GETVERSION
@DPMI_GETFREEMEMINFO
@DPMI_ALLOCMEM
@DPMI_FREEMEM
@DPMI_GETPAGESIZE
@DPMI_MAPPHYS
IBM PC BIOS API
Video I/O	INT 10H: 00H, 01H, 02H, 03H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0CH, 0DH, 0EH, 0FH
Hardware info	INT 11H, INT 12H
Serial I/O	INT 14H: 00H, 01H, 02H, 03H
Tape I/O	INT 15H: 00H, 01H, 02H, 03H
Keyboard I/O	INT 16H: 00H, 01H, 02H
Printer I/O	INT 17H: 00H, 01H, 02H
Disk I/O	INT 13H: 00H, 01H, 02H, 03H, 04H, 05H
Date and Time	INT 1AH: 00H, 01H
osFree Macro Library
Video I/O	@SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls
Hardware info	@Equipment @MemSize
Serial I/O	@AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus
Tape I/O	@TapeOn @TapeOff @TapeRead @TapeWrite
Keyboard I/O	@KbdStatus @CharIn @CharPeek
Printer I/O	@PrnPrint @PrnInit @PrnStatus
Disk I/O	@DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat
Date and Time	@SetTime @GetTime
Mouse	@MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion
Memory manager	@ModBlok SET_BLOCK