home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-01-14 | 52.6 KB | 1,540 lines |
-
-
-
-
-
-
-
-
- LORITEC Software Presents
-
- A86-LIBRARY V2.0
-
- A library of routines
-
- For ISAACSON's assembler A86
-
- Written in assembler by
-
- Ollivier CIVIOL
- 415 South BROAD
- Phila, PA.19147
- (215) 732-7653
- [72727,3213]
-
-
-
-
-
-
-
- TABLE OF CONTENTS
- -----------------
-
-
-
-
-
- Introduction .......................................... I
- Description ....................................... I
- Registration ....................................... II
- Legal stuff ....................................... III
- order form ....................................... IV
- Chapter one .......................................... 1
- How to use the routines ........................... 1
- A86LIB .......................................... 3
- Error codes ....................................... 4-5
- Compatibility .....................................
- Parameters .......................................
-
-
-
-
- I
- INTRODUCTION
- ------------
-
-
-
-
-
- A86 Library is a library of routines written to work with
- A86.COM, Eric ISAACSON's macro assembler (The best on the market).
-
- If you do not have A86, first, you should get it, second,
- you will not be able to use this library with another assembler,
- without making some changes, because the library uses special
- features of A86's language, that do not exist with other assemblers.
-
- The library was written to work in the .COM environment.
- To use the routines in the .EXE environment, you will have to
- reset the DS register to your data segment, because when exiting,
- most of the routines set DS=CS.
- Make sure you define a big enough stack, (I would suggest at least
- 2 Kbyte of stack) because the routines are using the stack a lot.
-
- I tried to preserve the routines from using unnecessary memory
- variables, 2 bytes here, 2 bytes there and we got a program that does
- quite nothing and already is 25K.
- This is the reason why the routines uses the STACK a lot.
- The only memory variables I uses are 2 bytes, under the form: _saverxx
- Witch I use to save and retrieve the return address within the program.
-
- Some routines do not even use that, because they are safe enough
- to keep the return address in a register.
-
- Make sure that you save any register you want to preserve before calling
- the routine. All the routines assume that registers are saved, and do
- not save any registers.
-
-
-
- You can get A86 by sending $50.00 to
-
- Eric ISAACSON
- 416 E. University Ave.
- Bloomington, IN 47401-4739
-
- Make checks payable to himself.
-
- A86 is a trademark ISAACSON software (R)
-
- II
-
-
- REGISTRATION
- ------------
-
-
-
-
- The Shareware version you just got is not the same than
- the registered version. Registered users gets the routines
- That are marked in the description with an '*', and also
- the file A86.LIB which allow A86 to directly assemble the code
- of the routine whenever it finds an undefined symbol.
- With the Shareware version you will have to copy the
- code of the routine within your program.
-
- This is a user supported product. I tried to write this
- documentation so that there would not be a need of support at
- all, but I am still giving my phone number in case bugs are found
- or something remains unexplained in this doc.
-
- PLEASE PLEASE remember that I am on the EAST coast, so make sure
- that it is not 2:00 AM when you call me !
-
- Non registered users will get limited support, I don't think
- I have to tell you why. (isn't it obvious ?).
-
- The registration fee is $25.00. And include :
-
- - The latest version of the library.
- - A printed manual.
- - One upgrade.(When receiving it, you will have to send me $5.00
- to receive the next one and so on.)
-
-
- Please fill the registration form out and send it to me with you
- registration fee, make checks or money order payable to myself.
- Thank you for your support !!!.
-
- III
- LEGAL STUFF
- -----------
-
-
-
-
-
- This library of routines is copyright LORITEC software, 1988.
- You can distribute it, only if it is kept in it's original form.
- No changes has to be made to the routines, all files must be present
- in the arc file, NO FEE of any kind should be charged for the
- distribution of this package.
- Professional distribution may be allowed to distributors,
- an authorization letter must be obtained from me .
-
- There is no warranty of any kind associated with this software, and
- the copyright owner is not liable for damages of any kind.
-
- This is not a free software. This license allows you to use this
- software for a period of 30 days, if you intend of using this product
- you should then register. In order to include this software as part
- of any product, either commercial, Shareware, Freeware or public domain,
- registration is required.
- This library may not be included in any product for any use without
- registration. Any such use of my product is in violation of federal
- copyright laws and will be prosecuted.
-
-
-
- IV
-
-
-
-
-
-
- REGISTRATION FORM
- -----------------
-
-
-
-
-
-
-
- Quantity ............................................... ...
-
- Registration to A86LIBRARY ............................. $25.00
-
- Upgrades ......($5.00 each, one included)............... .....
-
- TOTAL .................................................. ......
-
-
-
- NAME (First,Last):................./....................
-
- ADDRESS: ..............................................
-
- ..............................................
- CITY,
- STATE,ZIP: ........................./........../.........
-
-
-
-
-
-
-
- CHAPTER 1 1
-
-
- HOW TO USE THE ROUTINES
- -----------------------
-
- For register users, there is nothing as simple as that.
- First make sure the environment variable A86LIB is set to the
- path where the files A86.LIB and the routines are.(SET A86LIB=C:\routin)
-
- Then write your code and when you want to use the routines, just
- push the required parameters on the stack and call the routine. When A86
- will see the undefined symbol, it will look in the file A86.LIB to see
- In what file the symbol is located, and assemble the code.
-
- IMPORTANT:
- All symbols in the routines start with the char '_', including the label
- you are going to call (see example).
-
- WHEN using a routine that requires the parameter [rowcol].
- MAKE sure you load the register bytes per bytes.
- EXAMPLE: if row 10 an col 9 is to be passed, code it this way :
-
- mov ah,10
- mov al,09
- push ax
- ------------------------------
-
- Non register users, will have to cut the routine, and paste it to
- your code, for A86 to assemble it. It will take longer, that is why
- you should register !!
-
- EXAMPLE:
-
- jmp main
- ;
- buffer db 'see how easy it is !'
- ;
- main:
- call _clear ;clear the screen
- ;
- mov ax,02 ;attribute for normal display
- push ax
- mov ax,0909 ;row 10, column 10
- push ax
- push cs ;data segment (IN .COM environment DS=CS)
- mov ax,offset buffer ;offset of buffer to print
- push ax
- mov ax,20 ;20 chars to print
- push ax
- call _text_wrt ;print the buffer at row 10 col 10.
- ;
- mov ax,0 ;code for get character
- push ax
- call _get_char
- pop ax ;get the character
- cmp al,27 ;<ESC> key
- if z call _exit ;yes exit
- jmp main
-
-
- 2
-
-
- When you are passing a string to a routine that uses DOS calls
- (most of them) make sure to terminate the string with a ZERO.
- (terminate with a value of zero not the character !!!)
-
- EXAMPLE:
-
- filename db 'a:command.com',0
-
- If you forget the zero DOS will return with an error code
- which will not be MISSING ZERO IN STRING since there is not
- such error code, but with FILE NOT FOUND or any other nonsense
- error code, since the filename specified would be correct !
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 3
-
-
-
-
-
-
- A86LIB
- ------
-
-
-
-
-
-
-
- A86LIB is a tool for registered users of A86. It is given to
- you by Eric ISAACSON whenever you register to A86.
-
- When A86 finds an undefined symbol, it looks in a file called
- A86.LIB for the symbol, if it finds it, assemble the code in the
- program. A86.LIB is created by A86LIB.
-
- If you are not a register user of A86, I provide the file
- A86.LIB along with the complete library when you register.
- I DO NOT PROVIDE YOU WITH THE LIBRARY MANAGER BUT WITH THE CREATED
- LIBRARY FILE.
-
- If you already have some routines, you would like to keep
- you will then have to get the library manager by registering to
- A86 an create a library with all of them.
-
- Anyway if you are using a Shareware software for more than
- 30 days, you should register. It is only fair to the author.
- It is because we trust you that Shareware is possible, so if you do
- not support us Shareware will die and you will certainly have to
- pay more than 25 or 30 dollars for a software that might not even
- be as good as what we would write, so don't let us down, please ...
-
-
-
-
-
-
-
-
-
-
-
-
- 4
-
- ERROR CODES
- -----------
-
-
- I also include an error code handling routine. Functions that
- Returns error codes will not call this routine directly. I did not
- Write them that way, because I thought that you might want to write
- your own routine.
-
- Anyway if you want my routine to handle, check for the error codes
- in your code.
- EXAMPLE for beginners:
-
- let say you called the routine _open to open a file that doesn't
- exist.
- after the routine returns you should check the carry flag
-
- .....
- jnc continue
- * pop ax ;* depends of the routine, sometimes it will not
- ; push the error code on the stack. Check the doc.
- cmp ax,... ;if you don't want to handle a specific error.
- jz continue
- push ax
- call _error
- continue:
- ....
-
- DO I MAKE MYSELF CLEAR ?????
-
-
- If you do not like the attribute I am using in the routine (reverse video)
- you can change it, I inserted a BIG comment line telling what and where
- to change it.
-
-
- 1......Invalid Function Number
- 2......File Not Found
- 3......Path Not Found
- 4......Too Many Open Files (no handles left)
- 5......Access Denied
- 6......Invalid Handle
- 7......Memory Control Blocks Destroyed
- 8......Insufficient Memory
- 9......Invalid Memory Block Address
- A......Invalid Environment
- B......Invalid Format
- C......Invalid Access Code
- D......Invalid Data
- E......Unknown unit
- F......Invalid Drive Was Specified
-
-
-
-
-
-
-
-
- 5
-
- 10......Attempted To Remove The Current Directory
- 11......Not Same Device
- 12......No More Files
- 13......Disk writ protected
- 14......Unknown unit
- 15......Drive not ready
- 16......Unknown command
- 17......Data error (CRC)
- 18......Bad request structure length
- 19......Seek error
- 1A......Unknown media type
- 1B......Sector not found
- 1C......Printer out of paper
- 1D......Write fault
- 1E......Read fault
- 1F......General failure
- 20......Sharing violation
- 21......Lock violation
- 22......Disk change invalid
- 23......FCB unavailable
- 24......Sharing buffer exceeded
- 25-31...RESERVED
- 32......Unsupported network request
- 33......Remote machine not listening
- 34......Duplicate name on network
- 35......Network not found
- 36......Network busy
- 37......Device no longer exists on network
- 38......NetBIOS command limit exceeded
- 39......error in network adapter hardware
- 3A......Incorrect response from network
- 3B......Unexpected network error
- 3C......Remote adapter incompatible
- 3D......Print queue full
- 3E......Queue not full
- 3F......Not enough room for print file
- 40......Network name deleted
- 41......Access denied
- 42......Incorrect network device type
- 43......Network name not found
- 44......Network name limit exceeded
- 45......NetBIOS session limit exceeded
- 46......Temporary pause
- 47......Network request not accepted
- 48......Print or disk redirection paused
- 49-4F...RESERVED
- 50......File already exists
- 51......RESERVED
- 52......Cannot make directory
- 53......Fail on int 24H (critical error)
- 54......Out of structures
- 55......Already assigned
- 56......Invalid password
- 57......Invalid parameter
- 58......Net write fault
- ------------------------------------------------------------------------------
-
- DISK STATUS CHART
- -----------------
-
- 00H No error.
- 01H Invalid command.
- 02H Address mark not found.
- 03H Disk write-protected. (F)
- 04H Sector not found.
- 05H Rest failed. (H)
- 06H Floppy disk removed. (F)
- 07H Bad parameter table. (H)
- 08H DMA overrun. (F)
- 09H DMA crossed 64 KB boundary.
- 0AH Bad sector flag. (H)
- 0BH Bad track flag. (H)
- 0CH Media type not found. (F)
- 0DH Invalid number of sectors on format. (H)
- 0EH Control data address mark detected. (H)
- 0FH DMA arbitration level out of range. (H)
- 10H Uncorrectable CRC or ECC data error.
- 11H ECC corrected data error (H)
- 20H Controller failed.
- 40H Seek failed.
- 80H Disk timedout (failed to respond).
- AAH Drive not ready. (H)
- BBH Undefined error. (H)
- CCH Write fault. (H)
- E0H Status register error. (H)
- FFH Sense operation failed. (H)
-
-
- H = Fixed disk only.
- F = Floppy disk only.
- CRC = Cyclic Redundancy Check code.
- ECC = Error Checking and Correcting code.
- ------------------------------------------------------------------------------
-
- ROUTINES INDEX
- --------------
-
- ATRB_WRT : Write screen attribute at given position.
- BEEP : Sounds a beep.
- * BELL : Sounds a beep at a given frequency.
- * BRK_PARM : Break parameters passed by DOS, with given break character.
- CHG_DIR : Change directory.
- CHG_DISK : Change disk.
- * CHG_MOD : Change file mode.
- CLEAR : Clear the screen.
- CLOSE : Close a file.
- * COPY : Copy a file.
- CREATE : Create a file.
- DELETE : Delete a file.
- DISK_INF : Information about specific drive.
- * ERSCURS : Erase the cursor.
- ERROR : Print error code on the screen.
- EXIT : Exit the application.
- FLUSH : Flush the keyboard input buffer.
- FORMAT_T : Format a track.
- * FORMAT_D : Disk format. (fixed disk only).
- FREE : Get amount of free space of specific drive.
- GET_CHAR : Get character, Check for character or Get shift status.
- GET_CURS : Get cursor position.
- GET_DATE : Get current date, (returns ASCII format.)
- GET_DIR : Get current directory.
- GET_DTA : Get Disk Transfer Area address.
- GET_INT : Get interrupt service routine address.
- GET_LINE : Buffered keyboard input.
- GET_MEM : Get amount of conventional memory.
- GET_PARM : Get the parameters passed by DOS.
- GET_TIME : Get current time (return ASCCII format.)
- INTOSB : Convert INTeger TO String with Base.
- MAKE_DIR : Make a new directory.
- * MEM_CHG : Change allocated memory block size.
- MOV_BYT : Move bytes from one buffer to another.
- MOV_PTR : Move file pointer.
- OPEN : Open a file.
- POPALL : Pop all registers.
- PRINTER : Output to the printer.
- PUSHALL : Push all registers.
- PUT_CHAR : Print character or character+attribute on the screen.
- READ : Read a file.
- READCHAR : Read a character from communication port.
- REBOOT : Reboot the system.
- RENAME : Rename a file.
- * REPLACE : Replace a string with another string.
- RMV_DIR : Remove directory.
- * RSTCURS : Restore cursor on video display.
- RST_SCRN : Restore video display buffer. (Use with SAV_SCRN).
- * RUN_PROG : Execute a program from within a program.
- SAV_SCRN : Save video display buffer.
- SCRN_TYP : Get type of screen.
- SCROLLDW : Scroll down the contenet of a window.
- SCROLLUP : Scroll up the content of a window.
- SENDCHAR : Send character to communication port.
- SET_CURS : Set cursor position.
- SET_DTA : Set address of new Disk Transfer Area.
- SETVIDEO : Set video mode.
- SET_INT : Set new interrupt service routine address.
- SET_PAGE : Set video display page.
- SRCH_FIL : Search for file.
- SRCH_NXT : Search for next file.
- * STR_SRCH : Search for a string into designated buffer.
- TEXT_RD : Read text on the screen to a buffer.
- TEXT_WRT : Write text on the screen. (uses direct screen handeling.)
- VER : Get DOS version.
- WRITE : Write to a file.
-
-
-
- ------------------------------------------------------------------------------
-
-
- ROUTINES DESCRIPTION
- --------------------
-
- -----------------------------------------------------------------------------
- ATRB_WRT.8 12/16/88
-
-
- DESC: Writes character attributes to the screen
- in: [position] row(0-24), col(0-79).
- [attribute] attribute ( see technical reference manual ).
- [chars] number of chars to be affected.
-
- ------------------------------------------------------------------------------
-
- ATRB_RD.8 01/12/89
-
- DESC: Read character attibute on the screen.
- in: [rowcol] Position on the screen.
-
- out: [AX] AH=attribute. AL=character.
-
- ------------------------------------------------------------------------------
-
-
- BEEP.8 12/14/88
-
-
-
- DESC: sound a beep
-
-
-
- ------------------------------------------------------------------------------
-
-
- BELL.8 1/05/89
-
- DESC: Sound a beep at a given frequency.
-
- in: [freq] frequency of the beep
-
-
- ------------------------------------------------------------------------------
- *
-
- BRK_PARM.8 12/16/88
-
-
- DESC: Break parameters passed by DOS
-
- in: [segment] segment address of parameter string
- [offset] offset address of parameter string(most of the time 082H)
- [break] break character (ASCII code) to use.
-
- out: [parms] number of parameters,
- [chars] followed by the length of a parameter
- [addrs] and its addresses in the string.
- (if parms=3, 'pop' 3 addresses, first parm first.)
-
- (i.e if your first 'pop' shows 2,
- your next pop will then get the number of chars of the first parameter,
- the next 'pop' will give you the address of the parameter, the next 'pop'
- will get the number of char of the second parameter folowed by its
- address in the string.
-
- SAMPLE:
- pop cx ;shows 2
- pop length1 ;length of parameter1
- pop add1 ;address of parameter1
- pop lenght2 ;length of parameter2
- pop add2 ;address of parameter2
-
-
-
- ------------------------------------------------------------------------------
-
- CHG_DIR.8 12/16/88
-
-
-
- DESC: change directory.
- in: [segment] segment address of ASCII path string.
- [offset] offset address of ASCII path string.
- terminated with 0.
-
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
-
- CHG_DISK.8 12/19/88
-
- DESC: select a new drive.
- in: [drive] drive code (0=A, 1=B ect)
-
- out: [drives] LOW BYTE = number of logical drives in system.
-
-
-
- ------------------------------------------------------------------------------
- *
-
- CHG_MOD.8 12/16/88
-
-
- DESC: Changes the mode of a file. (i.e: arc, hid, sys)
-
- in: [segment] segment address of ASCII filename.
- [offset] offset address of ASCII filename.
- [code] function code (1:set mode, 0:get mode)
- [attrb] mode of file (1:read only,2:hidden file,4:system file)
- (8:volume label,10H:sub-directory,20H:archived file)
-
- " The attribute is bit-mapped !! i.e read only and sys is attrb=5 "
-
- out: [mode] new file mode.
-
- IF ERROR CARRY FLAG IS SET
- AND ERROR CODE IS IN AX
-
-
- ------------------------------------------------------------------------------
-
-
-
- CLEAR.8 12/15/88
-
-
-
- DESC: Clears the screen
-
-
- ------------------------------------------------------------------------------
-
-
-
- CLOSE.8 12/16/88
-
-
- DESC: Closes a file handle
-
- in: [handle] handle of file to be closed, (passed by _open).
-
- IF ERROR THE CARRY FLAG IS SET.
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
- *
-
- COPY.8 12/16/88
-
- DESC: Copies existing file to new or existing file
- using complete path names
-
- in:
- [segment] segment address of new filename.
- [offset] offset address of new filename.
- [segment] segment address of old filename.
- [offset] offset address of old filename.
- out:
- [code] if [code]=0FFH successful, otherwise [code]=error code.
-
-
- ------------------------------------------------------------------------------
-
- CREATE.8 12/16/88
-
-
- DESC: Creates a new data file
- in: [segment] segment address of filename (ASCII).
- [offset] offset address of filename to be created.
- [mode] attribute or mode of file.( as listed (in CHG_MOD)command
-
- out: [handle] handle of file created.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
- ------------------------------------------------------------------------------
-
- DELETE.8 12/16/88
-
- DESC: Deletes a file V1.00
- in: [segment] segment address of filename (ASCII).
- [offset] offset address of filename to be deleted.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
- ------------------------------------------------------------------------------
-
- DISK_INF.8 01/10/89
-
- DESC: Get information about specific drive.
- in: [code] 0=default, 1=A, 2=B etc.)
-
- out: [AL] Sectors per cluster.
- [BL] ID byte. (see codes)
- [CX] Size of physical sector (in bytes)
- [DX] Number of clusters
- If function is unsuccesfull [AL] = FFH
-
- Id codes:
- F0H= 3.5 inch double-sided, 18 sectors or "other"
- F8H= Fixed disk.
- F9H= 5.25 inch double-sided, 15 sectors
- or 3.5 inch double-sided, 9 sectors.
- FCH= 5.25 inch single-sided, 9 sectors.
- FDH= 5.25 inch double-sided, 9 sectors.
- FEH= 5.25 inch single-sided, 8 sectors.
- FFH= 5.25 inch double-sided, 8 sectors.
-
- ------------------------------------------------------------------------------
-
- ERROR.8 12/17/88
-
- DESC: print an error message on the screen.
-
- in: [code] error code
-
- ------------------------------------------------------------------------------
-
- ERSCURS.8 1/05/89
-
- DESC: Erase the cursor from the video display.
-
-
- ------------------------------------------------------------------------------
-
- EXIT.8 12/16/88
-
-
- DESC: exit the program.
-
- ------------------------------------------------------------------------------
-
- FLUSH.8 01/10/89
-
- DESC: Flush the input keyboard buffer.
-
- ------------------------------------------------------------------------------
- FORMAT_T.8 01/10/89
-
- DESC: Format a track.
-
- in: [interleave] Only for fixed disks. (still push it if floppys !!)
- [cylinder] Cylinder to start at.
- [head] What head to use.
- [bytes] Code for number of bytes per sector
- ( 00H = 128 bytes. )
- ( 01H = 256 bytes. )
- ( 02H = 512 bytes. )
- ( 03H = 1024 bytes.)
- [drive] Drive number (00H-7FH for floppys. )
- (80H-FFH for Fixed disks.)
- [code] Floppy disk code (if fixed disk FFH)
- (01H = 320/360 KB disk in 360 KB drive)
- (02H = 320/360 KB disk in 1.2 MB drive)
- (03H = 1.2 MB disk in 1.2 MB drive)
- (04H = 720 KB disk in 720 KB drive)
-
- ------------------------------------------------------------------------------
- *
- FORMAT_D.8 01/15/89
-
- DESC: Fixed disk format.
-
- in: [interleave] Interleave desired (1-16)
- [track] Cylinder number to start at
- [drive] Fixed disk (80H-FFH)
-
- out: If unsuccessfull carry flag is set AH has status code, see chart.
-
- ------------------------------------------------------------------------------
-
- FREE.8 01/10/89
-
- DESC: Get free disk space.
-
- in: [drive] Drive code (0=default, 1=a etc...)
-
- out: [free] Amount of space in Kbytes.
- If error AX=0FFFFH
- [DX:CX] Amount of space in bytes (double word)
- not on stack !!!!
- ------------------------------------------------------------------------------
-
- GET_CHAR.8 12/16/88
-
-
- DESC: gets a character from the keyboard
-
- in: [type] 0:get char, 1:check for char, 2:shift status
-
- out: [AX] high byte is shift status, low byte is char.
-
- ------------------------------------------------------------------------------
-
-
- GET_CURS.8 12/16/88
-
-
- DESC: Gets Cursor Position
-
- IN: [page] (0-7) in 40 character mode
- or (0-3) in 80 character mode (i.e. 0003) is page 4
- OUT: [row,col] row (0-24), col (0-79) (i.e. 0104)
- 1st row, 5th column
-
- ------------------------------------------------------------------------------
-
-
- GET_DATE.8 12/16/88
-
- DESC: Gets the system date
-
- OUT: [offset] offset address of date string.
- The sting is under the form 'Monday 12 10 1988'
-
-
- ------------------------------------------------------------------------------
-
- GET_DISK.8 01/10/89
-
- DESC: Get current disk.
-
- in: noting.
-
- out: [drive] drive code (0=A, 1=B, 2=C ect.)
-
- ------------------------------------------------------------------------------
-
- GET_DIR.8 12/16/88
-
-
-
- DESC: get current directory.
- in: [segment] segment address of 64 byte buffer.
- [offset] offset address of 64 byte buffer.
- [drive] drive code (0=default, 1=A, 2=B etc)
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
-
-
- GET_DTA.8 12/16/88
-
- DESC: returns the disk transfer address
- out: [segment] segment address of DTA (Disk Transfer Area).
- [offset] offset address of DTA.
-
-
- ------------------------------------------------------------------------------
-
- GET_INT.8 01/10/89
-
-
- DESC: Get interrupt vector address.
-
- in: [int] Interrupt number.
-
- out: [segment] Segment address of interrupt service routine.
- [offset] Offset address of interrupt service routine.
-
- ------------------------------------------------------------------------------
-
- GET_LINE.8 12/16/88
-
- DESC: gets a line of text from the keyboard
-
- in: [chars] number of chars to get.
- if <CR> is pressed, the input is aborted.
-
- out: [chars] amount of chars read. ( <CR> INCLUDED !!!! )
- you can access the buffer by using the label [KEYBUF]
-
-
- ------------------------------------------------------------------------------
-
- GET_MEM.8 01/15/89
-
- DESC: Get ammount of conventional memory.
-
- in: nothing ...
-
- out: [memory] Amount of memory in KB.
-
- -------------------------------------------------------------------------------
-
-
- GET_PARM.8 12/16/88
-
-
- DESC: Gets the parameters passed to program by DOS
- in: [DS] value of DS at beginning of program.
-
- out: [segment] segment address of parameters.
- [offset] offset address of parameter string.
- [length] length of parameter string.
-
- if returned lenght is zero no further action should be
- taken.
-
-
- ------------------------------------------------------------------------------
-
- GET_TIME.8 12/16/88
-
-
- DESC: Gets the system time
- OUT: [offset] offset address of time string.
- The string is under the form '00:00:.00 '
-
-
- ------------------------------------------------------------------------------
-
- INTOSB.8 12/14/88
-
- DESC: Convert Unsigned "NUMB" to Unsigned "STRING"
-
- in: [number] number to convert.
- [offset] offset address of string.
- [base] the base you want to convert to.
- (HEXA=16,DECIMAL=10,OCTAL=8 ect...)
-
- sample: mov bx,number
- push bx
- mov bx,offset string
- push bx
- mov bx,base
- push bx
- mov al,3
- call _intosb
- add sp,6
-
-
- ------------------------------------------------------------------------------
-
-
- MAKE_DIR.8 12/16/88
-
- DESC: create a new directory.
- in: [segment] segment address of ASCII path string.
- [offset] offset address of ASCII path string.
- terminated with 0.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
- *
- MEM_CHG.8 12/16/88
-
- DESC: Modifies Allocated memory block size.
-
- in: [block] segment address of memory block to be modified.
- [size] new block size in paragraphs (i.e multiples of 16 bytes).
-
- IF ERROR CARRY FLAG IS SET
- ERROR CODE IS IN AX
- MAXIMUM BLOCK SIZE AVAILABLE IN BX
-
- ------------------------------------------------------------------------------
-
-
- MOV_BYT.8 12/16/88
-
-
- DESC: move bytes from one buffer to another.
-
- in: [segment] segment address of source.
- [offset] offset address of source.
- [length] length of string.
- [segment] segment address of output buffer.
- [offset] offset address of output buffer.
-
- ------------------------------------------------------------------------------
-
-
- MOV_PTR.8 12/16/88
-
- DESC: Moves the file location pointer.
-
- in: [code] Method code.
- 0: absolute offset from start of file
- 1: signed offset from current file pointer
- 2: signed offset from end of file
- [handle] File handle.
- [segment] Most significant half of offset.
- [offset] Least significant half of offset.
-
- out: [segment] Most significant word of pointer location.
- [offset] Least significant word of pointer location.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
-
- OPEN.8 12/16/88
-
- DESC: Opens a file
-
- in: [segment] segment address of filename (ASCII)
- [offset] offset address of filename (ASCII)
- [access] access code (0:read,1:write,2:read write)
- out: [handle] handle of file, (needed to close it).
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
-
-
- POPALL.8 12/15/88
-
- DESC: Pop all registers (SI,DI,BP,ES,DS,DX,CX,BX,AX)
-
-
- ------------------------------------------------------------------------------
-
-
- PRINTER.8 12/16/88
-
-
- DESC: Send a character to the printer.
- in: [char] character to print.
- [port] printer number (0=lpt1, 1=lpt2, 2=lpt3)
-
- out: [AH] status.
-
- bit Significance (if set)
- 7 printer not busy
- 6 printer acknowledge
- 5 out of paper
- 4 printer selected
- 3 I/O error
- 2 unused
- 1 unused
- 0 printer timed-out
-
- REMEMBER : before the device actually print, a carriage return
- must be send. Unless you are sending more characters
- than it can fit on one line, then the printer will
- automatically print
-
- ------------------------------------------------------------------------------
-
- PUSHALL.8 12/15/88
-
- DESC: Push all registers (AX,BX,CX,DX,DS,ES,BP,DI,SI)
-
- ------------------------------------------------------------------------------
-
- PUT_CHAR.8 12/16/88
-
- DESC: Print a single char on the screen.
-
- in: [char] character and attribute.if char only set High byte to 0.
- [page] current display page
- [mode] mode of writing (0:char only, 1:char+attribute)
-
- ------------------------------------------------------------------------------
-
- PUT_STR.8 01/10/89
-
- DESC: Print string on the screen.
-
- in: [segment] Segment address of string terminated with '$'.
- [offset] Offset address of string terminated with '$'.
-
- ------------------------------------------------------------------------------
-
- READ.8 12/16/88
-
- DESC: Reads data from a file
- in: [handle] handle of the file.
- [bytes] number of bytes to read from file.
- [segment] segment address of buffer.
- [offset] offset address of buffer.
-
- out: [bytes] number of bytes actually read.
-
- IF ERROR CARRY FLAG IS SET
- AND ERROR CODE IS ON THE STACK
-
- ------------------------------------------------------------------------------
-
- READCHAR.8 01/10/89
-
-
- DESC: read a char from com port.
-
- in: [port] Com port number.(0=com1, 1=com2 etc.)
-
- out: [AL] Character.
- [AH] Bit 0 to 6 = Status. (significance if set)
- 4 break detected
- 3 framing error detected
- 2 parity error detected
- 1 overrun error detected
-
- [BX] If successfuff BX=0, unsuccessfull BX=FFH
-
- ------------------------------------------------------------------------------
-
- REBOOT.8 01/10/89
-
- DESC: Reboot the system.
-
- ------------------------------------------------------------------------------
-
- RENAME.8 12/16/88
-
- DESC: rename a file, or move file to another directory.
- in: [oldseg] segment address of current ASCII pathname.
- [oldoff] offset address of current ASCII pathname.
- terminated with 0.
- [newseg] segment address of new ASCII pathname.
- [newoff] offset address of new ASCII pathname.
- terminated with 0.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
- *
-
- REPLACE.8 12/16/88
-
-
- DESC: Replaces a string with another string.
-
- in: [segment] segment address of replacement string.
- [offset] offset address of replacement string.
- [direction] direction of search (0:forward,1:backward)
- [segment] segment address of buffer to scan.
- [offset] offset address of buffer to scan.
- [segment] Segment address of string to search for.
- [offset] Offset address of string to search for.
- [chars] Number of chars in string searched.
- [length] Length of buffer to scan.
-
- out: [offset] offset address where replacement took place.
-
- IF replacement failed [segment] and [offset] are both zero
- ------------------------------------------------------------------------------
-
-
- RMV_DIR.8 12/16/88
-
- DESC: remove a directory.
- in: [segment] segment address of ASCII path string.
- [offset] offset address of ASCII path string.
- terminated with 0.
-
- IF ERROR CARRY FLAG IS SET
- AX HAS THE ERROR CODE
-
-
- ------------------------------------------------------------------------------
-
- RSTCURS.8 1/05/89
-
- DESC: Restore the cursor to the video display.
-
- ------------------------------------------------------------------------------
-
- RST_SCRN.8 12/16/88
-
- DESC: Restores 4K screen to video memory
- in: [segment] segment address of 4K buffer.
- [offset] offset address of 4K buffer.
-
- ------------------------------------------------------------------------------
- *
-
- RUN_PROG.8 12/16/88
-
-
- DESC: Loads and Executes another program
- in: [segment] Segment address of filename.
- [offset] Offset address of filename to run including extension.
- [segment] segment address and
- [offset] Offset address of pointer to command line to be passed
- to new program. Command line should be in the form :
- z,' ',parameter,13 where z is the length of parameter+1,
- and is followed by a space. " Parameter " is the command
- line and 13 is a carriage return ending the line.
- [block] Segment value of last memory control block.
- " block " is typically the value of DS at start of main
- program.
- [size] Size of current program.
-
- IF ERROR CARRY FLAG IS SET
- AND AX HAS THE ERROR CODE
-
- ------------------------------------------------------------------------------
-
-
- SAV_SCRN.8 12/16/88
-
-
- DESC: Saves 4K screen from video memory
- in: [segment] segment address of 4K buffer.
- [offset] offset address of 4K buffer.
-
-
- ------------------------------------------------------------------------------
-
-
- SCRN_TYP.8 12/16/88
-
- DESC: Returns the address of the video memory buffer
-
- out: [segment] segment address of video memory area.
-
-
- ------------------------------------------------------------------------------
-
- SCROLLDW.8 01/10/89
-
-
- DESC: Scroll down the contents of a window.
-
- in: [lines] Number of lines to scroll, if 00 window is blanked.
- [colrow] High byte column, low byte row : upper left corner.
- [colrow] High byte column, low byte row : lower right corner.
-
- ------------------------------------------------------------------------------
-
- SCROLLUP.8 01/10/89
-
-
- DESC: Scroll up the contents of a window.
-
- in: [lines] Number of lines to scroll, if 00 window is blanked.
- [colrow] High byte column, low byte row : upper left corner.
- [colrow] High byte column, low byte row : lower right corner.
-
- ------------------------------------------------------------------------------
-
- SET_DTA.8 12/16/88
-
-
- DESC: sets the disk transfer address
- in: [segment] segment address of DTA.
- [offset] offset address of DTA.
-
- ------------------------------------------------------------------------------
-
- SETVIDEO.8 12/16/88
-
- DESC: set video mode
-
- in: [mode]
- text/ MDA CGA PCjr EGA MCGA VGA
- mode resolution colors graphics
- ---- ---------- ------ --------
- 00H 40 by 25 16 text x x x x x
- color burst-off
- 01H 40 by 25 16 text x x x x x
- 02H 80 by 25 16 text x x x x x
- color burst-off
- 03H 80 by 25 16 text x x x x x
- 04H 320 by 200 4 graphics x x x x x
- 05H 320 by 200 4 graphics x x x x x
- color burst-off
- 06H 640 by 200 2 graphics x x x x x
- 07H 80 by 25 2* text x x x
- 08H 160 by 200 16 graphics x
- 09H 320 by 200 16 graphics x
- 0AH 640 by 200 4 graphics x
- 0BH RESERVED
- 0CH RESERVED
- 0DH 320 by 200 16 graphics x x
- 0EH 640 by 200 16 graphics x x
- 0FH 640 by 350 2* graphics x x
- 10H 640 by 350 4 graphics #
- 10H 640 by 350 16 graphics $ x
- 11H 640 by 480 2 graphics x x
- 12H 640 by 480 16 graphics x
- 13H 320 by 200 256 graphics x x
-
- * monochrome monitor only
- # EGA with 64 KB of RAM
- $ EGA with 128 KB of RAM
-
- When a composite monitor is present function offering:
- "color burst-off" should be used.
-
- ------------------------------------------------------------------------------
-
- SET_CURS.8 12/16/88
-
- DESC: Sets Cursor Position
- in: [row col] row(0-24), col(0-79)
- [page] display page.
-
-
- ------------------------------------------------------------------------------
-
- SET_INT.8 01/10/89
-
-
- DESC: Set interrupt verctor address.
-
- in: [int] Interrupt number.
- [segment] Segment address of new interrupt service routine.
- [offset] Offset address of new interrupt service routine.
-
- Remember to save the original address of the interrupt service
- routine, before assigning a new address.
-
- ------------------------------------------------------------------------------
-
- SET_PAGE.8 12/16/88
-
-
- DESC: set video display page
-
- in: [page]
-
- 0-7 for modes 00H and 01H (CGA,EGA,MCGA,VGA)
- 0-3 for modes 02H and 03H (CGA)
- 0-7 for modes 02H and 03H (EGA,MCGA,VGA)
- 0-7 for mode 07H (EGA,VGA)
- 0-7 for mode 0DH (EGA,VGA)
- 0-3 for mode 0EH (EGA,VGA)
- 0-1 for mode 0FH (EGA,VGA)
- 0-1 for mode 10H (EGA,VGA)
-
- ------------------------------------------------------------------------------
-
- SRCH_FIL.8 12/16/88
-
- DESC: search for the first file of a set of matching filenames.
-
-
- in: [segment] segment address of search string.
- [offset] offset address of search string.
- [attrib] file attribute to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,
- 10H:sub-directory,20H:archived file).
- out:
- [segment] segment address of DTA.
- [offset] offset address of DTA.
- [flags] FLAGS . IF CARRY FLAG SET ERROR !!!!
- if carry flag set, [segment] and [offset] have the error code
-
- ------------------------------------------------------------------------------
-
- SRCH_NXT.8 12/16/88
-
-
- DESC: search for the next of a set of matching filenames.
-
- in: [segment] segment address of search string.
- [offset] offset address of search string.
- [attrib] file attribute to search on (1:read only,2:hidden file,
- 4:system file,8:volume label,
- 10H:sub-directory,20H:archived file).
- out:
- [segment] segment address of DTA.
- [offset] offset address of DTA.
- [flags] FLAGS . IF CARRY FLAG SET ERROR !!!!
- if carry flag set, [segment] and [offset] have the error code
-
- ------------------------------------------------------------------------------
- *
-
- STR_SRCH.8 12/16/88
-
-
- DESC: Scans a source buffer for matching string
- and returns location of beginning and end of string
-
- in: [direction] 0:forward, 1:backward
- [segment] segment address of buffer to scan.
- [offset] offset address of buffer to scan.
- [segment] segment address of string to search for.
- [offset] offset address of sting to search for.
- [chars] number of chars in string.
- [length] length of buffer up to 0FFFF. (number of characters)
- out: [offbeg] offset beginning of string.
- [offend] offset end of string.
-
- IF A VALUE OF '0FFFF' IS RETURNED FOR BOTH [offbeg] AND
- [offend], THEN STRING WAS NOT FOUND !!!!!!!!!!!
-
-
- ------------------------------------------------------------------------------
-
-
- TEXT_RD.8 12/16/88
-
- DESC: Reads text from the screen
-
- in: [rowcol] row(0-24), col(0-79) to start reading at ;ax
- [chars] number of chars to read ;cx
- [segment] segment address of buffer ;es
- [offset] offset address of buffer ;di
-
-
-
- ------------------------------------------------------------------------------
-
-
- TEXT_WRT.8 12/16/88
-
- DESC: Writes text to screen
-
- in: [attribute] attribute for the text ;dx
- [rowcol] row(0-24), col(0-79) to start writing at. ;ax
- [segment] segment address of the buffer ;ds
- [offset] offset address of the buffer ;si
- [chars] numbers of char to write ;cx
-
-
- ------------------------------------------------------------------------------
-
- VER.8 01/10/89
-
-
- DESC: Get current DOS version.
-
- in: nothing ..
-
- out: [ver] Version number (320, 310, 311 etc .)
-
- ------------------------------------------------------------------------------
-
- WRITE.8 12/16/88
-
-
- DESC: Writes to a data file
- in: [handle] handle of the file.
- [bytes] number of bytes to write
- [segment] segment address of buffer.
- [offset] offset address of buffer.
-
- out: [bytes] number of bytes actually written.
-
- IF ERROR CARRY FLAG IS SET
- AND ERROR CODE IS ON THE STACK
- ------------------------------------------------------------------------------
-