home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
club100
/
tel
/
fltcom.do
< prev
next >
Wrap
Text File
|
2006-10-19
|
12KB
|
362 lines
Club 100 Library - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE
How to Get FLTKP.COM
--------------------
For doing Kaypro <--> 100/102/200 fast ASCII file transfers,
FLTKP.COM (DL1) should work for you. You need to download it into
your Kaypro with Xmodem protocol comm program with 8-bit, no
parity CIS DEFALT settings.
If you can't do that, get FLTIBM.UPD, rename it as FLTIBM.ASM, and
assemble it with ASM.COM (the assembler provided with the computer
as a CP/M utility) and convert the resulting hex file to binary
with LOAD.COM (another utility provided with CP/M).
With FLTKP.ASM and ASM.COM both on the the same disk drive, at the
CP/M prompt, type:
ASM FLTKP
After you get an End of Assembly message and the prompt comes
back, type:
LOAD FLTKP
You should then have a functional copy of FLTKP.COM on your Kaypro
disk. The files FLTKP.HEX and FLTKP.PRN can then be ERAsed.
FLTKP is the ancestor of FLTIBM, with a subset of its
capabilities. For some usage hints, read FLTIBM.DOC (DL1). Note
the information there about use with the Tandy 200, if that is
what you are using, and the null modem cable information. And
remember that the '88' is replaced with a '98' for all lap
computer 'save' and 'load' commands with FLTKP.
Phil Wheeler
;TRS-80 Model 100 -- Kaypro File Transfer Utility
;
;Transfers ASCII files to/from Model 100 at
;19200 baud. Use setting 98N1E and Save & Load on Model 100
;Examples are:
; In TEXT: Save to:com:98n1e
; in BASIC: Save"com:98n1e"
;
;Requires RS-232 cable with "Null Modem Adapter"
;for computer interconnect.
;
;Written by Don Corbitt, Feb 1984
;
;Modified by Phil Wheeler, 7/8/84
;Changes include
; 1) made compatible with DR's standard assembler, ASM.COM
; 2) Okidata-peculiar printer control functions removed
; 3) menu at sign-on made more user friendly
; 4) uart-initiation string modified per Gary Berkheiser suggestion.
;
;This file should be adaptable to most CP/M machines by changing the
;uart data port address, the uart status port address,
;the baud rate port address, and the uart initiation string (initcom:)
;
;
ORG 100H
BOOT EQU 0
BDOS EQU 5
FCBL equ 5ch
dbuff equ 80h ;disk i/o buffer
conin equ 1 ;get char from console - wait
printf equ 9 ;print buffer function (DE) until '$'
inlinf equ 10 ;read buffer from console
openf equ 15 ;open file,
closef equ 16 ;close file after write
search equ 17 ;look for file - ff if not found
readf equ 20 ;read block from file
writef equ 21 ;write block to file
makef equ 22 ;make a file entry
baud equ 0 ;port to set baud rate
uartd equ 4 ;uart data port
uarts equ 6 ;uart status port
bell equ 7
cr equ 13
lf equ 10
nul equ 0
eof equ 1ah ;end of file signal
xoff equ 19 ;stop transmission
xon equ 17 ;start transmission
start:
mvi a,15 ;19200 baud
out baud
mvi b,9
lxi h,initcom ;string of chars to initialize uart
mvi c,uarts ;set stat for 98n1e
db 0edh,0b3h ;otir
loop1:
lxi d,menu
mvi c,printf
call bdos
mvi c,conin
call bdos
call touppr ;get upper case letters
cpi 'Q' ;return to CP/M
rz
cpi 'S' ;send file to M100
jz send
cpi 'R' ;receive file from M100
jz receive
jmp loop1 ;try again
send:
lxi d,sndmsg ;'Enter file to send'
mvi c,printf
call bdos
call gfspec ;get the file name, and see if it exists
jnz sendit ;it exists, so send it
lxi d,nfmsg ;'File doesn't exist'
mvi c,printf
call bdos
jmp loop1 ;try again
sendit:
lxi h,stbuff ;end of program - start of buffer
push h
lxi d,fcbl
mvi c,openf ;open file and read contents
call bdos
sloop: mvi c,readf
lxi d,fcbl
call bdos
ana a ;nz = EOF
jnz sendfil
pop d ;current end of data
lxi h,dbuff ;dma buffer - disk buffer
lxi b,80h ;size of buffer
db 0edh,0b0h ;ldir (hl)->(de)
push d ;new end of data
jmp sloop
sendfil:
call motoff
; in 28 ; get contents of disk select port
; ani 252 ; de-select both drives
; ori 64 ; turn off motor
; out 28 ; rewrite port
; mvi c,closef ;close file now
; lxi d,fcbl ;set params
; call bdos
pop h ;arrange stack - discard this value
lxi h,stbuff ;buffer ended with EOF, OK?
sloop1: mov c,m ;get first char
inx h
call rsout ;send char
cpi eof
jz send ;end of file - send new file??
call rsist ;char waiting??
jz sloop1
call rsin ;get char
cpi xoff ;if xoff, then wait.....
jnz sloop1 ;else ignore it
sloop2: call RSin
cpi xon
jnz sloop2
jmp sloop1
;rs output status. Z if uart busy, NZ otherwise. A modified.
rsost:
in uarts
ani 4
ret
;RS character out, character in C
rsout: ;send byte in C to uart
call rsost
jz rsout
mov a,c
out uartd
ret
;rs input status. Z if no char waiting, NZ if char ready.
rsist:
in uarts
ani 1 ;char waiting?
ret
;get char from uart and return in A.
rsin:
call rsist
jz rsin ;try again if one not waiting
in uartd
ret
receive:
lxi d,recmsg
MVI C,printf
call bdos
call gfspec
jz rcvit ;doesn't exist, so get it
lxi d,fexmsg
mvi c,printf
CALL BDOS
JMP LOOP1
RCVIT:
lxi d,fcbl
mvi c,makef
call bdos
lxi h,stbuff
rloop: call rsin ;get a char
mov m,a ;and put in buffer
inx h
cpi eof ;if not last
jnz rloop ;then get another
lxi h,stbuff
secloop:
lxi d,dbuff
mvi b,80h
byteloop:
mov a,m
stax d
cpi eof
jz lastone
inx h
inx d
dcr b
jnz byteloop
call wsect
jmp secloop
lastloop:
stax d
lastone:
inx d
dcr b
jnz lastloop
call wsect
lxi d,fcbl
mvi c,closef
call bdos
jmp receive ;end of file - get another one??
wsect:
push h ;save position in buffer
lxi d,fcbl
mvi c,writef
call bdos
pop h
ret
touppr:
cpi 'a'
rc
cpi 'z'+1
rnc
ani 5fh
ret
gfspec:
lxi h,fcbl
mvi b,33 ;33 bytes to erase
xra a
erase: mov m,a
inx h ;next byte in fcbl
dcr b
jnz erase
lxi h,fcbl+1
mvi b,11 ;file name block - default spaces
mvi a,32 ;space
erase1: mov m,a
inx h
dcr b
jnz erase1
lxi d,fbuff ;buffer to hold file name
push d ;save start of buffer
mvi c,inlinf ;read line from keyboard
call bdos ;get line
pop h ;start of buffer (max count)
inx h ;actual value returned
mov a,m
ana a ;no chars in queue??
mov b,a ;count in b
jnz congsp ;if chars, continue get file spec
pop h ;remove one level of subroutines
jmp loop1 ;start over with menu
congsp:
inx h ;first char of fspec
inx h ;second char of fspec
mov a,m ;get ':' if in fspec
dcx h ;first char of fspec
cpi ':'
mvi a,0 ;zero (A) without affecting flags
jnz noprefix
dcr b
dcr b ;skipping first two chars of buffer
mov a,m
call touppr
sbi '@' ;get value from 1 to 17 (A to P)
sta fcbl ;set drive number
inx h ;point to ':'
inx h ;point to first char of name
noprefix:
lxi d,fcbl+1 ;start of name section of fcbl
nprloop:
mov a,m
call touppr
cpi '.'
jz stext ;start extension
stax d ;put in fcbl
inx h
inx d
dcr b
jnz nprloop
exist:
mvi c,search
lxi d,fcbl
call bdos
inr a
push psw
call motoff
pop psw
ret
motoff: in 28
ori 64
out 28
ret
stext:
inx h ;skip '.'
lxi d,fcbl+9 ;start of extension
dcr b
jz exist ;done
extloop:
mov a,m
call touppr
stax d
inx h
inx d
dcr b
jnz extloop
jmp exist
fbuff: db 18
ds 18
fexmsg: db bell,cr,lf,'File already exists',cr,lf,'$'
recmsg: db cr,lf,'File to recieve: $'
sndmsg: db cr,lf,'File to send: $'
nfmsg: db bell,cr,lf,'File doesn''t exist!!',cr,lf,'$'
menu: db cr,lf,lf
db 'Use with COM:98N1E & Save or Load on Model 100'
db cr,lf,'Works with TEXT or BASIC',cr,lf,lf
db 'Selections are:',cr,lf,lf
db ' [Q] Return to CP/M',cr,lf,' [S] Send file to M100'
db cr,lf,' [R] Receive file from M100',cr,lf
db cr,lf,'Enter your selection: $'
initcom:
db 00h,18h,04h,44h,03h,0c1h,05h,0eah
endbuff:
dw 0
stbuff equ $ ;start of free space
end start