Dec 252017
 
Programmer's Journal Volume 9 Number 6 - Nov/Dec 1991.
File PJ96.ZIP from The Programmer’s Corner in
Category Files from Magazines
Programmer’s Journal Volume 9 Number 6 – Nov/Dec 1991.
File Name File Size Zip Size Zip Type
ALIB.DOC 12105 2994 deflated
ALIB.ZIP 63855 56146 deflated
ALIBTOOL.ZIP 27683 26133 deflated
BINGO.ASM 3472 1198 deflated
BINGO.COM 139 123 deflated
DEBING.ASM 1186 516 deflated
DEBING.COM 71 37 deflated
EDITOR.C 31426 7200 deflated
EDITOR.H 3411 1090 deflated
GARLIC.ASM 3375 1217 deflated
GARLIC.COM 107 101 deflated
GARLICP.COM 107 107 stored
GENERIC.CPP 351 156 deflated
GENERIC.DEF 212 142 deflated
GENERIC.EXE 17680 7718 deflated
GENERIC.MAK 763 406 deflated
GENERIC.PRJ 5022 960 deflated
HERCLINE.ASM 12736 3039 deflated
HERCTEST.C 3303 1113 deflated
HERCTEST.EXE 64508 38853 deflated
HERCTEST.MAK 391 203 deflated
INITAPP.H 334 107 deflated
INITINST.H 316 109 deflated
PEN.H 496 218 deflated
PJREADME.96 6652 2620 deflated
SCRIBBLE.CPP 1860 582 deflated
SCRIBBLE.EXE 19392 8453 deflated
SCRIBBLE.MAK 776 416 deflated
SCRIBBLE.PRJ 5023 963 deflated
VAMPIRE.ASM 1261 615 deflated
VAMPIRE.COM 115 96 deflated
VIDSAVE.ASM 12813 3269 deflated
VIDSAVE.COM 689 475 deflated
WINCLASS.CPP 14432 3304 deflated
WINCLASS.H 1956 677 deflated
WINCLASS.LIB 16896 7585 deflated
WINCLASS.MAK 595 323 deflated

Download File PJ96.ZIP Here

Contents of the ALIB.DOC file


;;abort if cf
;
;entryCferror flag, program exits if set (Cf==1)

;;add atom
;
;entryDS:SIstring to hash
;exitAXatom index
;Cfif table full

;;add binary atom
;
;entryDS:SIbytes to hash
;CXbyte count (<256)
;exitAXatom index
;Cfif table full or atom too big

;;block alloc
;
;exitAXblock size in bytes
;BXblock handle
;ES:DIblock pointer
;Cfif no memory

;;block file open
;
;entryDS:SIfile name
;exitAXfile size in blocks
;BXblock handle
;Cfif file not found or empty

;;block file read
;
;entryAX16k file block number (0..n)
;BXblock index
;exitDS:SIblock pointer
;AXblock size (<16k if last block)
;Cfif bad block index or past end of file

;;block free
;
;entryBXblock index
;exitCfif bad index (cannot free file blocks)
;usesAX,BX

;;block read
;
;entryBXblock index
;exitAXblock size
;DS:SIblock pointer
;Cfif bad block or no memory

;;calloc
;
;entryCXrequested byte count (1..FFF0)
;exitAXactual byte count
;ES:DIstorage pointer
;Cfif no storage

;;check block file
;
;entryDS:SIfile name
;exitBXfile id or 0 if unknown file

;;clear ncb
;
;entryDS:SIncb ptr

;;clear strerror
;
;zeros error string pointer

;;close file
;
;entryBXhandle
;exitCfif error
;usesAX

;;close file cf
;
;entryBXhandle
;Cferror flag
;exitCfif error flag set on entry or error during close file
;usesAX

;;current file size
;
;entryBXfile handle
;exitDX AXfile size
;Cfif unexpected file error

;;dialog error beta
;
;entryAXDGROUP error string
;exitCf1
;usesAX

;;dialog strerror beta
;
;exitCf1
;usesAX

;;disable exit intercept
;
;usesAX,SI,DS

;;ems exchange
;
;entryAXpage index (1..n)
;ES:DIdestination
;exitCfif bad block or EMS error
;usesAX

;;ems in
;
;entryAXblock index (1..n)
;ES:DIdestination (no transfer if NULL)
;exitCfif bad block or EMS error
;usesAX

;;ems out
;
;entryES:DIsource
;exitAXblock index (1..n)
;Cfif EMS full or EMS error

;;enable exit intercept
;
;usesAX,SI,DS

;;err disk full
;
;exitCf1
;usesAX

;;exit
;
;entryALexit code

;;exit with failure

;;exit with success

;;fatal app exit
;
;entryAXoffset of DGROUP error string
;notethis function never returns

;;fclose
;
;entryBXstream handle
;exitCfif error closing file or bad handle
;usesAX,BX

;;find atom
;
;entryDS:SIstring to find
;exitAXatom index
;Cfif not found

;;find binary atom
;
;entryDS:SIbytes to hash
;CXbyte count (<256)
;exitAXatom index (or 0)
;Cfif not found

;;fopen
;
;entryAXmode, 'r' or 'w' to open for reading or writing
;DS:SIfilename
;exitBXstream handle
;Cfif error
;usesAX

;;fread
;
;entryBXstream handle
;CXbyte count
;ES:DIdestination pointer
;exitAXactual byte count (!=CX for EOF)
;DIupdated
;Cfif error

;;free
;
;entryES:DIstorage pointer (OK if NULL)
;exitES:DINULL
;Cfif bad pointer
;usesAX

;;fwrite
;
;entryBXstream handle
;CXbyte count
;DS:SIsource pointer
;exitAXbytes written
;SIupdated
;Cfif error

;;get atom name
;
;entryAXatom index
;CXbuffer size
;ES:DIoutput buffer
;exitDIupdated (points to \0)
;CXupdated
;Cfif bad atom index
;usesAX

;;get input state
;
;exitZfif no key waiting
;usesAX
;notereturns TRUE for keyboard, mouse, and timer under Windows

;;get strerror
;
;exitDS:SIerror string
;Zfif no error string

;;get vector
;
;entryALvector #
;exitDS:SIselected vector
;Zfif null vector
;usesAX

;;global alloc
;
;entryCXrequested size
;exitAXactual size
;BXstorage handle (never zero)
;Cfif no storage

;;global calloc
;
;entryCXrequested size
;exitAXactual size
;BXstorage handle (never zero)
;Cfif no storage

;;global free
;
;entryBXstorage handle (OK if zero)
;exitBX0
;usesAX

;;global lock
;
;entryBXvalid storage handle
;exitDS:SIstorage pointer
;noteDOES NOT BASH AX

;;global realloc
;
;entryBXstorage handle
;CXnew size
;exitAXactual size (if no errors)
;Cfif not enough memory

;;global unlock
;
;entryBXvalid storage handle
;noteflags do NOT change

;;init atom table
;
;entryAXprime number approximate twice maximum atom count
;exitCfif no memory
;usesAX

;;input file size
;
;entryBXfile handle
;exitDX AXsize

;;isalnum
;
;entryALcharacter
;exitZfif alphanumeric character

;;isalpha
;
;entryALcharacter
;exitZfif AL==A-Za-z

;;isalpha_
;
;entryALcharacter
;exitZfif AL alphabetic or _ but not number

;;iscntrl
;
;entryALcharacter
;exitZfif control character (0x7F or 0x00..0x1F)

;;isdigit
;
;entryALchar
;exitZfif 0..9

;;isgraph
;
;entryALcharacter
;exitZfif printable character (not space)

;;islower
;
;entryALcharacter
;exitZfif a..z

;;isprint
;
;entryALcharacter
;exitZfif printable character (including space)

;;ispunct
;
;entryALcharacter
;exitZfif !"#%&'();<=>?[\]*+,-./:^_{|}~

;;isspace
;
;entryALcharacter
;exitZfif space, FF, NL, CR, HT, or VT

;;isupper
;
;entryALcharacter
;exitZfif A..Z

;;isxdigit
;
;entryALcharacter
;exitZfif 0..9 A..F a..f

;;malloc
;
;entryCXrequested byte count (1..FFF0)
;exitAXactual byte count
;ES:DIstorage pointer (unchanged if error)
;Cfif no storage

;;move file pointer
;
;entryBXfile handle
;DX AXfile position
;exitCfif error
;usesAX

;;ms dos

;;ms dos dialog
;
;entry*according to dos function
;exit*
;uses*
;notedisplays dialog box when ms_dos returns an error

;;ms dos strerror

;;netbios add name
;
;entryDS:SIasciiz name (less than 16 characters long)
;exitCfif error
;ALname number (or return code if error)

;;netbios call
;
;entryDS:SInetbios control block
;exitAXreturn code (0xFF if function pending)
;Cfif error

;;netbios cancel
;
;entryDS:SInetbios command block
;exitAXfinal return code
;Cfif error

;;netbios check
;
;exitCfif no netbios driver
;usesAX,SI

;;netbios delete name
;
;entryDS:SIasciiz name (less than 16 characters long)
;exitCfif error
;ALreturn code

;;netbios hang up
;
;entryALsession number
;exitALreturn code
;Cfif error

;;netbios receive wait
;
;entryALlocal session number
;CXbuffer length
;ES:DIbuffer pointer
;exitALreturn code
;CXbytes received (0 if session closed or error)
;Cfif error (session closed is not an error)

;;netbios send broadcast
;
;entryALadd name number
;CXbuffer length
;ES:DIbuffer
;exitALreturn code
;Cfif error
;notewaits until datagram sent over network

;;netbios send datagram
;
;entryALadd name number
;CXbuffer length
;ES:DIbuffer
;DS:SIasciiz call name (destination)
;exitALreturn code
;Cfif error
;notewaits until datagram sent over network

;;netbios send wait
;
;entryALsession number
;CXlength
;ES:DIbuffer pointer
;exitALreturn code
;Cfif error

;;open block file
;
;entryDS:SIfile name
;exitCXfile size in 16k blocks
;DXfile id (1..n)
;Cfif file not found or no storage
;usesAX

;;open input file
;
;entryDS:SIstring
;exitAX,BXhandle
;Cfif error, error text set
;callsoffset_dos_error, ms_dos

;;open output file
;
;entryDS:SIstring
;exitAX,BXhandle
;Cfif error, error text set
;callsoffset_dos_error, ms_dos

;;perror
;
;entryDS:SIoptional message prefix
;usesAX

;;put hex byte
;
;entryALbyte
;usesAX
;notecalls putchar to write chrs

;;put hex word
;
;entryAXword
;usesAX

;;put multiple bytes
;
;entryCXbyte count
;DS:SIbyte pointer
;usesAX,CX,SI

;;put netbios name
;
;entryDS:SIname field of control block
;usesAX,SI

;;put string
;
;entryDS:SIasciiz string
;usesAX

;;put unsigned
;
;entryAXnumber
;usesAX

;;putchar
;
;entryALcharacter

;;putchar newline
;
;usesAX

;;putchar space
;
;usesAX

;;puts
;
;entryDS:SIasciiz string
;usesAX

;;puts dgroup
;
;entryAXDGROUP string pointer
;usesAX

;;rand
;
;exitAXrandom number

;;random
;
;entryAXnum
;exitAXrandom number between 0 and num-1

;;read block file
;
;entryAXfile block index (0..n)
;BXfile id (1..n)
;ES:DItransfer address
;exitAXbyte count
;Cfif error

;;read command line
;
;exitDS:SIprogram command line

;;read entire file
;
;entryDS:SIasciiz file name
;exitDS:SIptr to storage containing file (NULL delimited)
;CXfile byte count
;Cfif file not found or too big
;usesAX

;;read environment
;
;exitDS:SIenvironment

;;read from file
;
;entryBXfile handle
;CXbyte count
;ES:DIdestination
;exitAXnumber of bytes read
;Cfif error

;;realloc
;
;entryCXrequested byte count (1..FFF0)
;ES:DIstorage pointer
;exitAXactual byte count
;Cfif not enough memory or cannot increase size

;;remove
;
;entryDS:SIfilename to delete
;exitCfif error
;usesAX

;;rename
;
;entryDS:SIold name
;ES:DInew name
;exitCfif error
;usesAX

;;rewind
;
;entryBXfile handle
;exitCfif error
;usesAX

;;save most
;
;notesaves all registers except AX and BP. however, the current
;version also saves BP because the code works out that way.
;the registers are automatically restored. this routine is
;called with a return address as the top of stack.

;;select min count
;
;entryCXcount1
;DX AXcount2
;exitCXminimum of count1 and count2

;;set argc argv
;
;exitCfif no memory
;usesAX,CX,DI,SI,ES,DS

;;set block handle
;
;entryBXblock handle
;DXfile id
;exitCfif bad file id
;usesAX,CX,SI,DS

;;set strerror
;
;entryAXDGROUP offset of asciiz error string
;exitCf1

;;startup
;
;entryAXoffset stack
;ESprogram segment prefix
;SSDGROUP
;exitBP0
;may useAX,BX,CX,DX,DI,SI,DS,ES

;;strcmpi
;
;entryDS:SIstring1
;ES:DIstring2
;exitZfif string1==string2
;usesAX

;;strcpy
;
;entryDS:SIsource ptr
;ES:DIdestination ptr
;exitSIupdated past NULL
;DIupdated, points to NULL
;usesAX

;;strcpy limit
;
;entryDS:SIsource pointer
;ES:DIdestination pointer
;DXdestination limit
;exitDIupdated to last character in destination
;usesAX

;;strlen
;
;entryDS:SIstring
;exitCXbyte count excluding NULL
;usesAX

;;strlenz
;
;entryDS:SIstring
;exitCXbyte count including NULL
;usesAX

;;strncpy
;
;entryDS:SIsource string
;ES:DIdestination buffer
;CXbyte count (includes room for \0)
;exitSIupdated (past \0 unless CX too small)
;DIupdated (points to \0)
;CXupdated
;usesAX

;;strskp
;
;entryDS:SIasciiz string ptr
;exitSIupdated past null
;usesAX

;;strskp line
;
;entryDS:SIstring pointer
;exitSIupdated to next line but not past \0
;ALdelimiting char (either 0 or 0Ah)

;;strskp white
;
;entryDS:SItext ptr
;exitSIupdated past spaces and tabs
;ALnon-white character

;;swap in
;
;entryAXswap index
;ES:DIdestination (no disk I/O if NULL)
;exitCfif error
;usesAX

;;swap out
;
;entryES:DIsource pointer
;exitAXswap index (1..MAX) or 0 if error
;Cfif error (full disk or swap file, not DOS 3+)

;;tolower
;
;entryALchar
;exitALlower cased AL

;;toupper
;
;entryALchar
;exitALupper cased AL

;;write to file
;
;entryBXfile handle
;CXbyte count
;ES:DIbuffer
;exitCfif error



 December 25, 2017  Add comments

Leave a Reply