home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
Geneve
/
9640news
/
CAT09
/
CRRRDTC.ARK
< prev
next >
Wrap
Text File
|
2006-10-19
|
3KB
|
70 lines
?
********************************************************************************
*
* This routine will only work in the X-Basic environment.
*
* Pinouts required for the code below to operate
*
* Modem RS232
* 8 19
*
* Save this file to disk as "DSK1.CD/S"
*
* To assemble use "DSK1.CD/S" as source name
* then use "DSK1.CD/O" as object file name
* hit enter for list file and options!
*
* After assembling then do the following to load from X-Basic:
*
* 10 CALL INIT
*
* 20 CALL LOAD("DSK1.CD/O")
*
* This will load the object code into memory!
*
* Now the code is loaded and ready to go!
*
* For a Carrier Detect use the following as a GOSUB in the X-Basic program
*
* 10 CALL LINK("CD",A$):: IF A$=CHR$(255) THEN (255= no carrier)
* 20 RETURN (128= carrier)
*
* To test this by itself change RETURN to GOTO 10 and call the modem!
* You should get 255 with no carrier and 128 with a carrier!
*
*
********************************************************************************
DEF CD
*
SAVRTN DATA 0 *a block to hold return address
RESULT DATA 0 *a block to hold result code
CHECK DATA >180 *the character 128
NOCAR DATA >1FF *the character 255
MYWS BSS 32 *sets up registers for this routine
CD MOV 11,@SAVRTN *load save return address
LWPI MYWS *load my registers
LI 12,>1380 *load the CRU with the base address for RS232/2
MOV @CHECK,@RESULT *load RESULT block with carrier=yes
CLR 10 *clear counter
TB 27 *testing pin 19
JNE $+4 *if off then no carrier
JMP BASIC *if on jump to BASIC
DEC 10 *the counter for 65000 counts
JNE $-8 *go back to TB 27
MOV @NOCAR,@RESULT *load RESULT with No carrier
BASIC CLR 0 *tells STRASG this is a simple variable
LI 1,1 *tells element number
LI 2,RESULT *loads CPU beginning address using contents of R0-R2
BLWP @>2010 *send contents to STRASG utility
LWPI >83E0 *load GPL workspace registers
CLR 0 *clear R0 for the error check routine
MOVB 0,@>837C *check for no errors
MOV @SAVRTN,11 *load saved return address
RT *return to calling routine
END
Download complete. Turn off Capture File.