home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
trs80model2.zip
/
trsdata.mac
< prev
next >
Wrap
Text File
|
1997-03-26
|
7KB
|
195 lines
subttl data segment
dseg
;
; state symbols
;
_a equ 1 ;abort
_c equ 2 ;complete
_r equ 3 ;receive init
_rf equ 4 ;receive file header
_rd equ 5 ;receive data
_s equ 6 ;send init
_sf equ 7 ;send file header
_sd equ 8 ;send data
_se equ 9 ;send end-of-file
_sb equ 10 ;send break transmission
_o equ 11 ;open file (pre send init)
_end equ 255
;
public fcb,filbuf,recptr,recbuf,paraml,lrecl
public create,byte,word,screen,rftab,rdtab
public slen,spaket,rlen,rpaket,sinit
public rinit,port,baud,wdlen,baudtb,lab,parsetb
public parity,stop,oldstk,scrtch,cmdlin,high
public state,n,r,init,ssvc,rsvc,csvc,altsvc
public nsvc,stack,stjump,rtype
extrn abort,exit,r_init,r_file,r_data
extrn rf_f,rf_b,rf_x,rd_d,rd_z
extrn s_open,s_file,s_data,s_eof,s_break,s_init
public filnam,crp,cbp,work
extrn eof,sets,setr,setb,setf,setp,setc,setw,seter
extrn setl
;
; fcb and others file related matters
;
filnam: ds 30 ;will hold filename for send
fcb: ds 60 ;file control block
filbuf: ds 512 ;file buffer
crp:
recptr: db 0 ;
recbuf: ds 256 ;record buffer
paraml: dw filbuf ;parameter list for file svc's
dw recbuf
dw eof ;send end of file routine
db 'W' ;read/write
lrecl: db 1 ;default is 1
db 'F' ;always fixed record length
create: db 2 ;default is create
db 0 ;user attrib = 0
;
; packet buffers
;
cbp:
slen: db 0 ;send buffer length (all included)
spaket: ds 100 ;send packet
rlen: db 0 ;receive buffer length
rpaket: dw 0 ;receive packet store
rtype: ds 100 ;here is where we store type
;
; the send init exchange
;
sinit: db 13 ;will contain the send init received
db 13,13,13,13,13,13,13,13,13,13,13
maxlen equ 94 ;maximum packet length
tout equ 10 ;time out
quote equ '#'
cr equ 13 ;carriage return (eol)
rinit: ;the send-init we will send
db maxlen+32
db tout+32
db 0+32
db 64
db cr+32 ;eol
db quote
db 'N'
db '1'
db ' '
db 32
; telecomm buffers
;
port: db 'A' ;default is A
baud: db 8 ;baud rate (9600)
wdlen: db 8 ;8 bits' byte
parity: db 'N' ;none
stop: db 1
db 0 ;end
;
; misc
;
oldstk: dw 0 ;save stack here on entry
scrtch: dw 0 ;last+1 byte of pgm on entry
cmdlin: dw 0 ;address of command line
byte: db 0 ;scratch byte
word: dw 0 ;scratch word
work: ;work space for parser
db '0','0','0','0','0'
screen: db 0 ;flag for typing on screen
;
high: dw 0 ;high memory
state: db 3 ;current state of automaton
n: db 0 ;current packet number
r: db 0 ;current retry count
init: db 0 ;do comm init on entry if != 0
;
; svc for comm operations
;
ssvc: db 97 ;send on channel A
rsvc: db 96 ;receive on channel A
csvc: db 100 ;control on channel A
altsvc: db 0,99,98,101 ;same for channel B
nsvc: db 4 ;number of bytes to move
;
; stack
;
ds 400 ;lots of space
stack:
stjump: db _a ;main jump table
dw abort
db _c
dw exit
db _r
dw r_init
db _rf
dw r_file
db _rd
dw r_data
db _o
dw s_open
db _s
dw s_init
db _sf
dw s_file
db _sd
dw s_data
db _se
dw s_eof
db _sb
dw s_break
db _end ;end of table
rftab: db _a
dw abort
db 'F'
dw rf_f
db 'B'
dw rf_b
db 'X'
dw rf_x
db _end
rdtab: db _a
dw abort
db 'D'
dw rd_d
db 'Z'
dw rd_z
db _end
;
baudtb:
db '110 ',1
db '150 ',2
db '300 ',3
db '600 ',4
db '1200',5
db '2400',6
db '4800',7
db '9600',8
db 13 ;end of table
lab:
dw l1,l2,0
l1:
db 3,'{}',13
l2:
db 1,'/'
parsetb:
db 0
dw seter
db 'W'
dw setw
db 'S'
dw sets
db 'R'
dw setr
db 'F'
dw setf
db 'P'
dw setp
db 'B'
dw setb
db 'C'
dw setc
db 'L'
dw setl
db _end
end