Dec 122017
 
A large collection of memory routines in Assembly. Real good.
File COREAIDS.ZIP from The Programmer’s Corner in
Category Assembly Language
A large collection of memory routines in Assembly. Real good.
File Name File Size Zip Size Zip Type
ALOC_CHG.ASM 902 470 deflated
ATRB_WRT.ASM 2268 1086 deflated
CALLM.MAC 167 103 deflated
CHAR_GET.ASM 771 409 deflated
CHG_DIR.ASM 821 425 deflated
CHG_MOD.ASM 1211 582 deflated
CLEAR.ASM 524 270 deflated
CLOSE.ASM 693 356 deflated
COPY.ASM 2768 1058 deflated
COREAIDS.DOC 47445 7226 deflated
CREATE.ASM 1009 499 deflated
CURS_GET.ASM 938 494 deflated
CURS_SET.ASM 883 454 deflated
DATE_GET.ASM 1482 625 deflated
DELETE.ASM 822 403 deflated
DIR_FILE.ASM 6379 1986 deflated
DIR_FILE.EXE 13640 3192 deflated
ERRORMSG.ASM 5589 1907 deflated
EXECUTE.ASM 2336 1042 deflated
FILEDATE.ASM 1891 770 deflated
FILE_MOD.ASM 4680 1586 deflated
FILE_MOD.EXE 47673 2976 deflated
GET_DIR.ASM 1038 527 deflated
GET_DSK.ASM 679 360 deflated
GET_TEXT.ASM 1333 651 deflated
HELP.ASM 3269 1334 deflated
HEXDSPLY.ASM 1855 691 deflated
HEX_ASC.ASM 3724 1571 deflated
MASM-FMT.DOC 1808 789 deflated
MOVE_BYT.ASM 912 432 deflated
MOV_PTR.ASM 1195 536 deflated
MULT_EXE.ASM 3710 1333 deflated
MULT_EXE.EXE 7225 2698 deflated
OPEN.ASM 967 477 deflated
PARM_BRK.ASM 1843 896 deflated
PARM_GET.ASM 1127 543 deflated
POPALL.ASM 1190 543 deflated
PROC 5561 1182 deflated
PROC.BAK 18432 6850 deflated
PROC.LIB 18432 6846 deflated
PUSHALL.ASM 1277 550 deflated
READ.ASM 1008 492 deflated
REPLACE.ASM 1640 732 deflated
SCAN_BYT.ASM 2716 1073 deflated
SCRN_RST.ASM 780 414 deflated
SCRN_SAV.ASM 834 438 deflated
SCRN_TYP.ASM 899 490 deflated
SEARCH.ASM 2078 897 deflated
SET_DSK.ASM 681 354 deflated
SRCH_FIL.ASM 2791 1169 deflated
SRCH_NXT.ASM 2791 1172 deflated
SRCH_PRE.ASM 2440 1106 deflated
SRCH_VOL.ASM 1483 666 deflated
STK_STOP.ASM 685 349 deflated
STK_STRT.ASM 742 359 deflated
TEXT_RD.ASM 2204 1029 deflated
TEXT_WRT.ASM 3181 1279 deflated
TIME_GET.ASM 1546 665 deflated
TPCREAD.ME 199 165 deflated
WRITE.ASM 995 478 deflated

Download File COREAIDS.ZIP Here

Contents of the COREAIDS.DOC file


CoreAids Macro Assembler Subroutine Library Utilities
Copyright 1987, CoreTechs

You are free to use, copy and distribute CoreAids providing that:
NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
IT IS NOT MODIFIED IN ANY WAY.

These subroutines are provided AS IS without any warranty,
expressed or implied, including but not limited to fitness for a
particular purpose.

Please send comments, suggestions and contributions to:

CoreTechs
P.O. Box 6207
Silver Spring, MD 20906

SECTION I. ROUTINES LISTED ALPHABETICALLY

ALOC_CHG.ASM 6/25/87 902
DESC: Modifies Allocated memory block size V1.00
IN: *{BLOCK} segment address of memory block to be modified
*{PARA} new requested block size in paragraphs {ie multiples
of 16 bytes}
SAMPLE: Callm ALOC_CHG,,

ATRB_WRT.ASM 6/25/87 2268
DESC: Writes character attributes to the screen V1.00
IN: *{PAGE} page number (0-3) 4 available pages in 80 column mode
*{ROWCOL} row(0-24),col(0-79) (ie 0345 indicating fourth row,
46th column)
*{ATRB} attribute (see technical reference manual for
information on color graphics adapter)
*{NUM_CHARS} # of chars to be affected
SAMPLE: Callm ATRB_WRT,,

CHAR_GET.ASM 6/25/87 771
DESC: gets a character from the keyboard V1.00
IN: *{REQ_TYPE} (0:get character,1:see if character
is there,2:get shift status)
OUT: *{CHAR} character ( high byte is shift status,
low byte is char.)
SAMPLE: Callm CHAR_GET,,

CHG_DIR.ASM 6/25/87 821
DESC: Changes to a new directory using the path provided V1.00
IN: *{SEG_VAL} segment and
*{OFFSET} offset of path string
SAMPLE: Callm CHG_DIR,,

CHG_MOD.ASM 6/25/87 1211
DESC: Changes the mode of a file V1.00
(ie archived, hidden, system)
IN: *{SEG_VAL} segment and
*{OFFSET} offset of filename
*{FUNC_CODE} function code(1:set mode,0:get mode)
*{FILE_MODE} mode of file (1:read only,2:hidden file,
4:system file,8:volume label,10H:sub-directory,
20H:archived file
OUT: *{CMODE} mode of file after completions of call
SAMPLE: Callm CHG_MOD,,

CLEAR.ASM 6/25/87 524
DESC: Clears the screen V1.00
SAMPLE: Callm CLEAR,,

CLOSE.ASM 6/25/87 693
DESC: Closes a file handle V1.00
IN: *{INHNDL} handle of file to be closed
SAMPLE: Callm CLOSE,,

COPY.ASM 6/25/87 2768
DESC: Copies existing file to new or existing file V1.00
using complete path names
IN: *{OUT_SEG_VAL} segment and
*{OUT_OFFSET} offset of new filename
*{IN_SEG_VAL} segment and
*{IN_OFFSET} offset of old filename
SAMPLE: Callm COPY,,

CREATE.ASM 6/25/87 1009
DESC: Creates a new data file V1.00
IN: *{SEG_VAL} segment and
*{OFFSET} offset of filename to be created as ASCIIZ string
*{ATRB} attribute or mode of file as listed in CHG_MOD
command
OUT: *{OUTHNDL} handle of file created
SAMPLE: Callm CREATE,,


CURS_GET.ASM 6/25/87 938
DESC: Gets Cursor Position V1.00
IN: *{PAGE_NUM} page number (0-7) in 40 character mode
or (0-3) in 80 character mode (i.e. 0003) is page 4
OUT: *{ROWCOL} row (0-24),col (0-79) (i.e. 0104)
1st row, 5th column
*{CURS_MODE} cursor mode (see manual for description)
SAMPLE: Callm CURS_GET,,

CURS_SET.ASM 6/25/87 883
DESC: Sets Cursor Position V1.01
IN: *{ROWCOL} row and column to postion cursor
row (0-24),col (0-79) (i.e. 0104)
1st row, 5th column
*{PAGE_NUM} page number (0-7) in 40 character mode and (0-3)
in 80 character mode (i.e. 0003) is page 4
SAMPLE: Callm CURS_SET,,

DATE_GET.ASM 6/25/87 1482
DESC: Gets the system date V1.00
OUT: *{SEG_VAL} segment and
*{OFFSET} offset of system date in format MM/DD/YY
SAMPLE: Callm DATE_GET,,

DELETE.ASM 6/25/87 822
DESC: Deletes a file V1.00
IN: *{SEG_VAL} segment
*{OFFSET} offset of filename to be deleted
SAMPLE: Callm DELETE,,

ERRORMSG.ASM 6/25/87 5589
DESC: Prints DOS error messages 1-18 and additional user V1.01
supplied messages from 19 up. If the value of ERR_NUM is
0 control returns to the calling program with no effect.
If ERR_NUM is greater than the value of the maximum error
message then the message "No Error for This Value" is
displayed and control returns to DOS. If an error code is
displayed then control also returns to DOS. The memory
address where the error occured is displayed on exit.
IN: *{ERR_NUM} error number where the possible legal values are:
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
10......Invalid Environment
11......Invalid Format
12......Invalid Access Code
13......Invalid Data
14......This Error Does Not Exist
15......Invalid Drive Was Specified
16......Attempted To Remove The Current Directory
17......Not Same Device
18......No More Files
19......No Room For File(s) On Target Disk
20......No Filename(s) Specified
21......No Volume Label On Disk
22......Wrong Number of Parameters
>22.....No Error for This Value
SAMPLE: Callm ERRORMSG,,

EXECUTE.ASM 6/25/87 2336
DESC: Loads and Executes another program V1.00
IN: *{SEG_VAL} segment and
*{OFFSET} offset of filename to run including extension
*{PAR_HI} high word and
*{PAR_LO} low word of pointer to command line
to be passed to new program. Command line should be in the
form N,' ',PARAM,0DH where N is the length of PARAM+1, and is
followed by a space. PARAM is the command line and 0DH is
a carriage return ending the line.
*{MEMBLK} segment value of last memory control block
segment is typically the value of DS at entry to the main
program.
*{SIZE} size of main calling program in segment form
SAMPLE: Callm EXECUTE,,

FILEDATE.ASM 6/25/87 1891
DESC: Converts Bit-Mapped file date to ASCII format V1.00
IN : *file date in form yyyyyyymmmmmddddd
where mm is the month 1-12
dd is the day 1-31
yy is the year 0-119 (1980-2099)
OUT : *segment and
*offset of the file date in the form
mm/dd/yy
SAMPLE: Callm FILEDATE,,

GET_DIR.ASM 6/25/87 1038
DESC: gets the current directory path string in the form V1.00
dir1\dir2\dir3...
IN: *{DRIVE} drive number of the drive to operate on where
0 is the default, 1 is A, etc.
*{SEG_VAL} segment and
*{OFFSET} offset of 64 byte user are where resultant string
will be placed ending with a byte containing 0
SAMPLE: Callm GET_DIR,,

GET_DSK.ASM 6/25/87 679
DESC: returns the disk transfer address V1.00
OUT: *{SEG_VAL} segment and
*{OFFSET} offset of DTA
SAMPLE: Callm GET_DSK,,

GET_TEXT.ASM 6/25/87 1333
DESC: gets a line of text from the keyboard V1.00
IN: *{MAX_CHARS} maximum # of characters to get from keyboard
OUT: *{SEG_VAL} segment and
*{OFFSET} offset of text buffer
*{LENGTH} length of text
SAMPLE: Callm GET_CHAR,,

HELP.ASM 6/25/87 3269
DESC: Provides help to the user for all programs V1.03
linking to the help module and following the
specified format
IN: *{DS} value passed to data segment at start of main program
*{HELP} location of help data
OUT: *{SEG_VAL} segment and
*{OFFSET} offset of parameter string
*{LENGTH} length of parameter string
SAMPLE: Callm HELP,,

HEXDSPLY.ASM 6/25/87 1855
DESC: Displays hexadecimal codes as ASCII values V1.00
IN: *{HEX_WORD} hex word (0000 - FFFF)
OUT: *{ASC_HI} first two characters of result (i.e EF from EFAB)
*{ASC_LO} second two characters of result (i.e. AB from EFAB)
SAMPLE: Callm HEXDSPLY,,

HEX_ASC.ASM 6/25/87 3724
DESC: Convert Hex numbers to decimal in ASCII format V1.03
IN: *{HI_HEX} High order word of 4 byte hexadecimal number
*{LO_HEX} Low order word of 4 byte hexadecimal number
OUT: *{ASC_1} five words from MSB to LSB with leading
*{ASC_2} zeros stripped
*{ASC_3}
*{ASC_4}
*{ASC_5}
SAMPLE: Callm HEX_ASC,,


MOVE_BYT.ASM 6/25/87 912
DESC: Moves a source buffer to a dest. buffer V1.00
IN: *{SEG_VAL1} segment and
*{OFFSET1} offset of input buffer
*{SEG_VAL2} segment and
*{OFFSET2} offset of output buffer
*{NUM_CHARS} # of chars to move
SAMPLE: Callm MOVE_BYT, NUM_CHARS>,

MOV_PTR.ASM 6/25/87 1195
DESC: Moves the file read/write pointer V1.00
IN: *{METH_VAL} Method value
(0:ofst,1:ofst+cloc,2:eof+offset)
*{HANDLE} handle
*{MSW} most significant word of offset
*{LSW} least significant word of offset
OUT: *{OMSW} most significant word of pointer location
*{OLSW} least significant word of pointer location
SAMPLE: Callm MOV_PTR,,

OPEN.ASM 6/25/87 967
DESC: Opens a file V1.00
IN: *{SEG_VAL} segment and
*{OFFSET} offset of filename as ASCIIZ strng
*{ACC_CODE} access code of file (0:read,1:write,2:read write)
OUT: *{HANDLE} handle of file
SAMPLE: Callm OPEN,,

PARM_BRK.ASM 6/25/87 1843
DESC: Takes in parameter string retrieved from DOS level V1.00
and breaks the string into separate elements using
commas and the end of line as the only breaks.
IN: *{SEG_VAL} segment and
*{OFFSET} offset of parameter string
*{LENGTH} length of parameter string
OUT: *{N} n is the number of sets of segment,offset and length
groups returned, which indicates the number of total
parameters passed to the program.
*{OSEG_VAL,OOFFSET,OLENGTH} repeated N times
and returned in reverse order (i.e. P3, P2 , P1)
SAMPLE: Callm PARM_BRK,,
>

PARM_GET.ASM 6/25/87 1127
DESC: Gets parameters passed to program from DOS level V1.00
at DS+80H
IN: *{DS} value passed to data segment at start of main program
OUT: *{SEG_VAL} segment and
*{OFFSET} offset of parameter string
*{LENGTH} length of parameter string
SAMPLE: Callm PARM_GET,,

POPALL.ASM 6/25/87 1190
DESC: Pop all registers (SI,DI,BP,ES,DS,DX,CX,BX,AX) V1.00
SAMPLE: POPALL

PUSHALL.ASM 6/25/87 1277
DESC: Push all registers (AX,BX,CX,DX,DS,ES,BP,DI,SI) V1.00
SAMPLE: PUSHALL

READ.ASM 6/25/87 1008
DESC: Reads data from a file V1.00
IN: *{HANDLE} handle of file
*{NUM_BYTES} number of bytes requested to read from file
*{SEG_VAL} segment and
*{OFFSET} offset of buffer
OUT: *{NUM_READ} number of bytes actually read
SAMPLE: Callm READ,,

REPLACE.ASM 6/25/87 1640
DESC: Replaces an occurence of a string with another V1.00
string
IN: *{RSTRNG} segment and
*{ROFF} offset of replacement string (must be same length)
*{DIR} direction of search (0:forward,1-FFFF:reverse)
*{SEG_VAL} segment and

*{OFFSET} offset of buffer to search
*{LENGTH} length of search string
*{SSTRNG} segment and
*{OSTRNG} offset of search string
OUT: *{OSEG} segment and
*{OOFF} offset of replacement (both zero if not replaced)
SAMPLE: Callm REPLACE, SSTRNG,OSTRNG>,

SCAN_BYT.ASM 6/25/87 2716
DESC: Scans a source buffer for given characters V1.01
and returns the character and location of the closest
matching character

*** SCAN_BYT performs forward and reverse searches. The CLD
assembler command must be used before calling the procedure
to perform a forward search. The STD command must be used
before calling to perform a reverse search. ***

IN: *{MATCH2N} 2nd and additional matches
*{SEG_VAL} segment and
*{OFFSET} offset of buffer to scan
*{MATCH1} 1st of N number of possible matching sequences
*{N} number of matching sequences passed in
OUT: *{MATCH_VAL} value of matching character
*{MATCH_LOC} location of offset in match segment where
matching value was found
SAMPLE: Callm SCAN_BYT,,


SCRN_RST.ASM 6/25/87 780
DESC: Restores 16K screen to video memory V1.00
SAMPLE: SCRN_RST

SCRN_SAV.ASM 6/25/87 834
DESC: Saves 16K screen from video memory V1.00
SAMPLE: SCRN_SAV

SCRN_TYP.ASM 6/25/87 899
DESC: Returns the address of the video memory buffer V1.00
OUT: *{VIDEO} segment address of start of video memory area
Useful only with MDA and CGA graphics. B&W area is at B000H
while color area is at B800H
SAMPLE: Callm SCRN_TYP,,


 December 12, 2017  Add comments

Leave a Reply