en:docs:macrolib

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

Note: osFree Macro Library provides macros for most of functions

2022/04/10 06:34 · prokushev · 0 Comments

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.

MACROS.INC

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