home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
os968ka.tar.gz
/
os968ka.tar
/
k6omai.asm
< prev
next >
Wrap
Assembly Source File
|
1987-07-01
|
11KB
|
185 lines
nam Kermit68K
ttl Main program module
* Kermit68K: source file K68MAI
********************************************************************************
********************************************************************************
* **** * * *** ***** * * *** ** ** **** *
* *** ** ******* *** ** *** * **** ***** ****** **** * *** **
* ** *** ******* **** ** * * * * **** **** ******* **** * ** ***
* * **** ******* *** ** ** ** * **** **** ******* **** * * ****
* ***** *** *** *** *** * **** **** *** ** *****
* * **** ******* ** **** ******* * **** **** **** * **** * * ****
* ** *** ******* *** *** ******* * **** **** **** * **** * ** ***
* *** ** ******* **** ** ******* * **** **** **** * **** * *** **
* **** * * ***** * ******* * **** ***** *** ** **** *
********************************************************************************
********************************************************************************
* *
* Kermit implementation for the MC68000 microprocessors family *
* *
* *
* Author: Roberto Bagnara, Physics Department, Bologna University *
* *
* Started: 02 May 1986 by rb *
* Last modified: 01 July 1987 by rb *
* *
* Modified by: Steve Williams, University of Texas at Austin *
* *
* Status : INCOMPLETE *
* *
* *
* Modification History: *
* *
* Version Date Who Comments *
* *
* 1.0.00 870701 Roberto Bagnara First official release *
* *
********************************************************************************
use DefsFile
TypeLang equ (Prgrm<<8)+Objct Executable 68000 native code
AttrRev equ (ReEnt<<8)+0 Re-entrant code, revision 0
Edition equ 0 Edition number
Stack equ 8192 Stack space needed
psect Kermit,TypeLang,AttrRev,Edition,Stack,Kerm68K
********************************* Kerm68K *****************************ok
* *
* Kermit68K main program. *
* *
* Entry conditions : none *
* *
* Exit conditions : none *
* *
***********************************************************************
Kerm68K: LEA VarArea(A6),A6 Correct the $8000 bias of OS-9
BSR InitAll Initialize all Kermit68K variables
BSR SysInit Initialize any system dependent thing
BSR CmdLnP Parse the command line, if possible
LEA InitFile(PC),A0 Point to the init file name
MOVEQ #ReadOp,D0 We want to read it
MOVEQ #TakeFil0,D1 This is the channel number
BSR FilOpen Try to open the init file
TST.B D0 Success ?
BEQ.S Kerm68K1 No, no message, parse user commands
CLR.B TakLevel(A6) Yes, we are interpreting the take file 0
Kerm68K1 BSR Parser Parse interactive commands until done
ST D0 Finally return a positive cc ...
BRA SysExod ... and the control to system
******************************** InitAll ******************************ok
* *
* Startup initialization routine. *
* *
* Entry conditions : none *
* *
* Exit conditions : D0.L destroyed *
* *
***********************************************************************
InitAll MOVE.B #MyEOL,IEOL(A6) Set EOL for incoming packets
MOVE.B #DefEOL,OEOL(A6) Set EOL for outgoing packets
MOVE.B #DefCtlQt,ICtlQuot(A6) Set incoming packets control quote
MOVE.B #MyCtlQot,OCtlQuot(A6) Set outgoing packets control quote
MOVE.B #MyPad,IPadNumb(A6) Set how much padding to ask for
MOVE.B #DefPadNm,OPadNumb(A6) Set how much padding to send
MOVE.B #MyPadChr,IPadChar(A6) Set padding character to ask for
MOVE.B #DefPadCr,OPadChar(A6) Set padding character to send
MOVEQ #Asc_SOH,D0 Default packet start character
MOVE.B D0,IStPckCh(A6) Set incoming packet start char
MOVE.B D0,OStPckCh(A6) Set outgoing packet start char
MOVE.B #DefTmOut,ITimInt(A6) Set when I should time out
MOVE.B #MyTimOut,OTimInt(A6) Set when I want to be timed out
MOVE.B #MyMxPSiz,IMPckSiz(A6) Set max packet size I want receive
MOVE.B #DefMxPSz,OMPckSiz(A6) Set max packet size I can send
MOVE.B #MyRptQot,ReptQuot(A6) Set the default repeat prefix
MOVE.B #My8BQuot,Bit8Quot(A6) Set the default 8th bit prefix
MOVE.B #1,BlChkRq(A6) Set the default block check type
MOVE.B #DefDuplx,Duplex(A6) Set default duplex
MOVE.B #DefFlow,Flow(A6) Set default flow control
MOVE.B #DefPrity,Parity(A6) Set default parity
MOVE.B #DefEscap,Escape(A6) Set default escape character
MOVE.B #DefDelay,Delay(A6) Set default delay before sending
MOVE.B #DefRetIn,RtryInit(A6) Set default retry init limit
MOVE.B #DefRetPk,RtryPack(A6) Set default retry normal limit
LEA MacroTbl(A6),A0
MOVE.L A0,MTNxtChF(A6)
CLR.B LinLngth(A6) For the dumb terminal Screen routine
SF ReptFlag(A6) No repeat processing by default
SF TimInFlg(A6) No timeout overriding
SF SndPSFlg(A6) No packet size overriding
SF Binary(A6) File type is text
SF Quiet(A6) File display is on
SF FNameCnv(A6) File names conversion is off
SF Warning(A6) File warning is off
SF Keep(A6) Don't keep incomplete files
SF IntMacro(A6)
CLR.L ChrsSent(A6) Clear the statistic variables
CLR.L TChsSent(A6)
CLR.L ChrsRecd(A6)
CLR.L TChsRecd(A6)
CLR.L DChsSent(A6)
CLR.L TDChSent(A6)
CLR.L DChsRecd(A6)
CLR.L TDChRecd(A6)
CLR.L PcksSent(A6)
CLR.L TPckSent(A6)
CLR.L PcksRecd(A6)
CLR.L TPckRecd(A6)
CLR.L NAKsSent(A6)
CLR.L TNAKSent(A6)
CLR.L NAKsRecd(A6)
CLR.L TNAKRecd(A6)
MOVE.B #DefLocal,Local(A6) Setup the initial mode
MOVE.L #DefSpeed,Speed(A6) Setup the default line speed
LEA DefLinNm(PC),A1 Setup the default line, if any
LEA LineName(A6),A0 This is the line name string
MOVEQ #LinNamML,D0 Maximum line name length
BSR CopyStr Copy now
TST.B (A0) The default line name was null ?
BEQ.S InitAll2 Yes, we hope that somebody does this job
MOVEQ #RdWrOp,D0 No, try to open it
MOVEQ #HostLine,D1 This is the channel number
BSR FilOpen Open, if possible
TST.B D0 Ok ?
BNE.S InitAll1 Yes
CLR.B (A0) No, nullify the line name
BEQ.S InitAll2 Proceed initialization, no error messages
InitAll1 LEA ConLinNm(PC),A1 Yes, point to the console line name
BSR CompStr Compare the two line names
TST.B D0 Are equal ?
SEQ Local(A6) If not we are local, remote otherwise
BEQ.S InitAll2 If local, leave speed unchanged
MOVE.L #-1,Speed(A6) If remote, say speed unknown
InitAll2 MOVE.B #-1,TakLevel(A6) No files to take yet
SF TermOut(A6) No terminal output, by now
SF Done(A6) Set to false the parser exit flag
CLR.B Argumnt1(A6) Nullify the first command argument
CLR.B Argumnt2(A6) Nullify the second command argument
CLR.B FilName(A6) Nullify current file name
CLR.B LinLngth(A6) *** To be removed -rb- ***
LEA DefPrmpt(PC),A1 Set up the default prompt
LEA Prompt(A6),A0 This is the prompt string
MOVEQ #PromptML,D0 Maximum prompt length
BSR CopyStr Copy now
RTS
ends
END Kerm68K