home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR19
/
SNIP0693.ZIP
/
SERIAL.PRG
< prev
next >
Wrap
Text File
|
1992-09-03
|
1KB
|
35 lines
Function C_SerialR
Para pDisk
Local RetVal:='',I,pB:='',IDBuffer:=Space(6)
Reg_AX('6900') // DOS function
Reg_AL(0) // 0-Get/1-Set
Reg_BL(pDisk) // Drive (0=current,1=A,2=B,etc)
Reg_DS(Seg(@IDbuffer )) // place to return data
Reg_DX(Off(@IDbuffer )) //
Interrupt('21') // call DOS
RetVal:=Subs(IDBuffer,3,4)
For I:=Len(RetVal) to 1 Step -1
pB+=Dec2Hex(Asc(Subs(RetVal,I,1)))
Next
RetVal:=pB
Return RetVal
Function C_SerialW
Para pDisk,pMsg
Local IDBuffer:='',I,pB:=''
pMsg:=Subs(pMsg,1,8)
For I:=1 to Len(pMsg)Step 2
IDBuffer:=IDBuffer+Chr(Hex2Dec(Subs(pMsg,I,2)))
Next
For I:=Len(IDBuffer) to 1 Step -1
pB+=Subs(IDBuffer,I,1)
Next
IDBuffer:=' '+pB
Reg_AX('6900') // DOS function
Reg_AL(1) // 0-Get/1-Set
Reg_BL(pDisk) // Drive (0=current,1=A,2=B,etc)
Reg_DS(Seg(@IDbuffer )) // place to return data
Reg_DX(Off(@IDbuffer )) //
Interrupt('21') // call DOS
Return NIL