home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
cpm3
/
cpm3lib.doc
< prev
next >
Wrap
Text File
|
1994-07-13
|
9KB
|
293 lines
October 17, 1983
Jim Lopushinsky
Edmonton, Alberta
CPM3LIB.RE╠á i≤á ß librar∙ oµ subroutine≤ tha⌠ makσ usσá oµá CP/═ ì
Plu≤á features«á IncludeΣá arσ routine≤ t∩ acces≤ thσá timσá anΣ ì
date¼á se⌠á anΣá interogatσ elapseΣ time¼á inspec⌠á physica∞á anΣ ì
logica∞ characte≥ I/╧ devices¼á anΣ set/ge⌠ bauΣ rate≤ fo≥ seria∞ ì
I/╧ devices.
Thi≤ i≤ jus⌠ ß start«á Iε thσ future¼ ╔ hopσ thσ librar∙ wil∞ bσ ì
increased to include other CP/M Plus features.
Al∞á routine≤á (excep⌠á BIOS⌐ adherσ t∩ thσá Microsof⌠á paramete≥ ì
passinτá convention≤ s∩ tha⌠ the∙ ma∙ bσ calleΣ directl∙á b∙á an∙ ì
Microsoft language compiler (FORTRAN-80, COBOL-80, BASIC-80).
T∩á includσ an∙ requireΣ modules¼á searcΦ CPM3LI┬ durinτ thσ linδ ì
step.
BIOS Direct bios call thru the BDOS using function 50.
Input: Register D - Bios entry number (0-32).
Al∞á othe≥á register≤á - A≤ expecteΣ b∙á thσá BIO╙ ì
ááááááááááááááároutine.
Output: Al∞ register≤ returneΣ a≤ appropriatσ fo≥ thσ BIO╙ ì
ááááááááááááááároutine.
TIMERS Initiate time counter
Input: none.
Output: none«á Al∞ register≤ arσ preserved« Thσ interna∞ ì
ááááááááááááááátimσá counte≥ i≤ initializeΣ t∩ ░ anΣá incrementeΣ ì
áááááááááááááááevery second.
áááááFortran calling convention:
CALL TIMERSè
ITIMER Returε numbe≥ oµ second≤ elapseΣ sincσ thσ las⌠ cal∞ t∩ ì
ááááááááááTIMERS.
Input: none.
Output: Register HL - Number of seconds elapsed.
áááááááááááááááRegister A - Copy of Register L.
áááááááááááááááZ flag set - TIMERS not yet called.
áááááááááááááááAll other registers are preserved.
Fortran calling convention:
ITIME=ITIMER(0)
Where: ITIME is either I*2 or I*1 variable.
░á i≤á ß dumm∙ paramete≥ s∩ tha⌠á FORTRAN-8░á wil∞
ááááááááááááááákno≈ tha⌠ thi≤ i≤ ß functioε call.
TIME Return date and time as 3 character strings.
Input: Register HL points to 3 byte Day of Week field.
áááááááááááááááRegister DE points to 8 byte date field.
áááááááááááááááRegister BC points to 8 byte time field.
Output: Thσ │ field≤ arσ se⌠ t∩ thσ curren⌠ timσ anΣ date« ì
áááááááááááááááDay of Week - Abbreviation of Weekday.
áááááááááááááááDate field - MM/DD/YY.
áááááááááááááááTime field - HH:MM:SS.
áááááááááááááááAll registers are destroyed.
Fortran calling convention:
CALL TIME(WKDAY,DATE,TIMEX)
áááááWhere:ááááWKDAY is a 3 byte array.
DATE and TIMEX are 8 byte arrays.
TIMEB Return date and time in binary format.
Input: Register HL points to Day of Week word.
áááááááááááááááRegister DE points to 3 words for date.
áááááááááááááááRegister BC points to 3 words for time.
Output: The 3 fields are set to current date and time.
áááááááááááááááWeekday is in the range 0-6 (0=Monday).èáááááááááááááááDate is in the order Month,Day,Year.
áááááááááááááááTime is in the order Hour,Minute,Second.
áááááááááááááááAll registers are destroyed.
Fortran calling convention:
CALL TIMEB(IWKDAY,IDATE,ITIME)
Where: IWKDAY is I*2 variable for Weekday.
IDATE and ITIME are I*2 arrays of 3 for date and time.
IFNDEV Return≤á thσ pysica∞ devicσ numbe≥ associateΣ witΦá thσ ì
áááááááááádevicσ name.
Input: Registe≥á H╠á point≤ t∩ ╢ characte≥á strinτá whicΦ ì
ááááááááááááááácontain≤ thσ devicσ name.
Output: Register HL contains the device number.
Register A - copy of register L.
All other registers are preserved.
Error condition║á Iµ registe≥ H╠ ╜ 0FFFF╚ (-1⌐á theεá thσ ì
ááááááááááááááánamed device does not exist.
Fortran calling convention:
IDEV=IFNDEV(DEVNM)
Where: IDEV is I*2 or I*1 variable for device number.
DEVNM is 6 byte string containing the device name.
Example: IDEV=IFNDEV('MODEM ')
IDE╓áá wil∞á contaiεá thσá pysica∞á devicσá numbe≥ ì
áááááááááááááááassociateΣá witΦ thσ namσ MODEM¼á o≥ -▒á iµá MODE═ ì
ááááááááááááááácould not be found.
IBAUD Get or Set the baud rate for a pysical device.
Input: Register HL points to the Baud rate word.
If baud rate=0 then return current baud rate.
áááááááááááááááOtherwise set the device to value at baud rate.
áááááááááááááááRegister DE points to device number byte.
Output: Registe≥á H╠ contain≤ thσ curren⌠ bauΣ ratσ oµ thσ ì
ááááááááááááááárequested device.
Error condition║á H╠ ╜ ░ - InvaliΣ bauΣ ratσá o≥á invaliΣ ìèááááááááááááááádevicσ numbe≥ o≥ devicσ doe≤ no⌠ suppor⌠ requesteΣ ì
ááááááááááááááábaud rate.
Fortran calling convention:
IBD=IBAUD(IRATE,IDEVNO)
áááááWhere:ááááIBD is I*2 variable containing returned baud rate.
IRAT┼á i≤ I*▓ variablσ whicΦ contain≤ ░ fo≥ ge⌠ o≥ ì
áááááááááááááááa baud rate for set.
áááááááááááááááIDEVN╧á i≤á I*▓á o≥ I*▒á variablσá containinτá thσ ì
ááááááááááááááádevice number.
Examples:
IBD=IBAUD(0,1)
Returns the current baud rate of device 1
IBD=IBAUD(1200,2)
Sets the baud rate of device 2 to 1200 baud.
IMXDEV Returns the maximum physical device number.
Input: none.
Output: Register L - Maximum device number.
áááááááááááááááRegister A - Copy of Register L.
áááááááááááááááRegister H - 0
áááááááááááááááAll other registers are preserved.
Fortran calling convention:
MAXDEV=IMXDEV(0)
Where: MAXDE╓á i≤á I*▓ o≥ I*▒ variablσ tha⌠ wil∞á contaiε ì
áááááááááááááááthe maximum physical device number.
IGTMOD Returns a physical device Mode byte.
Input: Register HL points to physical device number
Output: Register L - Mode byte
Register A - Copy of Register L.
Register H - 0
All other registers are preserved.
è Fortran calling convention:
MODE=IGTMOD(IDEVNO)
Where: IDEVNO is I*2 or I*1 physical device number.
áááááááááááááááMOD┼ i≤ I*▓ o≥ I*▒ variablσ tha⌠ wil∞ contaiεá thσ ì
ááááááááááááááámode byte.
áááááááááááááááThσá bit≤á iεá thσ modσ bytσá havσá thσá followinτ ì
ááááááááááááááámeanings:
áááááááááááááááBit
ááááááááááááááá0 Device may do input
ááááááááááááááá1 Device may do output
ááááááááááááááá2 Software selectable baud rates
ááááááááááááááá3 Device may use XON/XOFF protocol
ááááááááááááááá4 XON/XOFF protocol enabled
ááááááááááááááá5-7 Reserved for future use
IGTDEV Returεá curren⌠á logica∞ t∩ physica∞ devicσá assignmen⌠ ì
áááááááááávector.
Input: Register HL points to logical device number.
CP/M 3 has five logical devices:
0 CONIN Console input
ááááááááááááááá1 CONOUT Console output
ááááááááááááááá2 AUXIN Auxiliary input
ááááááááááááááá3 AUXOUT Auxiliary output
ááááááááááááááá4 LSTOUT List output
Output: áRegiste≥á H╠ - curren⌠ physica∞ assignmen⌠á vecto≥ ì
áááááááááááááááfo≥á thσ requesteΣ logica∞ device«á Bit≤ arσá se⌠ ì
ááááááááááááááácorrespondinτá t∩á physica∞ device≤ froφá lef⌠á t∩ ì
áááááááááááááááright (bit 15 = device 0, bit 0 = device 15).
áááááááááááááááAll other registers (except PSW) are preserved.
Error condition:
áááááááááááááááRegiste≥ H╠ ╜ 0FFFF╚ (-1⌐ - InvaliΣ logica∞ devicσ ì
ááááááááááááááánumber.
Fortran calling convention:
IVEC=IGTDEV(DEVNO)
Where: DEVNO is I*2 or I*1 logical device number.
IVEC is I*2 variable for assignment vector.
è
ISTDEV Set logical to physical device assignment vector.
Input: Register HL points to logical device number.
Registe≥á D┼á point≤ t∩á ne≈á physica∞á assignmen⌠ ì
ááááááááááááááávector.
Output: none«áá Al∞á register≤á excep⌠á PS╫á anΣá H╠á arσ ì
ááááááááááááááápreserved.
Error condition:
Registe≥á H╠ ╜ 0FFFF╚ (1-⌐ InvaliΣ logica∞á devicσ ì
ááááááááááááááánumber.
Fortran calling convention:
IERR=ISTDEV(DEVNO,IVEC)
Where: DEVNO is I*2 or I*1 logical device number.
áááááááááááááááIVEC is I*2 assignment vector.
áááááááááááááááIERR is I*2 or I*1 error return code.