home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
archives
/
decpro300.zip
/
promsg.mac
< prev
next >
Wrap
Text File
|
1988-08-16
|
293KB
|
10,939 lines
.NLIST
.ENABL LC
.NLIST BIN,LOC
.LIST
; 0001 %TITLE 'KERMSG - Kermit message processing'
; 0002 MODULE KERMSG (IDENT = '2.0.035'
; 0003 ) =
; 0004 BEGIN
; 0005
; 0006 SWITCHES LANGUAGE (COMMON);
; 0007
; 0008 !<BLF/WIDTH:100>
; 0009
; 0010 !++
; 0011 ! FACILITY:
; 0012 ! Kermit-10, VMS Kermit, Pro/Kermit
; 0013 !
; 0014 ! ABSTRACT:
; 0015 ! KERMSG is the message processing routines for Kermit-10, VMS Kermit,
; 0016 ! and PRO/Kermit.
; 0017 ! This module is written in common BLISS, so that it can be
; 0018 ! transported for the DECsystem-10 and VAX/VMS systems.
; 0019 !
; 0020 ! ENVIRONMENT:
; 0021 ! User mode
; 0022 !
; 0023 ! AUTHOR: Robert C. McQueen, CREATION DATE: 24-January-1983
; 0024 !
; 0025 ! MODIFIED BY:
; 0026 !
; 0027 !--
; 0028
; 0029 %SBTTL 'Table of Contents'
; 0030
; 0031 !+
; 0032 !.pag.lit
; 0033
; 0034 ! Table of Contents for KERMSG
; 0035 !
; 0036 !
; 0037 ! Section Page
; 0038 ! 1. Revision History . . . . . . . . . . . . . . . . . . . 3
; 0039 ! 2. Interface requirements . . . . . . . . . . . . . . . . 4
; 0040 ! 3. Declarations
; 0041 ! 3.1. Forward definitions . . . . . . . . . . . . . 5
; 0042 ! 4. Require files. . . . . . . . . . . . . . . . . . . . . 28
; 0043 ! 5. Macro definitions. . . . . . . . . . . . . . . . . . . 29
; 0044 ! 6. KERMIT Protocol Definitions. . . . . . . . . . . . . . 30
; 0045 ! 6.1. Packet offsets. . . . . . . . . . . . . . . . 31
; 0046 ! 6.2. Message dependent field . . . . . . . . . . . 32
; 0047 ! 6.3. SEND initiate packet. . . . . . . . . . . . . 33
; 0048 ! 7. KERMIT Protocol States . . . . . . . . . . . . . . . . 34
; 0049 ! 8. Internal constants . . . . . . . . . . . . . . . . . . 35
; 0050 ! 9. Storage - External . . . . . . . . . . . . . . . . . . 36
; 0051 ! 10. Storage - Local. . . . . . . . . . . . . . . . . . . . 37
; 0052 ! 11. External references. . . . . . . . . . . . . . . . . . 38
; 0053 ! 12. MSG_INIT . . . . . . . . . . . . . . . . . . . . . . . 39
; 0054 ! 13. SND_ERROR. . . . . . . . . . . . . . . . . . . . . . . 40
; 0055 ! 14. SERVER - Server mode . . . . . . . . . . . . . . . . . 41
; 0056 ! 15. SEND_SWITCH. . . . . . . . . . . . . . . . . . . . . . 42
; 0057 ! 16. REC_SWITCH . . . . . . . . . . . . . . . . . . . . . . 43
; 0058 ! 17. Server
; 0059 ! 17.1. DO_GENERIC - Execute a generic command. . . . 44
; 0060 ! 18. DO_TRANSACTION - Main loop for FSM . . . . . . . . . . 45
; 0061 ! 19. REC_SERVER_IDLE - Idle server state. . . . . . . . . . 46
; 0062 ! 20. SEND_SERVER_INIT . . . . . . . . . . . . . . . . . . . 47
; 0063 ! 21. SEND_DATA. . . . . . . . . . . . . . . . . . . . . . . 48
; 0064 ! 22. SEND_FILE. . . . . . . . . . . . . . . . . . . . . . . 49
; 0065 ! 23. SEND_EOF . . . . . . . . . . . . . . . . . . . . . . . 50
; 0066 ! 24. SEND_INIT. . . . . . . . . . . . . . . . . . . . . . . 51
; 0067 ! 25. SEND_OPEN_FILE - Open file for sending . . . . . . . . 52
; 0068 ! 26. SEND_GENCMD. . . . . . . . . . . . . . . . . . . . . . 53
; 0069 ! 27. SEND_BREAK . . . . . . . . . . . . . . . . . . . . . . 54
; 0070 ! 28. REC_INIT . . . . . . . . . . . . . . . . . . . . . . . 55
; 0071 ! 29. REC_FILE . . . . . . . . . . . . . . . . . . . . . . . 56
; 0072 ! 30. REC_DATA . . . . . . . . . . . . . . . . . . . . . . . 57
; 0073 ! 31. SERVER - Generic commands. . . . . . . . . . . . . . . 58
; 0074 ! 32. HOST_COMMAND - perform a host command. . . . . . . . . 59
; 0075 ! 33. CALL_SY_RTN - handle operating system dependent functions 60
; 0076 ! 34. Message processing
; 0077 ! 34.1. PRS_SEND_INIT - Parse send init params. . . . 61
; 0078 ! 35. SET_SEND_INIT. . . . . . . . . . . . . . . . . . . . . 62
; 0079 ! 36. SEND_PACKET. . . . . . . . . . . . . . . . . . . . . . 63
; 0080 ! 37. REC_MESSAGE - Receive a message. . . . . . . . . . . . 64
; 0081 ! 38. REC_PACKET . . . . . . . . . . . . . . . . . . . . . . 65
; 0082 ! 39. CALC_BLOCK_CHECK . . . . . . . . . . . . . . . . . . . 66
; 0083 ! 40. NORMALIZE_FILE - Put file name into normal form. . . . 67
; 0084 ! 41. Buffer filling
; 0085 ! 41.1. Main routine. . . . . . . . . . . . . . . . . 68
; 0086 ! 42. BFR_EMPTY. . . . . . . . . . . . . . . . . . . . . . . 69
; 0087 ! 43. Buffer filling and emptying subroutines. . . . . . . . 70
; 0088 ! 44. Add parity routine . . . . . . . . . . . . . . . . . . 71
; 0089 ! 45. Parity routine . . . . . . . . . . . . . . . . . . . . 72
; 0090 ! 46. Per transfer
; 0091 ! 46.1. Initialization. . . . . . . . . . . . . . . . 73
; 0092 ! 47. Statistics
; 0093 ! 47.1. Finish message transfer . . . . . . . . . . . 74
; 0094 ! 48. Status type out
; 0095 ! 48.1. STS_OUTPUT. . . . . . . . . . . . . . . . . . 75
; 0096 ! 49. TYPE_CHAR - Type out a character . . . . . . . . . . . 76
; 0097 ! 50. Debugging
; 0098 ! 50.1. DBG_SEND. . . . . . . . . . . . . . . . . . . 77
; 0099 ! 50.2. DBG_RECEIVE . . . . . . . . . . . . . . . . . 78
; 0100 ! 50.3. DBG_MESSAGE . . . . . . . . . . . . . . . . . 79
; 0101 ! 51. End of KERMSG. . . . . . . . . . . . . . . . . . . . . 80
; 0102
; 0103 !.end lit.pag
; 0104 !-
; 0105 %SBTTL 'Revision History'
; 0106
; 0107 !++
; 0108 ! Start of version 1.
; 0109 !
; 0110 ! 1.0.000 By: Robert C. McQueen On: 4-Jan-1983
; 0111 ! Create this program.
; 0112 !
; 0113 ! 1.0.001 By: Robert C. McQueen On: 30-Apr-1983
; 0114 ! Change PAR_xxx to be PR_xxx, so that they can be used for
; 0115 ! KERMIT-10.
; 0116 !
; 0117 ! 1.0.002 By: Robert C. McQueen On: 1-May-1983
; 0118 ! Add DO_GENERIC routine to cause a generic Kermit command to
; 0119 ! be executed on the remote Kermit.
; 0120 !
; 0121 ! 1.0.003 By: Robert C. McQueen On: 3-May-1983
; 0122 ! Fix message number incrementing.
; 0123 !
; 0124 ! 1.0.004 By: Robert C. McQueen On: 4-May-1983
; 0125 ! Allow RECEIVE file-specification to work correctly.
; 0126 !
; 0127 ! 1.0.005 By: Robert C. McQueen On: 6-May-1983
; 0128 ! Add more stats support.
; 0129 !
; 0130 ! 1.0.006 By: Nick Bush On: 13-June-1983
; 0131 ! Fix SEND_PACKET to copy correct characters when fixing
; 0132 ! parity bits.
; 0133 !
; 0134 ! 1.1.007 By: Nick Bush On: 15-July-1983
; 0135 ! Correct SEND-INIT message handling to do the right things
; 0136 ! with the protocol version 3 items.
; 0137 !
; 0138 ! 1.1.010 By: Robert C. McQueen On: 20-July-1983
; 0139 ! Make PARITY a global routine, so that it can be called by
; 0140 ! CONNECT processing. Change the name from PARITY to GEN_PARITY
; 0141 ! add a new routine to generate the parity, since it is not
; 0142 ! part of the checksum.
; 0143 !
; 0144 ! 1.1.011 By: Robert C. McQueen On: 28-July-1983
; 0145 ! KER_TIMEOUT errors in the SERVER loop would cause
; 0146 ! KER_UNISRV error messages to be returned to the remote.
; 0147 ! Check for receive failures and send NAKs instead.
; 0148 !
; 0149 ! 1.2.012 By: Robert C. McQueen On: 23-August-1983
; 0150 ! Don't abort if we get a message that is just an end of line
; 0151 ! character. It could be noise on the line.
; 0152 !
; 0153 ! 1.2.013 By: Nick Bush On: 7-September-1983
; 0154 ! Fix several problems with the SEND_xxx parameters
; 0155 !
; 0156 ! 1.2.014 By: Robert C. McQueen On: 15-September-1983
; 0157 ! Add routine calls to XFR_STATUS to tell the user on the
; 0158 ! number of packets have changed.
; 0159 !
; 0160 ! 1.2.015 By: Nick Bush On: 5-October-1983
; 0161 ! Add 2 and 3 character checksum (block check) support.
; 0162 ! Add support for data within acknowledgement packets
; 0163 ! and withing end-of-file packets to allow for file
; 0164 ! transmission to be aborted. Also add support for
; 0165 ! "I" packet to allow server parameters to be initialized.
; 0166 !
; 0167 ! 1.2.016 By: Nick Bush On: 19-October-1983
; 0168 ! Add repeat character support.
; 0169 !
; 0170 ! 2.0.017 Release TOPS-10 Kermit-10 version 2.0
; 0171 ! Release VAX/VMS Kermit-32 version 2.0
; 0172 !
; 0173 ! 2.0.018 By: Robert C. McQueen On: 16-November-1983
; 0174 ! Fix four checks on the message number that were not
; 0175 ! mod 64.
; 0176 !
; 0177 ! 2.0.019 By: Robert C. McQueen On: 16-November-1983
; 0178 ! Remove the CLEAR routine. It is not really needed.
; 0179 !
; 0180 ! 2.0.020 By: Nick Bush On: 12-Dec-1983
; 0181 ! Fix SEND_DATA and BFR_FILL to handle empty files and
; 0182 ! files which happen to end just on a message boundary.
; 0183 ! This would sometimes produce extra nulls.
; 0184 !
; 0185 ! 2.0.021 By: Nick Bush On: 15-Dec-1983
; 0186 ! Fix some problems with REC_MESSAGE which would cause
; 0187 ! aborts when a message timed out.
; 0188 !
; 0189 ! 2.0.022 By: Robert C. McQueen 19-Dec-1983
; 0190 ! Make STATUS a local for most routines and remove FILE_DUMP
; 0191 ! as it is nolonger needed.
; 0192 !
; 0193 ! 2.0.023 By: Nick Bush On: 3-Jan-1984
; 0194 ! Change FIL_NORMAL_FORM to contain not just a flag, but
; 0195 ! a file name type instead.
; 0196 !
; 0197 ! 2.0.024 By: Nick Bush On: 11-Jan-1984
; 0198 ! Fix REC_MESSAGE to send NAK for packet we expect, not
; 0199 ! previous packet.
; 0200 !
; 0201 ! 2.0.025 By: Nick Bush On: 23-Jan-1984
; 0202 ! Re-enable server-init packet and complete code so that
; 0203 ! parameters set by it will remain set.
; 0204 ! Fix file name copying to use BFR_FILL or BFR_EMPTY
; 0205 ! so that all quoting/compression is done properly.
; 0206 !
; 0207 ! 2.0.026 By: Nick Bush On: 15-Feb-1984
; 0208 ! Add code for generic command support (both directions).
; 0209 ! There is now only one state dispatch loop, entered
; 0210 ! in various states for different functions.
; 0211 !
; 0212 ! 2.0.027 By: Robert C. McQueen On: 16-Feb-1984
; 0213 ! At some point SEND_TIMEOUT became global, but it was not moved
; 0214 ! to KERGLB. This edit moves it to KERGLB.BLI.
; 0215 !
; 0216 ! 2.0.030 By: Nick Bush On: 2-March-1984
; 0217 ! Fix BFR_FILL to handle case of last repeated character
; 0218 ! not fitting within a packet. It was forgetting to
; 0219 ! send the characters at all.
; 0220 !
; 0221 ! 2.0.031 By: Nick Bush On: 6-March-1984
; 0222 ! Make sure FILE_OPEN_FLAG is set properly when advancing
; 0223 ! to next file of a wild-card send. The file was not
; 0224 ! being set true, leading to problems after a couple files.
; 0225 !
; 0226 ! 2.0.032 By: Nick Bush On: 9-March-1984
; 0227 ! Fix UNPACK_DATA in SERVER_GENERIC to properly store
; 0228 ! new string pointer.
; 0229 !
; 0230 ! 2.0.033 By: Robert C. McQueen On: 12-March-1984
; 0231 ! If NEXT_FILE fails with anything other than a NOMORFILES
; 0232 ! it should change state to STATE_A not STATE_SB. This
; 0233 ! fixes a problem caused by Pro/Kermit and KERFIL (VMS).
; 0234 !
; 0235 ! 2.0.034 By: Nick Bush On: 15-March-1984
; 0236 ! Put file spec into X packet as well as F packet. This
; 0237 ! makes wild card TYPE's work nicer.
; 0238 !
; 0239 ! 2.0.035 By: Nick Bush On: 20-March-1984
; 0240 ! Fix send/receive quoting to conform to the way the
; 0241 ! protocol manual says it should be done, rather
; 0242 ! than the way we (and Kermit-20) have always done it.
; 0243 !--
; 0244
; 0245 %SBTTL 'Interface requirements'
; 0246
; 0247 !++
; 0248 ! Interface requirements
; 0249 !
; 0250 ! The following routines and data locations are rquired for a correct
; 0251 ! implementation of KERMIT.
; 0252 !
; 0253 ! File routines:
; 0254 !
; 0255 ! FILE_OPEN (Function)
; 0256 ! This routine will open a file for reading or writting. It
; 0257 ! will assume that FILE_SIZE contains the number of bytes
; 0258 ! and FILE_NAME contains the file name of length FILE_SIZE.
; 0259 ! The function that is passed is either FNC_READ or FNC_WRITE.
; 0260 !
; 0261 ! FILE_CLOSE ()
; 0262 ! This routine will close the currently open file. This
; 0263 ! routine will return the status of the operation.
; 0264 !
; 0265 ! GET_FILE (Character)
; 0266 ! This routine will get a character from the currently open file
; 0267 ! and store it in the location specified by "Character". There
; 0268 ! will be a true/false value returned by the routine to determine
; 0269 ! if there was an error.
; 0270 !
; 0271 ! PUT_FILE (Character)
; 0272 ! This routine will output a character to the currently open
; 0273 ! file. It will return a true/false value to determine if the
; 0274 ! routine was successful.
; 0275 !
; 0276 ! NEXT_FILE ()
; 0277 ! This routine will advance to the next file. This routine
; 0278 ! will return false if there are no more files to process.
; 0279 !
; 0280 ! Communications line routines:
; 0281 !
; 0282 ! RECEIVE (Buffer address, Address of var to store length into)
; 0283 ! This routine will receive a message from the remote Kermit.
; 0284 !
; 0285 ! SEND (Buffer address, Length in characters)
; 0286 ! This routine will send a message to the remote Kermit.
; 0287 !
; 0288 ! GEN_CRC (Buffer address, length in characters)
; 0289 ! This routine will calculate the CRC-CCITT for the characters
; 0290 ! in the buffer.
; 0291 !
; 0292 ! Operating system routines:
; 0293 !
; 0294 ! SY_DISMISS (Seconds)
; 0295 ! This routine will cause Kermit to sleep for the specified
; 0296 ! number of seconds. It is used to handle the DELAY parameter.
; 0297 !
; 0298 ! SY_LOGOUT ()
; 0299 ! Log the job off of the system. (Kill the process).
; 0300 !
; 0301 ! SY_TIME ()
; 0302 ! This routine will return the starting time milliseconds.
; 0303 ! It can be the start of Kermit, the system, etc, so long
; 0304 ! as it always is incrementing.
; 0305 !
; 0306 ! Status routines:
; 0307 !
; 0308 ! XFR_STATUS (Type, Subtype);
; 0309 ! This routine is called to indicate the occurance of
; 0310 ! a significant event that the user interface may wish
; 0311 ! to inform the user about. The arguments indicate the
; 0312 ! type of event.
; 0313 ! Type: "S" - Send, "R" - Receive
; 0314 ! Subtype: "P" - Packet
; 0315 ! "N" - NAK
; 0316 ! "T" - timeout
; 0317 ! For type = "I" (initiate), "T" (terminate):
; 0318 ! Subtype: "S" - a file send
; 0319 ! "R" - a file receive
; 0320 ! "G" - a generic command
; 0321 ! "I" - for "T" only, returning to server idle
; 0322 ! For type = "F" (file operation):
; 0323 ! Subtype: "S" - open for sending
; 0324 ! "R" - open for receiving
; 0325 ! "C" - closing file OK
; 0326 ! "X" - aborting file by user request
; 0327 ! "Z" - aborting group by user request
; 0328 ! "D" - aborting file, but saving due to disposition
; 0329 ! "A" - aborting file due to protocol error
; 0330 !
; 0331 ! Error processing:
; 0332 !
; 0333 ! KRM_ERROR (Error parameter)
; 0334 ! This routine will cause an error message to be issued.
; 0335 ! The error parameter is defined by KERERR. This may cause
; 0336 ! SND_ERROR to be called to send an "E" message to the remote.
; 0337 !
; 0338 ! Terminal I/O routines:
; 0339 !
; 0340 ! TERM_DUMP (Buffer, Count)
; 0341 ! DBG_DUMP (Buffer, Count)
; 0342 ! This routine will dump the buffer onto the user's terminal.
; 0343 ! The routine is supplied with the count of the characters
; 0344 ! and the address of the buffer.
; 0345 ! These may be the same routine or different. DBG_DUMP
; 0346 ! is only called for debugging output.
; 0347 !
; 0348 !
; 0349 ! ENTRY POINTS
; 0350 !
; 0351 ! KERMSG contains the following entry points for the KERMIT.
; 0352 !
; 0353 ! SERVER ()
; 0354 ! This routine will cause KERMIT go enter server mode.
; 0355 !
; 0356 ! SEND_SWITCH ()
; 0357 ! This routine will send a file. It expects that the user
; 0358 ! has stored the text of the file name into FILE_NAME and
; 0359 ! the length of the text into FILE_SIZE.
; 0360 !
; 0361 ! REC_SWITCH ()
; 0362 ! This routine will receive a file. It expects that the default
; 0363 ! file name is set up in FILE_NAME and the length is in
; 0364 ! FILE_SIZE.
; 0365 !
; 0366 ! GEN_PARITY (Character)
; 0367 ! This routine will return the character with the proper parity
; 0368 ! on the character.
; 0369 !
; 0370 ! SND_ERROR (COUNT, ADDRESS)
; 0371 ! This routine will send the text of an error to the remote
; 0372 ! Kermit.
; 0373 !
; 0374 ! DO_GENERIC (TYPE)
; 0375 ! This routine will cause a generic function to be sent to
; 0376 ! the remote Kermit. This routine will then do all of the
; 0377 ! necessary hand shaking to handle the local end of the generic
; 0378 ! Kermit command.
; 0379 !
; 0380 !
; 0381 ! GLOBAL Storage
; 0382 !
; 0383 ! The following are the global storage locations that are used to interface
; 0384 ! to KERMSG. These locations contains the various send and receive parameters.
; 0385 !
; 0386 ! Receive parameters:
; 0387 !
; 0388 ! RCV_PKT_SIZE
; 0389 ! Receive packet size.
; 0390 ! RCV_NPAD
; 0391 ! Padding length
; 0392 ! RCV_PADCHAR
; 0393 ! Padding character
; 0394 ! RCV_TIMEOUT
; 0395 ! Time out
; 0396 ! RCV_EOL
; 0397 ! End of line character
; 0398 ! RCV_QUOTE_CHR
; 0399 ! Quote character
; 0400 ! RCV_8QUOTE_CHR
; 0401 ! 8-bit quoting character
; 0402 ! RCV_SOH
; 0403 ! Start of header character
; 0404 !
; 0405 ! Send parameters (Negative values denote the default, positive user supplied):
; 0406 !
; 0407 ! SND_PKT_SIZE
; 0408 ! Send packet size
; 0409 ! SND_NPAD
; 0410 ! Padding length
; 0411 ! SND_PADCHAR
; 0412 ! Padding character
; 0413 ! SND_TIMEOUT
; 0414 ! Time out
; 0415 ! SND_EOL
; 0416 ! End of line character
; 0417 ! SND_QUOTE_CHR
; 0418 ! Quote character
; 0419 ! SND_SOH
; 0420 ! Start of header character (normally 001)
; 0421 !
; 0422 ! Statistics:
; 0423 !
; 0424 ! SND_TOTAL_CHARS
; 0425 ! Total characters sent for this Kermit session
; 0426 ! RCV_TOTAL_CHARS
; 0427 ! Total characters received for this Kermit session
; 0428 ! SND_DATA_CHARS
; 0429 ! Total number of data characters sent for this Kermit session
; 0430 ! RCV_DATA_CHARS
; 0431 ! Total number of data characters received for this Kermit session
; 0432 ! SND_COUNT
; 0433 ! Total number of packets that have been sent
; 0434 ! RCV_COUNT
; 0435 ! Total number of packets that have been received.
; 0436 ! SMSG_TOTAL_CHARS
; 0437 ! Total characters sent for this file transfer
; 0438 ! RMSG_TOTAL_CHARS
; 0439 ! Total characters received for this file transfer
; 0440 ! SMSG_DATA_CHARS
; 0441 ! Total data characters sent for this file transfer
; 0442 ! RMSG_DATA_CHARS
; 0443 ! Total data characters received for this file transfer
; 0444 ! SMSG_NAKS
; 0445 ! Total number of NAKs sent for this file transfer
; 0446 ! RMSG_NAKS
; 0447 ! Total number of NAKs received for this file transfer
; 0448 ! XFR_TIME
; 0449 ! Amount of time the last transfer took in milliseconds.
; 0450 ! TOTAL_TIME
; 0451 ! Total amount of time spend transfering data.
; 0452 !
; 0453 ! Misc constants:
; 0454 !
; 0455 ! LAST_ERROR
; 0456 ! ASCIZ of the last error message issued.
; 0457 ! FILE_NAME
; 0458 ! Vector containing the ASCII characters of the file name.
; 0459 ! FILE_SIZE
; 0460 ! Number of characters in the FILE_NAME vector.
; 0461 ! DELAY
; 0462 ! Amount of time to delay
; 0463 ! DUPLEX
; 0464 ! DP_HALF or DP_FULL to denote either half duplex or full duplex.
; 0465 ! [Currently only DP_FULL is supported]
; 0466 ! PKT_RETRIES
; 0467 ! Number of retries to attempt to read a message.
; 0468 ! SI_RETRIES
; 0469 ! Number of retries to attempt on send inits
; 0470 ! DEBUG_FLAG
; 0471 ! Debugging mode on/off
; 0472 ! WARN_FLAG
; 0473 ! File warning flag
; 0474 ! IBM_FLAG
; 0475 ! True if talking to an IBM system, else false.
; 0476 ! ECHO_FLAG
; 0477 ! Local echo flag
; 0478 ! CONNECT_FLAG
; 0479 ! Connected flag; True if terminal and SET LINE are the same
; 0480 ! PARITY_TYPE
; 0481 ! Type of parity to use on sends.
; 0482 ! DEV_PARITY_FLAG
; 0483 ! Device will add parity to message. True if device adds
; 0484 ! parity and false if we must do it.
; 0485 !
; 0486 !--
; 0487
; 0488 %SBTTL 'Declarations -- Forward definitions'
; 0489 !<BLF/NOFORMAT>
; 0490 !
; 0491 ! Forward definitions
; 0492 !
; 0493
; 0494 FORWARD ROUTINE
; 0495
; 0496 ! Main loop for a complete transaction
; 0497 DO_TRANSACTION, ! Perform a complete transaction
; 0498
; 0499 ! Send processing routines
; 0500
; 0501 SEND_SERVER_INIT, ![026] Send a server init packet
; 0502 SEND_DATA, ! Send data to the micro
; 0503 SEND_FILE, ! Send file name
; 0504 SEND_OPEN_FILE, ! Open file for sending
; 0505 SEND_GENCMD, ! Send generic command
; 0506 SEND_EOF, ! Send EOF
; 0507 SEND_INIT, ! Send initialization msg
; 0508 SEND_BREAK, ! Send break end of transmission
; 0509
; 0510 ! Receive processing routines
; 0511
; 0512 REC_SERVER_IDLE, ! Wait for message while server is idle
; 0513 REC_INIT, ! Receive initialization
; 0514 REC_FILE, ! Receive file information
; 0515 REC_DATA, ! Receive data
; 0516 !
; 0517 ! Server processing routines
; 0518 !
; 0519 SERVER_GENERIC, ! Process generic KERMIT commands
; 0520 HOST_COMMAND, ! Process host command
; 0521 CALL_SY_RTN, ! Handle calling system routine and returning result
; 0522 !
; 0523 ! Statistic gathering routines
; 0524 !
; 0525 END_STATS : NOVALUE, ! End of a message processing stats routine
; 0526
; 0527 ! Low level send/receive routines
; 0528
; 0529 CALC_BLOCK_CHECK, ! Routine to calculate the block check value
; 0530 SET_SEND_INIT : NOVALUE, ! Set up the MSG_SND_INIT parameters.
; 0531 PRS_SEND_INIT, ! Parse MSG_SND_INIT parameters.
; 0532 DO_PARITY : NOVALUE, ! Routine to generate parity for a message
; 0533 GEN_PARITY, ! Routine to add parity to a character
; 0534 SEND_PACKET, ! Send a packet to the remote
; 0535 REC_MESSAGE, ! Receive a message with retry processing
; 0536 REC_PACKET, ! Receive a packet from the remote
; 0537
; 0538 ! Utility routines
; 0539
; 0540 NORMALIZE_FILE : NOVALUE, ! Force file name into normal form
; 0541 BFR_EMPTY, ! Empty the data buffer
; 0542 BFR_FILL, ! Fill the data buffer from a file
; 0543 SET_STRING, ![025] Routine to set alternate get/put routines
; 0544 ! for use with in memory strings
; 0545 TYPE_CHAR, ! Type a character from a packet
; 0546 INIT_XFR : NOVALUE, ! Initialize the per transfer processing
; 0547 STS_OUTPUT : NOVALUE, ! Output current transfer status
; 0548 !
; 0549 ! Debugging routines
; 0550 !
; 0551 DBG_MESSAGE : NOVALUE, ! Type out a formatted message
; 0552 DBG_SEND : NOVALUE, ! Send message debugging routine
; 0553 DBG_RECEIVE : NOVALUE; ! Receive message debugging routine
; 0554 %SBTTL 'Require files'
; 0555
; 0556 !
; 0557 !<BLF/FORMAT>
; 0558 !
; 0559 ! REQUIRE FILES:
; 0560 !
; 0561
; L 0562 %IF %BLISS (BLISS32)
; U 0563 %THEN
; U 0564
; U 0565 LIBRARY 'SYS$LIBRARY:STARLET';
; U 0566
; 0567 %FI
; 0568
; 0569 REQUIRE 'KERCOM';
; 0769
; 0770 REQUIRE 'KERERR';
; 0799
; 0800 %SBTTL 'Macro definitions'
; 0801 !
; 0802 ! MACROS:
; 0803 !
; 0804
; 0805 MACRO
; M 0806 CTL (C) =
; 0807 ((C) XOR %O'100')%,
; M 0808 CHAR (C) =
; 0809 ((C) + %O'40')%,
; M 0810 UNCHAR (C) =
; 0811 ((C) - %O'40')%;
; 0812
; 0813 %SBTTL 'KERMIT Protocol Definitions'
; 0814
; 0815 !++
; 0816 ! The following describes the various items that are found in the
; 0817 ! KERMIT messages. A complete and through desription of the protocol can be
; 0818 ! found in the KERMIT PROTOCOL MANUAL.
; 0819 !
; 0820 !
; 0821 ! All KERMIT messages have the following format:
; 0822 !
; 0823 ! <Mark><CHAR(Count)><CHAR(Seq)><Message-dependent information><Check><EOL>
; 0824 !
; 0825 ! <MARK>
; 0826 ! Normally SOH (Control-A, octal 001).
; 0827 !
; 0828 ! <CHAR(Count)>
; 0829 ! Count of the number of characters following this position.
; 0830 ! Character counts of ONLY 0 to 94 are valid.
; 0831 !
; 0832 ! <CHAR(Seq)>
; 0833 ! Packet sequence number, modulo 100 (octal).
; 0834 !
; 0835 ! <MESSAGE-DEPENDENT INFORMATION>
; 0836 ! This field contains the message dependent information. There can
; 0837 ! be multiple fields in this section. See the KERMIT Protocol document
; 0838 ! for a complete description of this.
; 0839 !
; 0840 ! <Check>
; 0841 ! A block check on the characters in the packet between, but not
; 0842 ! including, the mark and the checksum itself. It may be one to three
; 0843 ! characters, depending upon the type agreed upon.
; 0844 !
; 0845 ! 1. Single character arithmetic sum equal to:
; 0846 ! chksum = (s + ((s AND 300)/100)) AND 77
; 0847 ! Character sent is CHAR(chksum).
; 0848 !
; 0849 ! 2. Two character arithmetic sum. CHAR of bits 6-11 are the first
; 0850 ! character, CHAR of bits 0-5 are the second character.
; 0851 !
; 0852 ! 3. Three character CRC-CCITT. First character is CHAR of bits 12-15,
; 0853 ! second is CHAR of bits 6-11, third is CHAR of bits 0-5.
; 0854 !
; 0855 !
; 0856 ! <EOL>
; 0857 ! End of line. Any line terminator that may be required by the host.
; 0858 !--
; 0859
; 0860 %SBTTL 'KERMIT Protocol Definitions -- Packet offsets'
; 0861
; 0862 !++
; 0863 ! The following define the various offsets of the standard KERMIT
; 0864 ! packets.
; 0865 !--
; 0866
; 0867 LITERAL
; 0868 PKT_MARK = 0, ! <MARK>
; 0869 PKT_COUNT = 1, ! <CHAR(Count)>
; 0870 PKT_SEQ = 2, ! <CHAR(Seq)>
; 0871 PKT_TYPE = 3, ! <Message type>
; 0872 PKT_MSG = 4, ! <MESSAGE-DEPENDENT INFORMATION>
; 0873 PKT_MAX_MSG = 94 - 5, ! Maximum size of the message dependent
; 0874 ! information
; 0875 PKT_CHKSUM = 0, ! <CHAR(Chksum)> offset from end of
; 0876 ! Message dependent information
; 0877 PKT_EOL = 1, ! <Eol> offset from end of data
; 0878 PKT_OVR_HEAD_B = 2, ! Header overhead
; 0879 PKT_OVR_HEAD_E = 1, ! Overhead at the end
; 0880 PKT_OVR_HEAD = 3, ! Overhead added to data length
; 0881 PKT_TOT_OVR_HEAD = 6; ! Total overhead of the message
; 0882
; 0883 %SBTTL 'KERMIT Protocol Definitions -- Message dependent field'
; 0884
; 0885 !++
; 0886 ! The MESSAGE-DEPENDENT information field of the message contains at
; 0887 ! least one part. That is the type of message. The remainder of the message
; 0888 ! MESSAGE-DEPENDENT field is different depending on the message.
; 0889 !
; 0890 ! <TYPE><TYPE-DEPENDENT-INFORMATION>
; 0891 !
; 0892 ! <TYPE>
; 0893 ! The type defines the type of message that is being processed.
; 0894 !
; 0895 !--
; 0896
; 0897 ! Protocol version 1.0 message types
; 0898
; 0899 LITERAL
; 0900 MSG_DATA = %C'D', ! Data packet
; 0901 MSG_ACK = %C'Y', ! Acknowledgement
; 0902 MSG_NAK = %C'N', ! Negative acknowledgement
; 0903 MSG_SND_INIT = %C'S', ! Send initiate
; 0904 MSG_BREAK = %C'B', ! Break transmission
; 0905 MSG_FILE = %C'F', ! File header
; 0906 MSG_EOF = %C'Z', ! End of file (EOF)
; 0907 MSG_ERROR = %C'E'; ! Error
; 0908
; 0909 ! Protocol version 2.0 message types
; 0910
; 0911 LITERAL
; 0912 MSG_RCV_INIT = %C'R', ! Receive initiate
; 0913 MSG_COMMAND = %C'C', ! Host command
; 0914 MSG_KERMIT = %C'G'; ! Generic KERMIT command.
; 0915
; 0916 ! Protocol version 4.0 message types
; 0917
; 0918 LITERAL
; 0919 MSG_SER_INIT = %C'I', ! Server initialization
; 0920 MSG_TEXT = %C'X'; ! Text header message
; 0921
; 0922 !++
; 0923 ! Generic KERMIT commands
; 0924 !--
; 0925
; 0926 LITERAL
; 0927 MSG_GEN_LOGIN = %C'I', ! Login
; 0928 MSG_GEN_EXIT = %C'F', ! Finish (exit to OS)
; 0929 MSG_GEN_CONNECT = %C'C', ! Connect to a directory
; 0930 MSG_GEN_LOGOUT = %C'L', ! Logout
; 0931 MSG_GEN_DIRECTORY = %C'D', ! Directory
; 0932 MSG_GEN_DISK_USAGE = %C'U', ! Disk usage
; 0933 MSG_GEN_DELETE = %C'E', ! Delete a file
; 0934 MSG_GEN_TYPE = %C'T', ! Type a file specification
; 0935 ! MSG_GEN_SUBMIT = %C'S', ! Submit
; 0936 ! MSG_GEN_PRINT = %C'P', ! Print
; 0937 MSG_GEN_WHO = %C'W', ! Who's logged in
; 0938 MSG_GEN_SEND = %C'M', ! Send a message to a user
; 0939 MSG_GEN_HELP = %C'H', ! Help
; 0940 MSG_GEN_QUERY = %C'Q', ! Query status
; 0941 MSG_GEN_RENAME = %C'R', ! Rename file
; 0942 MSG_GEN_COPY = %C'K'; ! Copy file
; 0943
; 0944 !
; 0945 ! Acknowledgement modifiers (protocol 4.0)
; 0946 !
; 0947
; 0948 LITERAL
; 0949 MSG_ACK_ABT_CUR = %C'X', ! Abort current file
; 0950 MSG_ACK_ABT_ALL = %C'Z'; ! Abort entire stream of files
; 0951
; 0952 !
; 0953 ! End of file packet modifier
; 0954 !
; 0955
; 0956 LITERAL
; 0957 MSG_EOF_DISCARD = %C'D'; ! Discard data from previous file
; 0958
; 0959 %SBTTL 'KERMIT Protocol Definitions -- SEND initiate packet'
; 0960
; 0961 !++
; 0962 !
; 0963 ! The following describes the send initiate packet. All fields in the message
; 0964 ! data area are optional.
; 0965 !
; 0966 ! <"S"><CHAR(Bufsiz)><CHAR(Timeout)><CHAR(npad)><CTL(pad)><CHAR(Eol)><Quote>
; 0967 ! <8-bit-quote><Check-type><Repeat-count-processing><Reserved><Reserved>
; 0968 !
; 0969 ! BUFSIZ
; 0970 ! Sending Kermit's maximum buffer size.
; 0971 !
; 0972 ! Timeout
; 0973 ! Number of seconds after which the sending Kermit wishes to be timed out
; 0974 !
; 0975 ! Npad
; 0976 ! Number of padding caracters the sending Kermit needs preceding each
; 0977 ! packet.
; 0978 !
; 0979 ! PAD
; 0980 ! Padding character.
; 0981 !
; 0982 ! EOL
; 0983 ! A line terminator required on all packets set by the receiving
; 0984 ! Kermit.
; 0985 !
; 0986 ! Quote
; 0987 ! The printable ASCII characer the sending Kermit will use when quoting
; 0988 ! the control cahracters. Default is "#".
; 0989 !
; 0990 ! 8-bit-quote
; 0991 ! Specify quoting mecanism for 8-bit quantities. A quoting mecanism is
; 0992 ! mecessary when sending to hosts which prevent the use of the 8th bit
; 0993 ! for data. When elected, the quoting mechanism will be used by both
; 0994 ! hosts, and the quote character must be in the range of 41-76 or 140-176
; 0995 ! octal, but different from the control-quoting character. This field is
; 0996 ! interpreted as follows:
; 0997 !
; 0998 ! "Y" - I agree to 8-bit quoting if you request it.
; 0999 ! "N" - I will not do 8-bit quoting.
; 1000 ! "&" - (or any other character in the range of 41-76 or 140-176) I want
; 1001 ! to do 8-bit quoting using this character (it will be done if the
; 1002 ! other Kermit puts a "Y" in this field.
; 1003 ! Anything else: Quoting will not be done.
; 1004 !
; 1005 ! Check-type
; 1006 ! Type of block check. The only values presently allowed in this
; 1007 ! field are "1", "2" or "3". Future implementations may allow other
; 1008 ! values. Interpretation of the values is:
; 1009 !
; 1010 ! "1" - Single character checksum. Default value if none specified.
; 1011 ! "2" - Double character checksum.
; 1012 ! "3" - Three character CRC.
; 1013 !
; 1014 ! Repeat-count-processing
; 1015 ! The prefix character to be used to indicate a repeated character.
; 1016 ! This can be any printable cahracter other than blank (which denotes
; 1017 ! no repeat count).
; 1018 !
; 1019 ! Fields 10 to 11 reserved.
; 1020 !--
; 1021
; 1022 LITERAL
; 1023 P_SI_BUFSIZ = 0, ! Buffersize
; 1024 MY_PKT_SIZE = 80, ! My packet size
; 1025 P_SI_TIMOUT = 1, ! Time out
; 1026 MY_TIME_OUT = 15, ! My time out
; 1027 P_SI_NPAD = 2, ! Number of padding characters
; 1028 MY_NPAD = 0, ! Amount of padding I require
; 1029 P_SI_PAD = 3, ! Padding character
; 1030 MY_PAD_CHAR = 0, ! My pad character
; 1031 P_SI_EOL = 4, ! End of line character
; 1032 MY_EOL_CHAR = %O'015', ! My EOL cahracter
; 1033 P_SI_QUOTE = 5, ! Quote character
; 1034 MY_QUOTE_CHAR = %C'#', ! My quoting character
; 1035 P_SI_8QUOTE = 6, ! 8-bit quote
; 1036 MY_8BIT_QUOTE = %C'&', ! Don't do it
; 1037 P_SI_CHKTYPE = 7, ! Checktype used
; 1038 MY_CHKTYPE = CHK_1CHAR, ! Use single character checksum
; 1039 P_SI_REPEAT = 8, ! Repeat character
; 1040 MY_REPEAT = %C'~', ! My repeat character
; 1041 P_SI_LENGTH = 9; ! Length of the message
; 1042
; 1043 %SBTTL 'KERMIT Protocol States'
; 1044
; 1045 !++
; 1046 ! The following are the various states that KERMIT can be in.
; 1047 ! The state transitions are defined in the KERMIT Protocol manual.
; 1048 !--
; 1049
; 1050 LITERAL
; 1051 STATE_MIN = 1, ! Min state number
; 1052 STATE_S = 1, ! Send init state
; 1053 STATE_SF = 2, ! Send file header
; 1054 STATE_SD = 3, ! Send file data packet
; 1055 STATE_SZ = 4, ! Send EOF packet
; 1056 STATE_SB = 5, ! Send break
; 1057 STATE_R = 6, ! Receive state (wait for send-init)
; 1058 STATE_RF = 7, ! Receive file header packet
; 1059 STATE_RD = 8, ! Receive file data packet
; 1060 STATE_C = 9, ! Send complete
; 1061 STATE_A = 10, ! Abort
; 1062 STATE_SX = 11, ! Send text header
; 1063 STATE_SG = 12, ! Send generic command
; 1064 STATE_SI = 13, ! Send server init
; 1065 STATE_ID = 14, ! Server idle loop
; 1066 STATE_II = 15, ! Server idle after server init
; 1067 STATE_FI = 16, ! Server should exit
; 1068 STATE_LG = 17, ! Server should logout
; 1069 STATE_OF = 18, ! Send - open first input file
; 1070 STATE_EX = 19, ! Exit back to command parser
; 1071 STATE_MAX = 19; ! Max state number
; 1072
; 1073 %SBTTL 'Internal constants'
; 1074
; 1075 !++
; 1076 ! The following represent various internal KERMSG constants.
; 1077 !--
; 1078
; 1079 LITERAL
; 1080 MAX_PKT_RETRIES = 16, ! Maximum packet retries
; 1081 MAX_SI_RETRIES = 5; ! Maximum send init retries
; 1082
; 1083 %SBTTL 'Storage - External'
; 1084 !
; 1085 ! OWN STORAGE:
; 1086 !
; 1087
; 1088 EXTERNAL
; 1089 !
; 1090 ! Receive parameters
; 1091 !
; 1092 RCV_PKT_SIZE, ! Receive packet size
; 1093 RCV_NPAD, ! Padding length
; 1094 RCV_PADCHAR, ! Padding character
; 1095 RCV_TIMEOUT, ! Time out
; 1096 RCV_EOL, ! EOL character
; 1097 RCV_QUOTE_CHR, ! Quote character
; 1098 RCV_SOH, ! Start of header character
; 1099 RCV_8QUOTE_CHR, ! 8-bit quoting character
; 1100 !
; 1101 ! Miscellaneous parameters
; 1102 !
; 1103 SET_REPT_CHR, ! Repeat character
; 1104 !
; 1105 ! Send parameters
; 1106 !
; 1107 SND_PKT_SIZE, ! Send packet size
; 1108 SND_NPAD, ! Padding length
; 1109 SND_PADCHAR, ! Padding character
; 1110 SND_TIMEOUT, ! Time out
; 1111 SND_EOL, ! EOL character
; 1112 SND_QUOTE_CHR, ! Quote character
; 1113 SND_SOH, ! Start of header character
; 1114 SEND_TIMEOUT, ! Time to wait for receiving message
; 1115 !
; 1116 ! Statistics
; 1117 !
; 1118 SND_TOTAL_CHARS, ! Total characters sent
; 1119 RCV_TOTAL_CHARS, ! Total characters received
; 1120 SND_DATA_CHARS, ! Total number of data characters sent
; 1121 RCV_DATA_CHARS, ! Total number of data characters received
; 1122 SND_NAKS, ! Total NAKs sent
; 1123 RCV_NAKS, ! Total NAKs received
; 1124 SND_COUNT, ! Count of total number of packets
; 1125 RCV_COUNT, ! Count of total number packets received
; 1126 SMSG_COUNT, ! Total number of packets sent
; 1127 RMSG_COUNT, ! Total number of packets received
; 1128 SMSG_TOTAL_CHARS, ! Total chars sent this file xfer
; 1129 RMSG_TOTAL_CHARS, ! Total chars rcvd this file xfer
; 1130 SMSG_DATA_CHARS, ! Total data chars this file xfer
; 1131 RMSG_DATA_CHARS, ! Total data chars this file xfer
; 1132 SMSG_NAKS, ! Total number of NAKs this file xfer
; 1133 RMSG_NAKS, ! Total number of NAKs received
; 1134 XFR_TIME, ! Amount of time last xfr took
; 1135 TOTAL_TIME, ! Total time of all xfrs
; 1136 ! this file xfer
; 1137 LAST_ERROR : VECTOR [CH$ALLOCATION (MAX_MSG + 1)], ! Last error message
; 1138 !
; 1139 ! Misc constants.
; 1140 !
; 1141 FILE_NAME : VECTOR [CH$ALLOCATION (MAX_FILE_NAME)],
; 1142 FILE_SIZE,
; 1143 SI_RETRIES, ! Send init retries to attempt
; 1144 PKT_RETRIES, ! Number of retries to try for a message
; 1145 DELAY, ! Amount of time to delay
; 1146 DUPLEX, ! Type of connection (half or full)
; 1147 PARITY_TYPE, ! Type of parity to use
; 1148 DEV_PARITY_FLAG, ! True if output device does
; 1149 ! parity, false if we do it
; 1150 CHKTYPE, ! Type of block check desired
; 1151 ABT_FLAG, ! True if aborted file should be discarded
; 1152 DEBUG_FLAG, ! Debugging mode on/off
; 1153 WARN_FLAG, ! File warning flag
; 1154 IBM_FLAG, ! Talking to an IBM system
; 1155 IBM_CHAR, ! Turnaround character for IBM mode
; 1156 ECHO_FLAG, ! Local echo flag
; 1157 CONNECT_FLAG, ! Connected flag; True if
; 1158 ! terminal and SET LINE are
; 1159 ! the same
; 1160 ABT_CUR_FILE, ! Abort current file
; 1161 ABT_ALL_FILE, ! Abort all files in stream
; 1162 TYP_STS_FLAG, ! Type status next message
; 1163 TY_FIL, ! Type file specs
; 1164 TY_PKT, ! Type packet info
; 1165 FIL_NORMAL_FORM, ! If true, file names should be normalized
; 1166 GEN_1DATA : VECTOR [CH$ALLOCATION (MAX_MSG)], ! Data for generic command
; 1167 GEN_1SIZE, ! Size of data in GEN_1DATA
; 1168 GEN_2DATA : VECTOR [CH$ALLOCATION (MAX_MSG)], ! Second argument for generic command
; 1169 GEN_2SIZE, ! Size of data in GEN_2DATA
; 1170 GEN_3DATA : VECTOR [CH$ALLOCATION (MAX_MSG)], ! Third arg for generic command
; 1171 GEN_3SIZE; ! Size of data in GEN_3DATA
; 1172
; 1173 %SBTTL 'Storage - Local'
; 1174 !
; 1175 ! LOCAL OWN STORAGE:
; 1176 !
; 1177
; 1178 OWN
; 1179 !
; 1180 ! Receive parameters
; 1181 !
; 1182 RECV_8QUOTE_CHR, ! 8th-bit quoting character
; 1183 REPT_CHR, ! Repeat prefix character
; 1184 !
; 1185 ! Send parameters
; 1186 !
; 1187 SEND_PKT_SIZE, ! Send packet size
; 1188 SEND_NPAD, ! Padding length
; 1189 SEND_PADCHAR, ! Padding character
; 1190 SEND_EOL, ! EOL character
; 1191 SEND_QUOTE_CHR, ! Quote character
; 1192 SEND_8QUOTE_CHR, ! 8-bit quoting character
; 1193 !
; 1194 ! Misc parameters
; 1195 !
; 1196 INI_CHK_TYPE, ! Type of block checking from init message
; 1197 BLK_CHK_TYPE, ! Type of block check to use
; 1198 FLAG_8QUOTE, ! Flag to determine if doing 8bit quoting
; 1199 FLAG_REPEAT, ! True if doing repeated character compression
; 1200 STATE, ! Current state
; 1201 SIZE, ! Size of the current message
; 1202 OLD_RETRIES, ! Saved number of retries done.
; 1203 NUM_RETRIES, ! Number of retries
; 1204 MSG_NUMBER, ! Current message number
; 1205 REC_SEQ, ! Sequence number of msg in REC_MSG
; 1206 REC_LENGTH, ! Length of the message recv'd
; 1207 REC_TYPE, ! Type of the message received.
; 1208 REC_MSG : VECTOR [CH$ALLOCATION (MAX_MSG, CHR_SIZE)], ! Message received
; 1209 SND_MSG : VECTOR [CH$ALLOCATION (MAX_MSG, CHR_SIZE)], ! Message sent
; 1210 FILE_OPEN_FLAG, ! File is opened.
; 1211 FILE_CHARS, ! Number of characters sent or received
; 1212 TEXT_HEAD_FLAG, ! Text header received, not file header
; 1213 NO_FILE_NEEDED, ! Don't open a file
; 1214 INIT_PKT_SENT, ! Server-init sent and ACKed
; 1215 GEN_TYPE, ! Command message type
; 1216 GEN_SUBTYPE, ! Generic command subtype
; 1217 GET_CHR_ROUTINE, ![025] Address of routine to get a character for BFR_FILL
; 1218 PUT_CHR_ROUTINE; ![025] Address of routine to put a character for BFR_EMPTY
; 1219
; 1220 %SBTTL 'External references'
; 1221 !
; 1222 ! EXTERNAL REFERENCES:
; 1223 !
; 1224 ! Packet I/O routines
; 1225
; 1226 EXTERNAL ROUTINE
; 1227 SEND, ! Send a packet to the remote
; 1228 IBM_WAIT, ! Wait for IBM turnaround
; 1229 RECEIVE; ! Receive a packet from the remote
; 1230
; 1231 !
; 1232 ! Terminal I/O routines
; 1233 !
; 1234
; 1235 EXTERNAL ROUTINE
; 1236 TERM_DUMP : NOVALUE, ! Normal terminal output
; 1237 DBG_DUMP : NOVALUE, ! Debugging output
; 1238 TT_SET_OUTPUT, ! Set output routine
; 1239 TT_CHAR : NOVALUE, ! Output a single character
; 1240 TT_CRLF : NOVALUE, ! Output a CRLF
; 1241 TT_NUMBER : NOVALUE, ! Output a three digit number to the
; 1242 ! terminal
; 1243 TT_TEXT : NOVALUE, ! Output a string to the user's
; 1244 TT_OUTPUT : NOVALUE; ! Force buffered output to terminal
; 1245
; 1246 ! Operating system routines and misc routines
; 1247
; 1248 EXTERNAL ROUTINE
; 1249 CRCCLC, ! Calculate a CRC-CCITT
; 1250 XFR_STATUS : NOVALUE, ! Routine to tell the user the
; 1251 ! status of a transfer
; 1252 KRM_ERROR : NOVALUE, ! Issue an error message
; 1253 SY_LOGOUT : NOVALUE, ! Log the job off
; 1254 SY_GENERIC, ! Perform a generic command
; 1255 SY_TIME, ! Return elapsed time in milliseconds
; 1256 SY_DISMISS : NOVALUE; ! Routine to dismiss for n seconds.
; 1257
; 1258 !
; 1259 ! External file processing routines
; 1260 !
; 1261
; 1262 EXTERNAL ROUTINE
; 1263 FILE_OPEN, ! Open a file for reading/writing
; 1264 FILE_CLOSE, ! Close an open file
; 1265 NEXT_FILE, ! Determine if there is a next file
; 1266 ! and open it for reading.
; 1267 GET_FILE, ! Get a byte from the file
; 1268 PUT_FILE; ! Put a byte in the file.
; 1269
; 1270 %SBTTL 'MSG_INIT'
; 1271
; 1272 GLOBAL ROUTINE MSG_INIT : NOVALUE =
; 1273
; 1274 !++
; 1275 ! FUNCTIONAL DESCRIPTION:
; 1276 !
; 1277 ! This routine will initialize the message processing for
; 1278 ! KERMIT-32/36.
; 1279 !
; 1280 ! CALLING SEQUENCE:
; 1281 !
; 1282 ! MSG_INIT();
; 1283 !
; 1284 ! INPUT PARAMETERS:
; 1285 !
; 1286 ! None.
; 1287 !
; 1288 ! IMPLICIT INPUTS:
; 1289 !
; 1290 ! None.
; 1291 !
; 1292 ! OUTPUT PARAMETERS:
; 1293 !
; 1294 ! None.
; 1295 !
; 1296 ! IMPLICIT OUTPUTS:
; 1297 !
; 1298 ! None.
; 1299 !
; 1300 ! COMPLETION CODES:
; 1301 !
; 1302 ! None.
; 1303 !
; 1304 ! SIDE EFFECTS:
; 1305 !
; 1306 ! None.
; 1307 !
; 1308 !--
; 1309
; 1310 BEGIN
; 1311 !
; 1312 ! Initialize some variables
; 1313 !
; 1314 ! Receive parameters first
; 1315 !
; 1316 RCV_PKT_SIZE = MY_PKT_SIZE;
; 1317 RCV_NPAD = MY_NPAD;
; 1318 RCV_PADCHAR = MY_PAD_CHAR;
; 1319 RCV_TIMEOUT = MY_TIME_OUT;
; 1320 RCV_EOL = MY_EOL_CHAR;
; 1321 RCV_QUOTE_CHR = MY_QUOTE_CHAR;
; 1322 RCV_SOH = CHR_SOH;
; 1323 RCV_8QUOTE_CHR = MY_8BIT_QUOTE;
; 1324 SET_REPT_CHR = MY_REPEAT;
; 1325 !
; 1326 ! Send parameters.
; 1327 !
; 1328 SND_PKT_SIZE = -MY_PKT_SIZE;
; 1329 SND_NPAD = -MY_NPAD;
; 1330 SND_PADCHAR = -MY_PAD_CHAR;
; 1331 SND_TIMEOUT = -MY_TIME_OUT;
; 1332 SND_EOL = -MY_EOL_CHAR;
; 1333 SND_QUOTE_CHR = -MY_QUOTE_CHAR;
; 1334 SND_SOH = CHR_SOH;
; 1335 !
; 1336 ! Other random parameters
; 1337 !
; 1338 PKT_RETRIES = MAX_PKT_RETRIES; ! Number of retries per message
; 1339 SI_RETRIES = MAX_SI_RETRIES; ! Number of retries on send inits
; 1340 DELAY = INIT_DELAY;
; 1341 DUPLEX = DP_FULL; ! Use full duplex
; 1342 DEBUG_FLAG = FALSE;
; 1343 WARN_FLAG = FALSE;
; 1344 ECHO_FLAG = FALSE;
; 1345 BLK_CHK_TYPE = CHK_1CHAR; ! Start using single char checksum
; 1346 CHKTYPE = MY_CHKTYPE; ! Desired block check type
; 1347 INI_CHK_TYPE = .CHKTYPE; ! Same as default for now
; 1348 DEV_PARITY_FLAG = FALSE; ! We generate parity
; 1349 PARITY_TYPE = PR_NONE; ! No parity
; 1350 ABT_FLAG = TRUE; ! Discard incomplete files
; 1351 FILE_OPEN_FLAG = FALSE;
; 1352 IBM_FLAG = FALSE; ! Not talking to an IBM
; 1353 IBM_CHAR = CHR_DC1; ! XON is IBM turnaround character
; 1354 TY_FIL = TRUE; ! Default to typing files
; 1355 TY_PKT = FALSE; ! But not packet numbers
; 1356 FIL_NORMAL_FORM = FNM_NORMAL; ! Default to normal form names
; 1357 GET_CHR_ROUTINE = GET_FILE; ![025] Initialize the get-a-char routine
; 1358 PUT_CHR_ROUTINE = PUT_FILE; ![025] And the put-a-char
; 1359 END; ! End of MSG_INIT
.NLIST
.LIST BIN,LOC
.LIST
.TITLE KERMSG KERMSG - Kermit message processing
.IDENT /2.0.03/
.PSECT $OWN$, D
; RECV.8QUOTE.CHR
U.62: .BLKW 1
; REPT.CHR
U.63: .BLKW 1
; SEND.PKT.SIZE
U.64: .BLKW 1
; SEND.NPAD
U.65: .BLKW 1
; SEND.PADCHAR
U.66: .BLKW 1
; SEND.EOL
U.67: .BLKW 1
; SEND.QUOTE.CHR
U.68: .BLKW 1
; SEND.8QUOTE.CHR
U.69: .BLKW 1
; INI.CHK.TYPE
U.70: .BLKW 1
; BLK.CHK.TYPE
U.71: .BLKW 1
; FLAG.8QUOTE
U.72: .BLKW 1
; FLAG.REPEAT
U.73: .BLKW 1
; STATE
U.74: .BLKW 1
; SIZE
U.75: .BLKW 1
; OLD.RETRIES
U.76: .BLKW 1
; NUM.RETRIES
U.77: .BLKW 1
; MSG.NUMBER
U.78: .BLKW 1
; REC.SEQ
U.79: .BLKW 1
; REC.LENGTH
U.80: .BLKW 1
; REC.TYPE
U.81: .BLKW 1
; REC.MSG
U.82: .BLKW 60
; SND.MSG
U.83: .BLKW 60
; FILE.OPEN.FLAG
U.84: .BLKW 1
; FILE.CHARS
U.85: .BLKW 1
; TEXT.HEAD.FLAG
U.86: .BLKW 1
; NO.FILE.NEEDED
U.87: .BLKW 1
; INIT.PKT.SENT
U.88: .BLKW 1
; GEN.TYPE
U.89: .BLKW 1
; GEN.SUBTYPE
U.90: .BLKW 1
; GET.CHR.ROUTINE
U.91: .BLKW 1
; PUT.CHR.ROUTINE
U.92: .BLKW 1
.GLOBL RCV.PKT.SIZE, RCV.NPAD, RCV.PADCHAR
.GLOBL RCV.TIMEOUT, RCV.EOL, RCV.QUOTE.CHR
.GLOBL RCV.SOH, RCV.8QUOTE.CHR, SET.REPT.CHR
.GLOBL SND.PKT.SIZE, SND.NPAD, SND.PADCHAR
.GLOBL SND.TIMEOUT, SND.EOL, SND.QUOTE.CHR
.GLOBL SND.SOH, SEND.TIMEOUT, SND.TOTAL.CHARS
.GLOBL RCV.TOTAL.CHARS, SND.DATA.CHARS
.GLOBL RCV.DATA.CHARS, SND.NAKS, RCV.NAKS
.GLOBL SND.COUNT, RCV.COUNT, SMSG.COUNT
.GLOBL RMSG.COUNT, SMSG.TOTAL.CHARS, RMSG.TOTAL.CHARS
.GLOBL SMSG.DATA.CHARS, RMSG.DATA.CHARS
.GLOBL SMSG.NAKS, RMSG.NAKS, XFR.TIME
.GLOBL TOTAL.TIME, LAST.ERROR, FILE.NAME
.GLOBL FILE.SIZE, SI.RETRIES, PKT.RETRIES
.GLOBL DELAY, DUPLEX, PARITY.TYPE, DEV.PARITY.FLAG
.GLOBL CHKTYPE, ABT.FLAG, DEBUG.FLAG
.GLOBL WARN.FLAG, IBM.FLAG, IBM.CHAR
.GLOBL ECHO.FLAG, CONNECT.FLAG, ABT.CUR.FILE
.GLOBL ABT.ALL.FILE, TYP.STS.FLAG, TY.FIL
.GLOBL TY.PKT, FIL.NORMAL.FORM, GEN.1DATA
.GLOBL GEN.1SIZE, GEN.2DATA, GEN.2SIZE
.GLOBL GEN.3DATA, GEN.3SIZE, SEND, IBM.WAIT
.GLOBL RECEIVE, TERM.DUMP, DBG.DUMP, TT.SET.OUTPUT
.GLOBL TT.CHAR, TT.CRLF, TT.NUMBER, TT.TEXT
.GLOBL TT.OUTPUT, CRCCLC, XFR.STATUS
.GLOBL KRM.ERROR, SY.LOGOUT, SY.GENERIC
.GLOBL SY.TIME, SY.DISMISS, FILE.OPEN
.GLOBL FILE.CLOSE, NEXT.FILE, GET.FILE
.GLOBL PUT.FILE
FNM.NORMAL== 1
FNM.FULL== 2
FNM.UNTRAN== 4
PR.MIN== 0
PR.NONE== 0
PR.MARK== 1
PR.EVEN== 2
PR.ODD== 3
PR.SPACE== 4
PR.MAX== 4
GC.MIN== 1
GC.EXIT== 1
GC.DIRECTORY== 2
GC.DISK.USAGE== 3
GC.DELETE== 4
GC.TYPE== 5
GC.HELP== 6
GC.LOGOUT== 7
GC.LGN== 10
GC.CONNECT== 11
GC.RENAME== 12
GC.COPY== 13
GC.WHO== 14
GC.SEND.MSG== 15
GC.STATUS== 16
GC.COMMAND== 17
GC.MAX== 17
DP.FULL== 0
DP.HALF== 1
CHK.1CHAR== 61
CHK.2CHAR== 62
CHK.CRC== 63
MAX.MSG== 140
; KER.NORMAL
U.36= 1
; KER.INTERNALERR
U.37= 12
; KER.CMDERR
U.38= 22
; KER.ILLEOL
U.39= 32
; KER.ILLPKTLEN
U.40= 42
; KER.ILLPADCHR
U.41= 52
; KER.ILLNPAD
U.42= 62
; KER.LINTOOLNG
U.43= 72
; KER.EOF
U.44= 101
; KER.RMS32
U.45= 112
; KER.NOMORFILES
U.46= 121
; KER.ILLFILTYP
U.47= 132
; KER.REC.TOO.BIG
U.48= 142
; KER.ERRMSG
U.49= 152
; KER.CHKSUMERR
U.50= 162
; KER.SNDERR
U.51= 172
; KER.RETRIES
U.52= 202
; KER.EXIT
U.53= 211
; KER.UNIMPLGEN
U.54= 222
; KER.UNISRV
U.55= 232
; KER.PROTOERR
U.56= 242
; KER.LINTERM
U.57= 252
; KER.TIMEOUT
U.58= 264
; KER.ABORTED
U.59= 272
; KER.RECERR
U.60= 302
; KER.ZEROLENMSG
U.61= 312
.SBTTL MSG.INIT MSG_INIT
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
MSG.INIT::
MOV #120,RCV.PKT.SIZE ; 1316
CLR RCV.NPAD ; 1317
CLR RCV.PADCHAR ; 1318
MOV #17,RCV.TIMEOUT ; 1319
MOV #15,RCV.EOL ; 1320
MOV #43,RCV.QUOTE.CHR ; 1321
MOV #1,RCV.SOH ; 1322
MOV #46,RCV.8QUOTE.CHR ; 1323
MOV #176,SET.REPT.CHR ; 1324
MOV #-120,SND.PKT.SIZE ; 1328
CLR SND.NPAD ; 1329
CLR SND.PADCHAR ; 1330
MOV #-17,SND.TIMEOUT ; 1331
MOV #-15,SND.EOL ; 1332
MOV #-43,SND.QUOTE.CHR ; 1333
MOV #1,SND.SOH ; 1334
MOV #20,PKT.RETRIES ; 1338
MOV #5,SI.RETRIES ; 1339
MOV #5,DELAY ; 1340
CLR DUPLEX ; 1341
CLR DEBUG.FLAG ; 1342
CLR WARN.FLAG ; 1343
CLR ECHO.FLAG ; 1344
MOV #61,U.71 ; 1345
MOV #61,CHKTYPE ; 1346
MOV #61,U.70 ; 1347
CLR DEV.PARITY.FLAG ; 1348
CLR PARITY.TYPE ; 1349
MOV #1,ABT.FLAG ; 1350
CLR U.84 ; 1351
CLR IBM.FLAG ; 1352
MOV #21,IBM.CHAR ; 1353
MOV #1,TY.FIL ; 1354
CLR TY.PKT ; 1355
MOV #1,FIL.NORMAL.FORM ; 1356
MOV #GET.FILE,U.91 ; 1357
MOV #PUT.FILE,U.92 ; 1358
RTS PC ; 1272
; Routine Size: 99 words, Routine Base: $CODE$ + 0000
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1360
; 1361 %SBTTL 'SND_ERROR'
; 1362
; 1363 GLOBAL ROUTINE SND_ERROR (COUNT, ADDRESS) : NOVALUE =
; 1364
; 1365 !++
; 1366 ! FUNCTIONAL DESCRIPTION:
; 1367 !
; 1368 ! This routine will send an error packet to the remote KERMIT. It
; 1369 ! is called with the count of characters and the address of the text.
; 1370 !
; 1371 ! CALLING SEQUENCE:
; 1372 !
; 1373 ! SND_ERROR(COUNT, %ASCII 'Error text');
; 1374 !
; 1375 ! INPUT PARAMETERS:
; 1376 !
; 1377 ! None.
; 1378 !
; 1379 ! IMPLICIT INPUTS:
; 1380 !
; 1381 ! None.
; 1382 !
; 1383 ! OUTPUT PARAMETERS:
; 1384 !
; 1385 ! None.
; 1386 !
; 1387 ! IMPLICIT OUTPUTS:
; 1388 !
; 1389 ! None.
; 1390 !
; 1391 ! COMPLETION CODES:
; 1392 !
; 1393 ! None.
; 1394 !
; 1395 ! SIDE EFFECTS:
; 1396 !
; 1397 !
; 1398 !--
; 1399
; 1400 BEGIN
; 1401 !
; 1402 ! Pack the message into the buffer
; 1403 !
; 1404 SET_STRING (CH$PTR (.ADDRESS), .COUNT, TRUE);
; 1405 BFR_FILL (TRUE);
; 1406 SET_STRING (0, 0, FALSE);
; 1407 !
; 1408 ! Save the last error message also
; 1409 !
; 1410
; 1411 IF .COUNT GTR MAX_MSG THEN COUNT = MAX_MSG;
; 1412
; 1413 CH$COPY (.COUNT, CH$PTR (.ADDRESS), 0, MAX_MSG + 1, CH$PTR (LAST_ERROR));
; 1414
; 1415 IF NOT SEND_PACKET (MSG_ERROR, .SIZE, .MSG_NUMBER) THEN RETURN KER_ABORTED;
; 1416
; 1417 END; ! End of SND_ERROR
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SND.ERROR SND_ERROR
.NLIST
.ENABL LSB
.LIST
SND.ERROR::
MOV 2(SP),-(SP) ; ADDRESS,* 1404
MOV 6(SP),-(SP) ; COUNT,*
MOV #1,-(SP)
JSR PC,U.29
MOV #1,(SP) ; 1405
JSR PC,U.28
CLR (SP) ; 1406
CLR -(SP)
CLR -(SP)
JSR PC,U.29
CMP 16(SP),#140 ; COUNT,* 1411
BLE 1$
MOV #140,16(SP) ; *,COUNT
1$: MOV 16(SP),(SP) ; COUNT,* 1413
MOV 14(SP),-(SP) ; ADDRESS,*
CLR -(SP)
MOV #141,-(SP)
MOV #LAST.ERROR,-(SP)
MOV #-5,-(SP)
JSR PC,BL$CPY
MOV #105,(SP) ; 1415
MOV U.75,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
ROR R0
ADD #30,SP ; 1400
RTS PC ; 1363
; Routine Size: 49 words, Routine Base: $CODE$ + 0306
; Maximum stack depth per invocation: 13 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1418
; 1419 %SBTTL 'SERVER - Server mode'
; 1420
; 1421 GLOBAL ROUTINE SERVER =
; 1422
; 1423 !++
; 1424 ! FUNCTIONAL DESCRIPTION:
; 1425 !
; 1426 ! This routine will handle the server function in the v2.0 protocol
; 1427 ! for KERMIT. This routine by it's nature will call various operating
; 1428 ! system routines to do things like logging off the system.
; 1429 !
; 1430 ! CALLING SEQUENCE:
; 1431 !
; 1432 ! EXIT_FLAG = SERVER();
; 1433 !
; 1434 ! INPUT PARAMETERS:
; 1435 !
; 1436 ! None.
; 1437 !
; 1438 ! IMPLICIT INPUTS:
; 1439 !
; 1440 ! None.
; 1441 !
; 1442 ! OUTPUT PARAMETERS:
; 1443 !
; 1444 ! None.
; 1445 !
; 1446 ! IMPLICIT OUTPUTS:
; 1447 !
; 1448 ! None.
; 1449 !
; 1450 ! COMPLETION CODES:
; 1451 !
; 1452 ! None.
; 1453 !
; 1454 ! SIDE EFFECTS:
; 1455 !
; 1456 ! None.
; 1457 !
; 1458 !--
; 1459
; 1460 BEGIN
; 1461
; 1462 LOCAL
; 1463 STATUS; ! Status returned by various routines
; 1464
; 1465 DO
; 1466 BEGIN
; 1467 INIT_XFR ();
; 1468 XFR_STATUS (%C'T', %C'I'); ! Now idle
; 1469 STATUS = DO_TRANSACTION (STATE_ID);
; 1470 END
; 1471 UNTIL .STATUS EQL KER_EXIT OR .STATUS EQL KER_ABORTED;
; 1472
; 1473 RETURN .STATUS;
; 1474 END; ! End of GLOBAL ROUTINE SERVER
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SERVER SERVER - Server mode
.NLIST
.ENABL LSB
.LIST
SERVER::MOV R1,-(SP) ; 1421
1$: JSR PC,U.31 ; 1467
MOV #124,-(SP) ; 1468
MOV #111,-(SP)
JSR PC,XFR.STATUS
MOV #16,(SP) ; 1469
JSR PC,U.1
MOV R0,R1 ; *,STATUS
CMP (SP)+,(SP)+ ; 1466
CMP R1,#211 ; STATUS,* 1471
BEQ 2$
CMP R1,#272 ; STATUS,*
BNE 1$
2$: MOV R1,R0 ; STATUS,* 1460
MOV (SP)+,R1 ; 1421
RTS PC
; Routine Size: 24 words, Routine Base: $CODE$ + 0450
; Maximum stack depth per invocation: 4 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1475
; 1476 %SBTTL 'SEND_SWITCH'
; 1477
; 1478 GLOBAL ROUTINE SEND_SWITCH =
; 1479
; 1480 !++
; 1481 ! FUNCTIONAL DESCRIPTION:
; 1482 !
; 1483 ! This routine is the state table switcher for sending files. It
; 1484 ! loops until either it is finished or an error is encountered. The
; 1485 ! routines called by SEND_SWITCH are responsible for changing the state.
; 1486 !
; 1487 ! CALLING SEQUENCE:
; 1488 !
; 1489 ! SEND_SWITCH();
; 1490 !
; 1491 ! INPUT PARAMETERS:
; 1492 !
; 1493 ! None.
; 1494 !
; 1495 ! IMPLICIT INPUTS:
; 1496 !
; 1497 ! None.
; 1498 !
; 1499 ! OUTPUT PARAMETERS:
; 1500 !
; 1501 ! Returns:
; 1502 ! TRUE - File sent correctly.
; 1503 ! FALSE - Aborted sending the file.
; 1504 !
; 1505 ! IMPLICIT OUTPUTS:
; 1506 !
; 1507 ! None.
; 1508 !
; 1509 ! COMPLETION CODES:
; 1510 !
; 1511 ! None.
; 1512 !
; 1513 ! SIDE EFFECTS:
; 1514 !
; 1515 ! None.
; 1516 !
; 1517 !--
; 1518
; 1519 BEGIN
; 1520
; 1521 LOCAL
; 1522 STATUS; ! Status result
; 1523
; 1524 IF .CONNECT_FLAG THEN SY_DISMISS (.DELAY); ! Sleep if the user wanted us to
; 1525
; 1526 INIT_XFR (); ! Initialize for this transfer
; 1527 TEXT_HEAD_FLAG = FALSE; ! Set text flag correctly
; 1528 XFR_STATUS (%C'I', %C'S'); ! Start of file send
; 1529 STATUS = DO_TRANSACTION (STATE_S); ! Call routine to do real work
; 1530 XFR_STATUS (%C'T', %C'S'); ! Done with send
; 1531 RETURN .STATUS; ! Return the result
; 1532 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.SWITCH SEND_SWITCH
.NLIST
.ENABL LSB
.LIST
SEND.SWITCH::
MOV R1,-(SP) ; 1478
BIT #1,CONNECT.FLAG ; 1524
BEQ 1$
MOV DELAY,-(SP)
JSR PC,SY.DISMISS
TST (SP)+
1$: JSR PC,U.31 ; 1526
CLR U.86 ; 1527
MOV #111,-(SP) ; 1528
MOV #123,-(SP)
JSR PC,XFR.STATUS
MOV #1,(SP) ; 1529
JSR PC,U.1
MOV R0,R1 ; *,STATUS
MOV #124,(SP) ; 1530
MOV #123,-(SP)
JSR PC,XFR.STATUS
ADD #6,SP ; 1478
MOV R1,R0 ; STATUS,* 1519
MOV (SP)+,R1 ; 1478
RTS PC
; Routine Size: 36 words, Routine Base: $CODE$ + 0530
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1533
; 1534 %SBTTL 'REC_SWITCH'
; 1535
; 1536 GLOBAL ROUTINE REC_SWITCH =
; 1537
; 1538 !++
; 1539 ! FUNCTIONAL DESCRIPTION:
; 1540 !
; 1541 ! This routine will cause file(s) to be received by the remote
; 1542 ! KERMIT. This routine contains the main loop for the sending of the
; 1543 ! data.
; 1544 !
; 1545 ! CALLING SEQUENCE:
; 1546 !
; 1547 ! REC_SWITCH();
; 1548 !
; 1549 ! INPUT PARAMETERS:
; 1550 !
; 1551 ! None.
; 1552 !
; 1553 ! IMPLICIT INPUTS:
; 1554 !
; 1555 ! FILE_DESC - Descriptor describing the file to be received by
; 1556 ! the remote KERMIT.
; 1557 !
; 1558 ! OUTPUT PARAMETERS:
; 1559 !
; 1560 ! None.
; 1561 !
; 1562 ! IMPLICIT OUTPUTS:
; 1563 !
; 1564 ! None.
; 1565 !
; 1566 ! COMPLETION CODES:
; 1567 !
; 1568 ! True - File received correctly.
; 1569 ! FALSE - File transfer aborted.
; 1570 !
; 1571 ! SIDE EFFECTS:
; 1572 !
; 1573 ! None.
; 1574 !
; 1575 !--
; 1576
; 1577 BEGIN
; 1578
; 1579 LOCAL
; 1580 INIT_STATE, ! State to start up DO_TRANSACTION in
; 1581 STATUS; ! Status returned by various routines
; 1582
; 1583 INIT_STATE = STATE_R; ! Initialize the state
; 1584 MSG_NUMBER = 0;
; 1585 INIT_XFR (); ! Initialize the per transfer info
; 1586 !
; 1587 ! Determine if they said REC <file-spec>
; 1588 ! Send MSG_RCV_INIT and then receive the file
; 1589 !
; 1590
; 1591 IF .FILE_SIZE GTR 0
; 1592 THEN
; 1593 BEGIN
; 1594 GEN_TYPE = MSG_RCV_INIT; ! Use receive-init message
; 1595 CH$MOVE (.FILE_SIZE, CH$PTR (FILE_NAME), CH$PTR (GEN_1DATA));
; 1596 GEN_1SIZE = .FILE_SIZE; ! Save the length
; 1597 INIT_STATE = STATE_SI; ! Start out with server init
; 1598 END;
; 1599
; 1600 !
; 1601 ! Now receive the file normally
; 1602 !
; 1603 XFR_STATUS (%C'I', %C'R'); ! Start of a file receive
; 1604 STATUS = DO_TRANSACTION (.INIT_STATE);
; 1605 XFR_STATUS (%C'T', %C'R'); ! End of file receive
; 1606 RETURN .STATUS; ! Return the result
; 1607 END; ! End of REC_SWITCH
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL REC.SWITCH REC_SWITCH
.NLIST
.ENABL LSB
.LIST
REC.SWITCH::
MOV R1,-(SP) ; 1536
MOV #6,R1 ; *,INIT.STATE 1583
CLR U.78 ; 1584
JSR PC,U.31 ; 1585
MOV FILE.SIZE,R0 ; 1591
BLE 1$
MOV #122,U.89 ; 1594
MOV R0,-(SP) ; 1595
MOV #FILE.NAME,-(SP)
MOV #GEN.1DATA,-(SP)
JSR PC,BL$MOV
MOV FILE.SIZE,GEN.1SIZE ; 1596
MOV #15,R1 ; *,INIT.STATE 1597
ADD #6,SP ; 1593
1$: MOV #111,-(SP) ; 1603
MOV #122,-(SP)
JSR PC,XFR.STATUS
MOV R1,(SP) ; INIT.STATE,* 1604
JSR PC,U.1
MOV R0,R1 ; *,STATUS
MOV #124,(SP) ; 1605
MOV #122,-(SP)
JSR PC,XFR.STATUS
ADD #6,SP ; 1536
MOV R1,R0 ; STATUS,* 1577
MOV (SP)+,R1 ; 1536
RTS PC
; Routine Size: 48 words, Routine Base: $CODE$ + 0640
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1608
; 1609 %SBTTL 'Server -- DO_GENERIC - Execute a generic command'
; 1610
; 1611 GLOBAL ROUTINE DO_GENERIC (TYPE) =
; 1612
; 1613 !++
; 1614 ! FUNCTIONAL DESCRIPTION:
; 1615 !
; 1616 ! This routine will send a generic command to the remote Kermit.
; 1617 ! it will do all the processing required for the generic command
; 1618 ! that was executed. It will return to the caller after the
; 1619 ! command has be executed.
; 1620 !
; 1621 ! CALLING SEQUENCE:
; 1622 !
; 1623 ! STATUS = DO_GENERIC (Command-type);
; 1624 !
; 1625 ! INPUT PARAMETERS:
; 1626 !
; 1627 ! Command-type -- Command type to be executed.
; 1628 !
; 1629 ! IMPLICIT INPUTS:
; 1630 !
; 1631 ! None.
; 1632 !
; 1633 ! OUTPUT PARAMETERS:
; 1634 !
; 1635 ! None.
; 1636 !
; 1637 ! IMPLICIT OUTPUTS:
; 1638 !
; 1639 ! None.
; 1640 !
; 1641 ! COMPLETION CODES:
; 1642 !
; 1643 ! None.
; 1644 !
; 1645 ! SIDE EFFECTS:
; 1646 !
; 1647 ! None.
; 1648 !
; 1649 !--
; 1650
; 1651 BEGIN
; 1652
; 1653 LOCAL
; 1654 INIT_STATE; ! Initial state for FSM
; 1655
; 1656 !
; 1657 ! Set up the per transfer items
; 1658 !
; 1659 INIT_XFR ();
; 1660 NUM_RETRIES = 0;
; 1661 MSG_NUMBER = 0;
; 1662 !
; 1663 ! These are all generic commands
; 1664 !
; 1665 GEN_TYPE = MSG_KERMIT;
; 1666 !
; 1667 ! Assume we will not need server init
; 1668 !
; 1669 INIT_STATE = STATE_SG;
; 1670
; 1671 CASE .TYPE FROM GC_MIN TO GC_MAX OF
; 1672 SET
; 1673
; 1674 [GC_EXIT] :
; 1675 GEN_SUBTYPE = MSG_GEN_EXIT;
; 1676
; 1677 [GC_LOGOUT] :
; 1678 GEN_SUBTYPE = MSG_GEN_LOGOUT;
; 1679
; 1680 [GC_DIRECTORY] :
; 1681 BEGIN
; 1682 INIT_STATE = STATE_SI; ! We will need server-init
; 1683 GEN_SUBTYPE = MSG_GEN_DIRECTORY;
; 1684 END;
; 1685
; 1686 [GC_DISK_USAGE] :
; 1687 BEGIN
; 1688 INIT_STATE = STATE_SI; ! We will need server-init
; 1689 GEN_SUBTYPE = MSG_GEN_DISK_USAGE;
; 1690 END;
; 1691
; 1692 [GC_DELETE] :
; 1693 GEN_SUBTYPE = MSG_GEN_DELETE;
; 1694
; 1695 [GC_TYPE] :
; 1696 BEGIN
; 1697 INIT_STATE = STATE_SI; ! We will need server-init
; 1698 GEN_SUBTYPE = MSG_GEN_TYPE;
; 1699 END;
; 1700
; 1701 [GC_HELP] :
; 1702 BEGIN
; 1703 INIT_STATE = STATE_SI; ! We will need server-init
; 1704 GEN_SUBTYPE = MSG_GEN_HELP;
; 1705 END;
; 1706
; 1707 [GC_LGN] :
; 1708 GEN_SUBTYPE = MSG_GEN_LOGIN; ! Login just gets ACK
; 1709
; 1710 [GC_CONNECT] :
; 1711 GEN_SUBTYPE = MSG_GEN_CONNECT; ! CWD just gets ACK
; 1712
; 1713 [GC_RENAME] :
; 1714 GEN_SUBTYPE = MSG_GEN_RENAME; ! Rename file just needs ACK
; 1715
; 1716 [GC_COPY] :
; 1717 GEN_SUBTYPE = MSG_GEN_COPY; ! Copy file just needs ACK
; 1718
; 1719 [GC_WHO] :
; 1720 BEGIN
; 1721 INIT_STATE = STATE_SI; ! May get large response
; 1722 GEN_SUBTYPE = MSG_GEN_WHO;
; 1723 END;
; 1724
; 1725 [GC_SEND_MSG] :
; 1726 GEN_SUBTYPE = MSG_GEN_SEND; ! Just need an ACK
; 1727
; 1728 [GC_STATUS] :
; 1729 BEGIN
; 1730 INIT_STATE = STATE_SI; ! May get large response
; 1731 GEN_SUBTYPE = MSG_GEN_QUERY;
; 1732 END;
; 1733
; 1734 [GC_COMMAND] :
; 1735 BEGIN
; 1736 INIT_STATE = STATE_SI; ! Large response likely
; 1737 GEN_TYPE = MSG_COMMAND; ! This is host command
; 1738 END;
; 1739
; 1740 [INRANGE, OUTRANGE] :
; 1741 BEGIN
; 1742 KRM_ERROR (KER_UNIMPLGEN);
; 1743 RETURN STATE_A;
; 1744 END;
; 1745 TES;
; 1746
; 1747 RETURN DO_TRANSACTION (.INIT_STATE); ! Go do the command
; 1748 END; ! End of DO_GENERIC
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL DO.GENERIC Server -- DO_GENERIC - Execute a generic comman
.NLIST
.ENABL LSB
.LIST
DO.GENERIC::
MOV R1,-(SP) ; 1611
JSR PC,U.31 ; 1659
CLR U.77 ; 1660
CLR U.78 ; 1661
MOV #107,U.89 ; 1665
MOV #14,R1 ; *,INIT.STATE 1669
MOV 4(SP),R0 ; TYPE,* 1671
DEC R0
CMP R0,#16
BHI 2$
ASL R0
ADD P.AAA(R0),PC ; Case dispatch
2$: MOV #222,-(SP) ; 1742
JSR PC,KRM.ERROR
TST (SP)+ ; 1671
MOV #12,R0 ; 1741
BR 19$
3$: MOV #106,U.90 ; 1675
BR 18$ ; 1671
4$: MOV #114,U.90 ; 1678
BR 18$ ; 1671
5$: MOV #15,R1 ; *,INIT.STATE 1682
MOV #104,U.90 ; 1683
BR 18$ ; 1671
6$: MOV #15,R1 ; *,INIT.STATE 1688
MOV #125,U.90 ; 1689
BR 18$ ; 1671
7$: MOV #105,U.90 ; 1693
BR 18$ ; 1671
8$: MOV #15,R1 ; *,INIT.STATE 1697
MOV #124,U.90 ; 1698
BR 18$ ; 1671
9$: MOV #15,R1 ; *,INIT.STATE 1703
MOV #110,U.90 ; 1704
BR 18$ ; 1671
10$: MOV #111,U.90 ; 1708
BR 18$ ; 1671
11$: MOV #103,U.90 ; 1711
BR 18$ ; 1671
12$: MOV #122,U.90 ; 1714
BR 18$ ; 1671
13$: MOV #113,U.90 ; 1717
BR 18$ ; 1671
14$: MOV #15,R1 ; *,INIT.STATE 1721
MOV #127,U.90 ; 1722
BR 18$ ; 1671
15$: MOV #115,U.90 ; 1726
BR 18$ ; 1671
16$: MOV #15,R1 ; *,INIT.STATE 1730
MOV #121,U.90 ; 1731
BR 18$ ; 1671
17$: MOV #15,R1 ; *,INIT.STATE 1736
MOV #103,U.89 ; 1737
18$: MOV R1,-(SP) ; INIT.STATE,* 1747
JSR PC,U.1
TST (SP)+ ; 1611
19$: MOV (SP)+,R1
RTS PC
; Routine Size: 108 words, Routine Base: $CODE$ + 1000
; Maximum stack depth per invocation: 3 words
.PSECT $PLIT$, RO , D
P.AAA: ; CASE Table for DO.GENERIC+0046 1671
1$: .WORD 20 ; [3$]
.WORD 40 ; [5$]
.WORD 54 ; [6$]
.WORD 70 ; [7$]
.WORD 100 ; [8$]
.WORD 114 ; [9$]
.WORD 30 ; [4$]
.WORD 130 ; [10$]
.WORD 140 ; [11$]
.WORD 150 ; [12$]
.WORD 160 ; [13$]
.WORD 170 ; [14$]
.WORD 204 ; [15$]
.WORD 214 ; [16$]
.WORD 230 ; [17$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1749
; 1750 %SBTTL 'DO_TRANSACTION - Main loop for FSM'
; 1751 ROUTINE DO_TRANSACTION (INIT_STATE) =
; 1752
; 1753 !++
; 1754 ! FUNCTIONAL DESCRIPTION:
; 1755 !
; 1756 ! This is the main routine for performing a Kermit transaction.
; 1757 ! It is structured as a finite state machine with each state
; 1758 ! determining the next based upon the packet which is received.
; 1759 ! It is supplied with the initial state by the caller.
; 1760 !
; 1761 ! CALLING SEQUENCE:
; 1762 !
; 1763 ! Status = DO_TRANSACTION(.INIT_STATE);
; 1764 !
; 1765 ! INPUT PARAMETERS:
; 1766 !
; 1767 ! INIT_STATE - Initial state.
; 1768 !
; 1769 ! IMPLICIT INPUTS:
; 1770 !
; 1771 ! None.
; 1772 !
; 1773 ! OUTPUT PARAMETERS:
; 1774 !
; 1775 ! None.
; 1776 !
; 1777 ! IMPLICIT OUTPUTS:
; 1778 !
; 1779 ! None.
; 1780 !
; 1781 ! COMPLETION CODES:
; 1782 !
; 1783 ! None.
; 1784 !
; 1785 ! SIDE EFFECTS:
; 1786 !
; 1787 ! None.
; 1788 !
; 1789 !--
; 1790
; 1791 BEGIN
; 1792
; 1793 LOCAL
; 1794 RETURN_VALUE;
; 1795
; 1796 NUM_RETRIES = 0; ! Initialize the number of retries
; 1797 STATE = .INIT_STATE; ! Initialize the state
; 1798
; 1799 WHILE TRUE DO
; 1800
; 1801 CASE .STATE FROM STATE_MIN TO STATE_MAX OF
; 1802 SET
; 1803 !
; 1804 ! Send states
; 1805 !
; 1806
; 1807 [STATE_ID] :
; 1808 !
; 1809 ! Server while idle. Set the timeout to twice the normal wait
; 1810 ! and wait for something to show up
; 1811 !
; 1812 BEGIN
; 1813
; 1814 LOCAL
; 1815 SAVED_TIMEOUT;
; 1816
; 1817 SAVED_TIMEOUT = .SEND_TIMEOUT;
; 1818 SEND_TIMEOUT = .SEND_TIMEOUT*2;
; 1819 STATE = REC_SERVER_IDLE ();
; 1820 SEND_TIMEOUT = .SAVED_TIMEOUT;
; 1821 END;
; 1822
; 1823 [STATE_II] :
; 1824 !
; 1825 ! Here while server idle after having received a server-init packet
; 1826 !
; 1827 STATE = REC_SERVER_IDLE ();
; 1828
; 1829 [STATE_FI, STATE_LG] :
; 1830 !
; 1831 ! Here when we are supposed to exit
; 1832 !
; 1833 RETURN KER_EXIT;
; 1834
; 1835 [STATE_SD] :
; 1836 STATE = SEND_DATA ();
; 1837
; 1838 [STATE_SF] :
; 1839 STATE = SEND_FILE ();
; 1840
; 1841 [STATE_SZ] :
; 1842 STATE = SEND_EOF ();
; 1843
; 1844 [STATE_S] :
; 1845 STATE = SEND_INIT ();
; 1846
; 1847 [STATE_OF] :
; 1848 STATE = SEND_OPEN_FILE ();
; 1849
; 1850 [STATE_SI] :
; 1851 STATE = SEND_SERVER_INIT ();
; 1852
; 1853 [STATE_SG] :
; 1854 STATE = SEND_GENCMD ();
; 1855
; 1856 [STATE_SB] :
; 1857 STATE = SEND_BREAK ();
; 1858 !
; 1859 ! Receiving of the data and the end of file message.
; 1860 !
; 1861
; 1862 [STATE_RD] :
; 1863 STATE = REC_DATA ();
; 1864 !
; 1865 ! Receiving the FILE information of the break to end the transfer of
; 1866 ! one or more files
; 1867 !
; 1868
; 1869 [STATE_RF] :
; 1870 STATE = REC_FILE ();
; 1871 !
; 1872 ! Initialization for the receiving of a file
; 1873 !
; 1874
; 1875 [STATE_R] :
; 1876 STATE = REC_INIT ();
; 1877 !
; 1878 ! Here if we have completed the receiving of the file
; 1879 !
; 1880
; 1881 [STATE_C] :
; 1882 BEGIN
; 1883 RETURN_VALUE = TRUE;
; 1884 EXITLOOP;
; 1885 END;
; 1886 !
; 1887 ! Here if we aborted the transfer or we have gotten into some random
; 1888 ! state (internal KERMSG problem).
; 1889 !
; 1890
; 1891 [STATE_A, STATE_EX, INRANGE, OUTRANGE] :
; 1892 BEGIN
; 1893 RETURN_VALUE = FALSE;
; 1894
; 1895 IF .STATE EQL STATE_EX THEN RETURN_VALUE = KER_ABORTED;
; 1896
; 1897 !
; 1898 ! Determine if the file is still open and if so close it
; 1899 !
; 1900
; 1901 IF .FILE_OPEN_FLAG
; 1902 THEN
; 1903 BEGIN
; 1904 FILE_OPEN_FLAG = FALSE;
; 1905
; 1906 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 1907 THEN
; 1908 BEGIN
; 1909 TT_TEXT (UPLIT (%ASCIZ' [Aborted]'));
; 1910 TT_CRLF ();
; 1911 END;
; 1912
; 1913 FILE_CLOSE (.ABT_FLAG AND (.STATE EQL STATE_A OR .STATE EQL STATE_EX));
; 1914 XFR_STATUS (%C'F', %C'A');
; 1915 END;
; 1916
; 1917 EXITLOOP;
; 1918 END;
; 1919 TES;
; 1920
; 1921 !
; 1922 ! End the stats and return to the caller
; 1923 !
; 1924 END_STATS ();
; 1925 !
; 1926 RETURN .RETURN_VALUE;
; 1927 END; ! End of DO_TRANSACTION
.NLIST
.LIST BIN,LOC
.LIST
P.AAC: .ASCII / [A/
.ASCII /bor/
.ASCII /ted/
.ASCII /]/<00><00>
.SBTTL DO.TRANSACTION DO_TRANSACTION - Main loop for FSM
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; DO.TRANSACTION
U.1: JSR R1,$SAVE2 ; 1751
CLR U.77 ; 1796
MOV 10(SP),U.74 ; INIT.STATE,* 1797
1$: MOV U.74,R0 ; 1801
DEC R0
CMP R0,#22
BHI 3$
ASL R0
ADD P.AAB(R0),PC ; Case dispatch
3$: CLR R2 ; RETURN.VALUE 1893
CMP U.74,#23 ; 1895
BNE 4$
MOV #272,R2 ; *,RETURN.VALUE
4$: BIT #1,U.84 ; 1901
BEQ 24$
CLR U.84 ; 1904
BIT #1,CONNECT.FLAG ; 1906
BNE 5$
BIT #1,TY.FIL
BEQ 5$
MOV #P.AAC,-(SP) ; 1909
JSR PC,TT.TEXT
TST (SP)+
JSR PC,TT.CRLF ; 1910
5$: CLR R1 ; 1913
CMP U.74,#12
BNE 6$
INC R1
6$: CLR R0
CMP U.74,#23
BNE 7$
INC R0
7$: BIS R1,R0
MOV ABT.FLAG,-(SP)
COM R0
BIC R0,(SP)
JSR PC,FILE.CLOSE
MOV #106,(SP) ; 1914
MOV #101,-(SP)
JSR PC,XFR.STATUS
CMP (SP)+,(SP)+
BR 24$ ; 1892
8$: MOV SEND.TIMEOUT,R1 ; *,SAVED.TIMEOUT 1817
ASL SEND.TIMEOUT ; 1818
JSR PC,U.10 ; 1819
MOV R0,U.74
MOV R1,SEND.TIMEOUT ; SAVED.TIMEOUT,* 1820
BR 1$ ; 1801
9$: JSR PC,U.10 ; 1827
BR 22$
10$: MOV #211,R0 ; 1833
RTS PC
11$: JSR PC,U.3 ; 1836
BR 22$
12$: JSR PC,U.4 ; 1839
BR 22$
13$: JSR PC,U.7 ; 1842
BR 22$
14$: JSR PC,U.8 ; 1845
BR 22$
15$: JSR PC,U.5 ; 1848
BR 22$
16$: JSR PC,U.2 ; 1851
BR 22$
17$: JSR PC,U.6 ; 1854
BR 22$
18$: JSR PC,U.9 ; 1857
BR 22$
19$: JSR PC,U.13 ; 1863
BR 22$
20$: JSR PC,U.12 ; 1870
BR 22$
21$: JSR PC,U.11 ; 1876
22$: MOV R0,U.74
BR 1$ ; 1801
23$: MOV #1,R2 ; *,RETURN.VALUE 1883
24$: JSR PC,U.17 ; 1924
MOV R2,R0 ; RETURN.VALUE,* 1791
RTS PC ; 1751
; Routine Size: 129 words, Routine Base: $CODE$ + 1330
; Maximum stack depth per invocation: 6 words
.PSECT $PLIT$, RO , D
P.AAB: ; CASE Table for DO.TRANSACTION+0034 1801
2$: .WORD 242 ; [14$]
.WORD 226 ; [12$]
.WORD 220 ; [11$]
.WORD 234 ; [13$]
.WORD 272 ; [18$]
.WORD 314 ; [21$]
.WORD 306 ; [20$]
.WORD 300 ; [19$]
.WORD 326 ; [23$]
.WORD 0 ; [3$]
.WORD 0 ; [3$]
.WORD 264 ; [17$]
.WORD 256 ; [16$]
.WORD 156 ; [8$]
.WORD 204 ; [9$]
.WORD 212 ; [10$]
.WORD 212 ; [10$]
.WORD 250 ; [15$]
.WORD 0 ; [3$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 1928 %SBTTL 'REC_SERVER_IDLE - Idle server state'
; 1929 ROUTINE REC_SERVER_IDLE =
; 1930
; 1931 !++
; 1932 ! FUNCTIONAL DESCRIPTION:
; 1933 !
; 1934 ! This routine is called from DO_TRANSACTION when is the server idle
; 1935 ! state. It will receive a message and properly dispatch to the new
; 1936 ! state.
; 1937 !
; 1938 ! CALLING SEQUENCE:
; 1939 !
; 1940 ! STATE = REC_SERVER_IDLE ();
; 1941 !
; 1942 ! INPUT PARAMETERS:
; 1943 !
; 1944 ! None.
; 1945 !
; 1946 ! IMPLICIT INPUTS:
; 1947 !
; 1948 ! Almost everything.
; 1949 !
; 1950 ! OUPTUT PARAMETERS:
; 1951 !
; 1952 ! Routine value is new state for FSM
; 1953 !
; 1954 ! IMPLICIT OUTPUTS:
; 1955 !
; 1956 ! None.
; 1957 !
; 1958 ! COMPLETION CODES:
; 1959 !
; 1960 ! None.
; 1961 !
; 1962 ! SIDE EFFECTS:
; 1963 !
; 1964 ! None.
; 1965 !
; 1966 !--
; 1967
; 1968 BEGIN
; 1969
; 1970 LOCAL
; 1971 STATUS;
; 1972
; 1973 STATUS = REC_PACKET ();
; 1974 !
; 1975 ! Now determine what to do by the type of message we have receive.
; 1976 !
; 1977
; 1978 IF .STATUS EQL KER_ABORTED THEN RETURN STATE_EX;
; 1979
; 1980 IF .STATUS
; 1981 THEN
; 1982 BEGIN
; 1983
; 1984 SELECTONE .REC_TYPE OF
; 1985 SET
; 1986 !
; 1987 ! Server initialization message received. ACK the
; 1988 ! message and continue.
; 1989 !
; 1990
; 1991 [MSG_SER_INIT] :
; 1992 BEGIN
; 1993
; 1994 IF (STATUS = PRS_SEND_INIT ())
; 1995 THEN
; 1996 BEGIN
; 1997 SET_SEND_INIT ();
; 1998
; 1999 IF (STATUS = SEND_PACKET (MSG_ACK, P_SI_LENGTH, .REC_SEQ))
; 2000 THEN
; 2001 BEGIN
; 2002 SND_PKT_SIZE = -.SEND_PKT_SIZE;
; 2003 SND_TIMEOUT = -.SEND_TIMEOUT;
; 2004 SND_NPAD = -.SEND_NPAD;
; 2005 SND_PADCHAR = -.SEND_PADCHAR;
; 2006 SND_EOL = -.SEND_EOL;
; 2007 SND_QUOTE_CHR = -.SEND_QUOTE_CHR;
; 2008 RCV_8QUOTE_CHR = .SEND_8QUOTE_CHR;
; 2009 CHKTYPE = .INI_CHK_TYPE;
; 2010 SET_REPT_CHR = .REPT_CHR;
; 2011 RETURN STATE_II; ! Now idle after INIT
; 2012 END;
; 2013
; 2014 END;
; 2015
; 2016 KRM_ERROR (KER_PROTOERR);
; 2017 RETURN STATE_A;
; 2018 END;
; 2019 !
; 2020 ! Send init message received. We must ACK the message and
; 2021 ! then attempt to receive a file from the remote.
; 2022 !
; 2023
; 2024 [MSG_SND_INIT] :
; 2025 BEGIN
; 2026 MSG_NUMBER = (.REC_SEQ + 1) AND %O'77';
; 2027
; 2028 IF (STATUS = PRS_SEND_INIT ())
; 2029 THEN
; 2030 BEGIN
; 2031 SET_SEND_INIT ();
; 2032 !
; 2033 ! ACK the message then receive everything.
; 2034 !
; 2035
; 2036 IF SEND_PACKET (MSG_ACK, P_SI_LENGTH, .REC_SEQ)
; 2037 THEN
; 2038 BEGIN
; 2039 BLK_CHK_TYPE = .INI_CHK_TYPE; ! Switch to desired form of block check
; 2040 XFR_STATUS (%C'I', %C'R'); ! Start of file receive
; 2041 RETURN STATE_RF;
; 2042 END;
; 2043
; 2044 END;
; 2045
; 2046 KRM_ERROR (KER_PROTOERR);
; 2047 RETURN STATE_A;
; 2048 END;
; 2049 !
; 2050 ! Here if we receive a receive init message.
; 2051 ! We will be sending a file to the other end.
; 2052 !
; 2053
; 2054 [MSG_RCV_INIT] :
; 2055 BEGIN
; 2056 !
; 2057 ! Move the file specification if we received one
; 2058 !
; 2059 SET_STRING (CH$PTR (FILE_NAME), MAX_FILE_NAME, TRUE);
; 2060 BFR_EMPTY ();
; 2061 FILE_SIZE = SET_STRING (0, 0, FALSE);
; 2062 CH$WCHAR (CHR_NUL, CH$PTR (FILE_NAME, .FILE_SIZE));
; 2063
; 2064 IF .FILE_SIZE GTR 0
; 2065 THEN
; 2066 BEGIN
; 2067 XFR_STATUS (%C'I', %C'S'); ! Start of a file send
; 2068 RETURN STATE_S;
; 2069 END;
; 2070
; 2071 KRM_ERROR (KER_PROTOERR);
; 2072 RETURN STATE_A;
; 2073 END;
; 2074 !
; 2075 ! Generic KERMIT commands
; 2076 !
; 2077
; 2078 [MSG_KERMIT] :
; 2079 RETURN SERVER_GENERIC ();
; 2080 !
; 2081 ! Host command
; 2082 !
; 2083
; 2084 [MSG_COMMAND] :
; 2085 RETURN HOST_COMMAND ();
; 2086 !
; 2087 ! Unimplimented server routines
; 2088 !
; 2089
; 2090 [OTHERWISE] :
; 2091 BEGIN
; 2092 KRM_ERROR (KER_UNISRV);
; 2093 RETURN STATE_A;
; 2094 END;
; 2095 TES;
; 2096
; 2097 END;
; 2098
; 2099 !
; 2100 ! If we get here, we must have gotten something random. Therefore,
; 2101 ! just send a NAK and remain in the current state (unless we have done this
; 2102 ! too many times).
; 2103 !
; 2104 NUM_RETRIES = .NUM_RETRIES + 1;
; 2105
; 2106 IF .NUM_RETRIES GTR .SI_RETRIES THEN RETURN STATE_A;
; 2107
; 2108 IF SEND_PACKET (MSG_NAK, 0, 0) THEN RETURN .STATE ELSE RETURN STATE_EX;
; 2109
; 2110 END; ! End of REC_SERVER_IDLE
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL REC.SERVER.IDLE REC_SERVER_IDLE - Idle server state
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; REC.SERVER.IDLE
U.10: JSR R1,$SAVE2 ; 1929
JSR PC,U.25 ; 1973
MOV R0,R2 ; *,STATUS
CMP R2,#272 ; STATUS,* 1978
BNE 1$
JMP 14$
1$: BIT #1,R2 ; *,STATUS 1980
BNE 2$
JMP 11$
2$: MOV U.81,R1 ; 1984
CMP R1,#111
BNE 4$
JSR PC,U.20 ; 1994
MOV R0,R2 ; *,STATUS
BIT #1,R2 ; *,STATUS
BEQ 3$
JSR PC,U.19 ; 1997
MOV #131,-(SP) ; 1999
MOV #11,-(SP)
MOV U.79,-(SP)
JSR PC,U.23
MOV R0,R2 ; *,STATUS
ADD #6,SP
BIT #1,R2 ; *,STATUS
BEQ 3$
MOV U.64,SND.PKT.SIZE ; 2002
NEG SND.PKT.SIZE
MOV SEND.TIMEOUT,SND.TIMEOUT ; 2003
NEG SND.TIMEOUT
MOV U.65,SND.NPAD ; 2004
NEG SND.NPAD
MOV U.66,SND.PADCHAR ; 2005
NEG SND.PADCHAR
MOV U.67,SND.EOL ; 2006
NEG SND.EOL
MOV U.68,SND.QUOTE.CHR ; 2007
NEG SND.QUOTE.CHR
MOV U.69,RCV.8QUOTE.CHR ; 2008
MOV U.70,CHKTYPE ; 2009
MOV U.63,SET.REPT.CHR ; 2010
MOV #17,R0 ; 2001
RTS PC
3$: MOV #242,-(SP) ; 2016
BR 10$
4$: CMP R1,#123 ; 1984
BNE 5$
MOV U.79,R0 ; 2026
INC R0
MOV R0,U.78
BIC #177700,U.78
JSR PC,U.20 ; 2028
MOV R0,R2 ; *,STATUS
ROR R2 ; STATUS
BCC 3$
JSR PC,U.19 ; 2031
MOV #131,-(SP) ; 2036
MOV #11,-(SP)
MOV U.79,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BCC 3$
MOV U.70,U.71 ; 2039
MOV #111,-(SP) ; 2040
MOV #122,-(SP)
JSR PC,XFR.STATUS
CMP (SP)+,(SP)+ ; 2036
MOV #7,R0 ; 2038
RTS PC
5$: CMP R1,#122 ; 1984
BNE 7$
MOV #FILE.NAME,-(SP) ; 2059
MOV #204,-(SP)
MOV #1,-(SP)
JSR PC,U.29
JSR PC,U.27 ; 2060
CLR (SP) ; 2061
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV R0,FILE.SIZE
CLRB FILE.NAME(R0) ; 2062
TST R0 ; 2064
BLE 6$
MOV #111,(SP) ; 2067
MOV #123,-(SP)
JSR PC,XFR.STATUS
ADD #14,SP ; 2064
MOV #1,R0 ; 2066
RTS PC
6$: MOV #242,(SP) ; 2071
JSR PC,KRM.ERROR
ADD #12,SP ; 2055
BR 12$ ; 1984
7$: CMP R1,#107
BNE 8$
JSR PC,U.14 ; 2079
RTS PC ; 1984
8$: CMP R1,#103
BNE 9$
JSR PC,U.15 ; 2085
RTS PC ; 1984
9$: MOV #232,-(SP) ; 2092
10$: JSR PC,KRM.ERROR
TST (SP)+ ; 2091
BR 12$ ; 1984
11$: INC U.77 ; 2104
CMP U.77,SI.RETRIES ; 2106
BLE 13$
12$: MOV #12,R0
RTS PC
13$: MOV #116,-(SP) ; 2108
CLR -(SP)
CLR -(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BCC 14$
MOV U.74,R0 ; 1968
RTS PC
14$: MOV #23,R0
RTS PC ; 1929
; Routine Size: 215 words, Routine Base: $CODE$ + 1732
; Maximum stack depth per invocation: 10 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2111 %SBTTL 'SEND_SERVER_INIT'
; 2112 ROUTINE SEND_SERVER_INIT =
; 2113
; 2114 !++
; 2115 ! FUNCTIONAL DESCRIPTION:
; 2116 !
; 2117 ! This routine will send a server initialization message to the
; 2118 ! remote KERMIT.
; 2119 !
; 2120 ! CALLING SEQUENCE:
; 2121 !
; 2122 ! STATE = SEND_SERVER_INIT();
; 2123 !
; 2124 ! INPUT PARAMETERS:
; 2125 !
; 2126 ! None.
; 2127 !
; 2128 ! IMPLICIT INPUTS:
; 2129 !
; 2130 ! RECV_xxx - desired receive parameters
; 2131 !
; 2132 ! OUTPUT PARAMETERS:
; 2133 !
; 2134 ! New state to change the finite state machine to.
; 2135 !
; 2136 ! IMPLICIT OUTPUTS:
; 2137 !
; 2138 ! SEND_xxx - Other Kermit's desired parameters
; 2139 !
; 2140 ! COMPLETION CODES:
; 2141 !
; 2142 ! None.
; 2143 !
; 2144 ! SIDE EFFECTS:
; 2145 !
; 2146 ! None.
; 2147 !
; 2148 !--
; 2149
; 2150 BEGIN
; 2151
; 2152 LOCAL
; 2153 OLD_OUTPUT, ! Saved terminal output routine
; 2154 STATUS; ! Status returned by various routines
; 2155
; 2156 ![026] Local routine to ignore error message output
; 2157 ROUTINE IGNORE_ERROR (ADDRESS, LENGTH) =
; 2158 BEGIN
; 2159 RETURN TRUE;
; 2160 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL IGNORE.ERROR SEND_SERVER_INIT
.NLIST
.ENABL LSB
.LIST
; IGNORE.ERROR
U.99: MOV #1,R0 ; 2158
RTS PC ; 2157
; Routine Size: 3 words, Routine Base: $CODE$ + 2610
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2161 SET_SEND_INIT ();
; 2162 ![026] If too many tries, just give up. Maybe the other Kermit doesn't
; 2163 ![026] know what to do with this packet.
; 2164
; 2165 IF .NUM_RETRIES GTR .SI_RETRIES THEN RETURN STATE_A;
; 2166
; 2167 ![026]
; 2168 ![026] Count the number of times we try this
; 2169 ![026]
; 2170 NUM_RETRIES = .NUM_RETRIES + 1;
; 2171
; 2172 IF NOT SEND_PACKET (MSG_SER_INIT, P_SI_LENGTH, .MSG_NUMBER) THEN RETURN STATE_A;
; 2173
; 2174 ![026]
; 2175 ![026] Determine if we received a packet it good condition. If we timed out
; 2176 ![026] just try again. If we get an error packet back, ignore it and
; 2177 ![026] just continue. The other Kermit must not support this packet.
; 2178 ![026]
; 2179 OLD_OUTPUT = TT_SET_OUTPUT (IGNORE_ERROR);
; 2180 STATUS = REC_PACKET ();
; 2181 TT_OUTPUT ();
; 2182 TT_SET_OUTPUT (.OLD_OUTPUT);
; 2183
; 2184 IF .STATUS EQL KER_ERRMSG THEN RETURN STATE_SG;
; 2185
; 2186 IF NOT .STATUS
; 2187 THEN
; 2188
; 2189 IF NOT ((.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL
; 2190 KER_CHKSUMERR))
; 2191 THEN
; 2192 RETURN STATE_EX
; 2193 ELSE
; 2194 RETURN .STATE;
; 2195
; 2196 !
; 2197 ! Determine if the packet is good.
; 2198 !
; 2199
; 2200 IF .REC_TYPE EQL MSG_ACK AND .REC_SEQ EQL .MSG_NUMBER
; 2201 THEN
; 2202 BEGIN
; 2203 !
; 2204 ! Here if we have an ACK for the initialization message that was just sent
; 2205 ! to the remote KERMIT.
; 2206 !
; 2207
; 2208 IF NOT (STATUS = PRS_SEND_INIT ()) THEN RETURN STATE_A;
; 2209
; 2210 NUM_RETRIES = 0;
; 2211 INIT_PKT_SENT = TRUE; ! We have exchanged init's
; 2212 RETURN STATE_SG;
; 2213 END;
; 2214
; 2215 !
; 2216 ! If we haven't returned yet, we must have gotten an invalid response.
; 2217 ! Just stay in the same state so we try again
; 2218 !
; 2219 RETURN .STATE;
; 2220 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.SERVER.INIT SEND_SERVER_INIT
.NLIST
.ENABL LSB
.LIST
; SEND.SERVER.INIT
U.2: JSR R1,$SAVE2 ; 2112
JSR PC,U.19 ; 2161
CMP U.77,SI.RETRIES ; 2165
BGT 4$
INC U.77 ; 2170
MOV #111,-(SP) ; 2172
MOV #11,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BHIS 4$
MOV #U.99,-(SP) ; 2179
JSR PC,TT.SET.OUTPUT
MOV R0,R2 ; *,OLD.OUTPUT
JSR PC,U.25 ; 2180
MOV R0,R1 ; *,STATUS
JSR PC,TT.OUTPUT ; 2181
MOV R2,(SP) ; OLD.OUTPUT,* 2182
JSR PC,TT.SET.OUTPUT
CMP R1,#152 ; STATUS,* 2184
BEQ 6$
BIT #1,R1 ; *,STATUS 2186
BNE 3$
CMP R1,#312 ; STATUS,* 2189
BEQ 1$
CMP R1,#264 ; STATUS,*
BEQ 1$
CMP R1,#162 ; STATUS,*
BEQ 1$
MOV #23,R0 ; 2186
BR 2$
1$: MOV U.74,R0
2$: TST (SP)+
RTS PC ; 2189
3$: CMP U.81,#131 ; 2200
BNE 7$
CMP U.79,U.78
BNE 7$
JSR PC,U.20 ; 2208
MOV R0,R1 ; *,STATUS
ROR R1 ; STATUS
BLO 5$
TST (SP)+
4$: MOV #12,R0
RTS PC
5$: CLR U.77 ; 2210
MOV #1,U.88 ; 2211
6$: TST (SP)+ ; 2200
MOV #14,R0 ; 2202
RTS PC
7$: TST (SP)+ ; 2112
MOV U.74,R0 ; 2150
RTS PC ; 2112
; Routine Size: 87 words, Routine Base: $CODE$ + 2616
; Maximum stack depth per invocation: 7 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2221 %SBTTL 'SEND_DATA'
; 2222 ROUTINE SEND_DATA =
; 2223
; 2224 !++
; 2225 ! FUNCTIONAL DESCRIPTION:
; 2226 !
; 2227 ! This routine will send a data message to the remote KERMIT.
; 2228 !
; 2229 ! CALLING SEQUENCE:
; 2230 !
; 2231 ! STATE = SEND_DATA();
; 2232 !
; 2233 ! INPUT PARAMETERS:
; 2234 !
; 2235 ! None.
; 2236 !
; 2237 ! IMPLICIT INPUTS:
; 2238 !
; 2239 ! None.
; 2240 !
; 2241 ! OUTPUT PARAMETERS:
; 2242 !
; 2243 ! New state to change the finite state machine to.
; 2244 !
; 2245 ! IMPLICIT OUTPUTS:
; 2246 !
; 2247 ! None.
; 2248 !
; 2249 ! COMPLETION CODES:
; 2250 !
; 2251 ! None.
; 2252 !
; 2253 ! SIDE EFFECTS:
; 2254 !
; 2255 ! None.
; 2256 !
; 2257 !--
; 2258
; 2259 BEGIN
; 2260
; 2261 LOCAL
; 2262 SUB_TYPE, ! Subtype for XFR_STATUS call
; 2263 STATUS; ! Status returned by various routines
; 2264
; 2265 !
; 2266 ! If there is nothing in the data packet, we should not bother to send it.
; 2267 ! Instead, we will just call BFR_FILL again to get some more data
; 2268 !
; 2269
; 2270 IF .SIZE GTR 0
; 2271 THEN
; 2272 BEGIN
; 2273 !
; 2274 ! Check to see if the number of retries have been exceeded.
; 2275 !
; 2276
; 2277 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 2278
; 2279 !
; 2280 ! Not exceeded yet. Increment the number of retries we have attempted
; 2281 ! on this message.
; 2282 !
; 2283 NUM_RETRIES = .NUM_RETRIES + 1;
; 2284 !
; 2285 ! Attempt to send the packet and abort if the send fails.
; 2286 !
; 2287
; 2288 IF NOT SEND_PACKET (MSG_DATA, .SIZE, .MSG_NUMBER) THEN RETURN STATE_EX;
; 2289
; 2290 !
; 2291 ! Attempt to receive a message from the remote KERMIT.
; 2292 !
; 2293 STATUS = REC_PACKET ();
; 2294
; 2295 IF NOT .STATUS
; 2296 THEN
; 2297 BEGIN
; 2298
; 2299 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL
; 2300 KER_CHKSUMERR)
; 2301 THEN
; 2302 RETURN .STATE
; 2303 ELSE
; 2304 RETURN STATE_EX;
; 2305
; 2306 END;
; 2307
; 2308 !
; 2309 ! Determine if the message is a NAK and the NAK is for the message number
; 2310 ! that we are current working on. If the NAK is for the next packet then
; 2311 ! treat it like an ACK for this packet
; 2312 !
; 2313
; 2314 IF .REC_TYPE EQL MSG_NAK AND (.REC_SEQ NEQ ((.MSG_NUMBER + 1) AND %O'77'))
; 2315 THEN
; 2316 RETURN .STATE;
; 2317
; 2318 !
; 2319 ! Make sure we have a NAK or ACK
; 2320 !
; 2321
; 2322 IF NOT (.REC_TYPE EQL MSG_ACK OR .REC_TYPE EQL MSG_NAK)
; 2323 THEN
; 2324 !
; 2325 ! Not an ACK or NAK, abort.
; 2326 !
; 2327 RETURN STATE_A;
; 2328
; 2329 !
; 2330 ! Is this for this message?
; 2331 !
; 2332
; 2333 IF .REC_TYPE EQL MSG_ACK AND .REC_SEQ NEQ .MSG_NUMBER THEN RETURN .STATE;
; 2334
; 2335 !
; 2336 ! It was. Set up for sending the next data message to the remote KERMIT
; 2337 ! and return.
; 2338 !
; 2339 !
; 2340 ! Check for data field in ACK indicating abort file or stream
; 2341 !
; 2342 !
; 2343
; 2344 IF .REC_TYPE EQL MSG_ACK AND .REC_LENGTH EQL 1
; 2345 THEN
; 2346
; 2347 SELECTONE CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG, CHR_SIZE)) OF
; 2348 SET
; 2349
; 2350 [MSG_ACK_ABT_CUR] :
; 2351 ABT_CUR_FILE = TRUE;
; 2352
; 2353 [MSG_ACK_ABT_ALL] :
; 2354 ABT_ALL_FILE = TRUE;
; 2355 TES;
; 2356
; 2357 NUM_RETRIES = 0;
; 2358 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 2359 END; ! End of IF .SIZE GTR 0
; 2360
; 2361 IF (BFR_FILL (FALSE) EQL KER_NORMAL) AND NOT (.ABT_CUR_FILE OR .ABT_ALL_FILE)
; 2362 THEN
; 2363 RETURN STATE_SD
; 2364 ELSE
; 2365 BEGIN
; 2366
; 2367 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 2368 THEN
; 2369 BEGIN
; 2370
; 2371 IF .ABT_ALL_FILE
; 2372 THEN
; 2373 TT_TEXT (UPLIT (%ASCIZ' [Group interrupted]'))
; 2374 ELSE
; 2375
; 2376 IF .ABT_CUR_FILE
; 2377 THEN
; 2378 TT_TEXT (UPLIT (%ASCIZ' [Interrupted]'))
; 2379 ELSE
; 2380 TT_TEXT (UPLIT (%ASCIZ' [OK]'));
; 2381
; 2382 TT_CRLF ();
; 2383 END;
; 2384
; 2385 IF .FILE_OPEN_FLAG THEN FILE_CLOSE (FALSE);
; 2386
; 2387 SUB_TYPE = %C'C'; ! Assume ok
; 2388
; 2389 IF .ABT_ALL_FILE
; 2390 THEN
; 2391 SUB_TYPE = %C'Z'
; 2392 ELSE
; 2393
; 2394 IF .ABT_CUR_FILE THEN SUB_TYPE = %C'X';
; 2395
; 2396 XFR_STATUS (%C'F', .SUB_TYPE);
; 2397 FILE_OPEN_FLAG = FALSE;
; 2398 RETURN STATE_SZ;
; 2399 END;
; 2400
; 2401 END;
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAD: .ASCII / [G/
.ASCII /rou/
.ASCII /p i/
.ASCII /nte/
.ASCII /rru/
.ASCII /pte/
.ASCII /d]/<00>
.ASCII <00>
P.AAE: .ASCII / [I/
.ASCII /nte/
.ASCII /rru/
.ASCII /pte/
.ASCII /d]/<00>
.ASCII <00>
P.AAF: .ASCII / [O/
.ASCII /K]/<00>
.SBTTL SEND.DATA SEND_DATA
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; SEND.DATA
U.3: JSR R1,$SAVE3 ; 2222
MOV U.75,R0 ; 2270
BLE 11$
CMP U.77,PKT.RETRIES ; 2277
BGT 5$
INC U.77 ; 2283
MOV #104,-(SP) ; 2288
MOV R0,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BHIS 1$
JSR PC,U.25 ; 2293
BIT #1,R0 ; *,STATUS 2295
BNE 2$
CMP R0,#312 ; STATUS,* 2299
BEQ 7$
CMP R0,#264 ; STATUS,*
BEQ 7$
CMP R0,#162 ; STATUS,*
BEQ 7$ ; 2297
1$: MOV #23,R0
RTS PC
2$: CLR R1 ; 2314
CMP U.81,#116
BNE 3$
INC R1
MOV U.78,R0
INC R0
MOV R0,R3
BIC #177700,R3
MOV U.79,R2
CMP R2,R3
BNE 7$ ; 2316
3$: CLR R0 ; 2322
CMP U.81,#131
BNE 4$
INC R0
BR 6$
4$: ROR R1
BLO 6$
5$: MOV #12,R0 ; 2327
RTS PC
6$: BIT #1,R0 ; 2333
BEQ 8$
CMP U.79,U.78
BEQ 8$
7$: MOV U.74,R0
RTS PC
8$: ROR R0 ; 2344
BCC 10$
CMP U.80,#1
BNE 10$
CLR R0 ; 2347
BISB U.82+4,R0
CMP R0,#130
BNE 9$
MOV #1,ABT.CUR.FILE ; 2351
BR 10$ ; 2347
9$: CMP R0,#132
BNE 10$
MOV #1,ABT.ALL.FILE ; 2354
10$: CLR U.77 ; 2357
MOV U.78,R0 ; 2358
INC R0
MOV R0,U.78
BIC #177700,U.78
11$: CLR -(SP) ; 2361
JSR PC,U.28
TST (SP)+
CMP R0,#1
BNE 12$
BIT #1,ABT.CUR.FILE
BNE 12$
BIT #1,ABT.ALL.FILE
BNE 12$
MOV #3,R0 ; 2259
RTS PC
12$: BIT #1,CONNECT.FLAG ; 2367
BNE 16$
BIT #1,TY.FIL
BEQ 16$
BIT #1,ABT.ALL.FILE ; 2371
BEQ 13$
MOV #P.AAD,-(SP) ; 2373
BR 15$
13$: BIT #1,ABT.CUR.FILE ; 2376
BEQ 14$
MOV #P.AAE,-(SP) ; 2378
BR 15$
14$: MOV #P.AAF,-(SP) ; 2380
15$: JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 2382
TST (SP)+ ; 2369
16$: BIT #1,U.84 ; 2385
BEQ 17$
CLR -(SP)
JSR PC,FILE.CLOSE
TST (SP)+
17$: MOV #103,R0 ; *,SUB.TYPE 2387
BIT #1,ABT.ALL.FILE ; 2389
BEQ 18$
MOV #132,R0 ; *,SUB.TYPE 2391
BR 19$ ; 2389
18$: BIT #1,ABT.CUR.FILE ; 2394
BEQ 19$
MOV #130,R0 ; *,SUB.TYPE
19$: MOV #106,-(SP) ; 2396
MOV R0,-(SP) ; SUB.TYPE,*
JSR PC,XFR.STATUS
CLR U.84 ; 2397
CMP (SP)+,(SP)+ ; 2365
MOV #4,R0 ; 2259
RTS PC ; 2222
; Routine Size: 190 words, Routine Base: $CODE$ + 3074
; Maximum stack depth per invocation: 8 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2402 %SBTTL 'SEND_FILE'
; 2403 ROUTINE SEND_FILE =
; 2404
; 2405 !++
; 2406 ! FUNCTIONAL DESCRIPTION:
; 2407 !
; 2408 ! This routine will send the file specification that is being
; 2409 ! transfered, or it will send a text header message.
; 2410 !
; 2411 ! CALLING SEQUENCE:
; 2412 !
; 2413 ! STATE = SEND_FILE();
; 2414 !
; 2415 ! INPUT PARAMETERS:
; 2416 !
; 2417 ! None.
; 2418 !
; 2419 ! IMPLICIT INPUTS:
; 2420 !
; 2421 ! TEXT_HEAD_FLAG - If true, send text header instead of file header
; 2422 !
; 2423 ! OUTPUT PARAMETERS:
; 2424 !
; 2425 ! New state to change the finite state machine to.
; 2426 !
; 2427 ! IMPLICIT OUTPUTS:
; 2428 !
; 2429 ! None.
; 2430 !
; 2431 ! COMPLETION CODES:
; 2432 !
; 2433 ! None.
; 2434 !
; 2435 ! SIDE EFFECTS:
; 2436 !
; 2437 ! None.
; 2438 !
; 2439 !--
; 2440
; 2441 BEGIN
; 2442
; 2443 LOCAL
; 2444 M_TYPE, ! Message type to send
; 2445 STATUS; ! Status returned by various routines
; 2446
; 2447 !
; 2448 ! Flag we don't want to abort yet
; 2449 !
; 2450 ABT_CUR_FILE = FALSE;
; 2451 ABT_ALL_FILE = FALSE;
; 2452 !
; 2453 ! First determine if we have exceed the number of retries that are
; 2454 ! allowed to attempt to send this message.
; 2455 !
; 2456
; 2457 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 2458
; 2459 !
; 2460 ! The number of retries are not exceeded. Increment the number and then
; 2461 ! attempt to send the packet again.
; 2462 !
; 2463 NUM_RETRIES = .NUM_RETRIES + 1;
; 2464 SIZE = 0; ! Assume no name
; 2465
; 2466 IF .TEXT_HEAD_FLAG THEN M_TYPE = MSG_TEXT ELSE M_TYPE = MSG_FILE;
; 2467
; 2468 IF .FILE_SIZE NEQ 0 AND NOT .NO_FILE_NEEDED
; 2469 THEN
; 2470 BEGIN
; 2471 ![025] CH$MOVE (.FILE_SIZE, CH$PTR (FILE_NAME),
; 2472 ![025] CH$PTR (SND_MSG, PKT_MSG,
; 2473 ![025] CHR_SIZE));
; 2474 ![025]
; 2475 ![025] Fill packet with file name
; 2476 ![025]
; 2477 SET_STRING (CH$PTR (FILE_NAME), .FILE_SIZE, TRUE);
; 2478 BFR_FILL (TRUE);
; 2479 SET_STRING (0, 0, FALSE);
; 2480 END;
; 2481
; 2482 IF NOT SEND_PACKET (.M_TYPE, .SIZE, .MSG_NUMBER) THEN RETURN STATE_EX;
; 2483
; 2484 !
; 2485 ! Now get the responce from the remote KERMIT.
; 2486 !
; 2487 STATUS = REC_PACKET ();
; 2488
; 2489 IF NOT .STATUS
; 2490 THEN
; 2491 BEGIN
; 2492
; 2493 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL KER_CHKSUMERR)
; 2494 THEN
; 2495 RETURN .STATE
; 2496 ELSE
; 2497 RETURN STATE_EX;
; 2498
; 2499 END;
; 2500
; 2501 !
; 2502 ! Determine if the packet is good.
; 2503 !
; 2504
; 2505 IF NOT (.REC_TYPE EQL MSG_ACK OR .REC_TYPE EQL MSG_NAK) THEN RETURN STATE_A;
; 2506
; 2507 !
; 2508 ! If this is a NAK and the message number is not the one we just send
; 2509 ! treat this like an ACK, otherwise resend the last packet.
; 2510 !
; 2511
; 2512 IF .REC_TYPE EQL MSG_NAK AND (.REC_SEQ NEQ ((.MSG_NUMBER + 1) AND %O'77')) THEN RETURN .STATE;
; 2513
; 2514 IF .REC_TYPE EQL MSG_ACK AND .REC_SEQ NEQ .MSG_NUMBER THEN RETURN .STATE;
; 2515
; 2516 !
; 2517 ! If all is ok, bump the message number and fill first buffer
; 2518 !
; 2519 NUM_RETRIES = 0;
; 2520 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 2521
; 2522 IF BFR_FILL (TRUE) THEN RETURN STATE_SD ELSE RETURN STATE_A;
; 2523
; 2524 END; ! End of SEND_FILE
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.FILE SEND_FILE
.NLIST
.ENABL LSB
.LIST
; SEND.FILE
U.4: JSR R1,$SAVE3 ; 2403
CLR ABT.CUR.FILE ; 2450
CLR ABT.ALL.FILE ; 2451
CMP U.77,PKT.RETRIES ; 2457
BGT 11$
INC U.77 ; 2463
CLR U.75 ; 2464
BIT #1,U.86 ; 2466
BEQ 1$
MOV #130,R1 ; *,M.TYPE
BR 2$
1$: MOV #106,R1 ; *,M.TYPE
2$: MOV FILE.SIZE,R0 ; 2468
BEQ 3$
BIT #1,U.87
BNE 3$
MOV #FILE.NAME,-(SP) ; 2477
MOV R0,-(SP)
MOV #1,-(SP)
JSR PC,U.29
MOV #1,(SP) ; 2478
JSR PC,U.28
CLR (SP) ; 2479
CLR -(SP)
CLR -(SP)
JSR PC,U.29
ADD #12,SP ; 2470
3$: MOV R1,-(SP) ; M.TYPE,* 2482
MOV U.75,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BHIS 4$
JSR PC,U.25 ; 2487
BIT #1,R0 ; *,STATUS 2489
BNE 5$
CMP R0,#312 ; STATUS,* 2493
BEQ 9$
CMP R0,#264 ; STATUS,*
BEQ 9$
CMP R0,#162 ; STATUS,*
BEQ 9$ ; 2491
4$: MOV #23,R0
RTS PC
5$: MOV U.81,R0 ; 2505
CLR R1
CMP R0,#131
BNE 6$
INC R1
BR 7$
6$: CMP R0,#116
BNE 11$
7$: CMP R0,#116 ; 2512
BNE 8$
MOV U.78,R0
INC R0
MOV R0,R3
BIC #177700,R3
MOV U.79,R2
CMP R2,R3
BNE 9$
8$: ROR R1 ; 2514
BCC 10$
CMP U.79,U.78
BEQ 10$
9$: MOV U.74,R0
RTS PC
10$: CLR U.77 ; 2519
MOV U.78,R0 ; 2520
INC R0
MOV R0,U.78
BIC #177700,U.78
MOV #1,-(SP) ; 2522
JSR PC,U.28
TST (SP)+
ROR R0
BCC 11$
MOV #3,R0 ; 2441
RTS PC
11$: MOV #12,R0
RTS PC ; 2403
; Routine Size: 132 words, Routine Base: $CODE$ + 3670
; Maximum stack depth per invocation: 10 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2525 %SBTTL 'SEND_EOF'
; 2526 ROUTINE SEND_EOF =
; 2527
; 2528 !++
; 2529 ! FUNCTIONAL DESCRIPTION:
; 2530 !
; 2531 ! This routine will send the end of file message to the remote
; 2532 ! KERMIT. It will then determine if there are more files to
; 2533 ! send to the remote.
; 2534 !
; 2535 ! CALLING SEQUENCE:
; 2536 !
; 2537 ! STATE = SEND_EOF();
; 2538 !
; 2539 ! INPUT PARAMETERS:
; 2540 !
; 2541 ! None.
; 2542 !
; 2543 ! IMPLICIT INPUTS:
; 2544 !
; 2545 ! None.
; 2546 !
; 2547 ! OUTPUT PARAMETERS:
; 2548 !
; 2549 ! New state to change the finite state machine to.
; 2550 !
; 2551 ! IMPLICIT OUTPUTS:
; 2552 !
; 2553 ! None.
; 2554 !
; 2555 ! COMPLETION CODES:
; 2556 !
; 2557 ! None.
; 2558 !
; 2559 ! SIDE EFFECTS:
; 2560 !
; 2561 ! Sets up for the next file to be processed if there is one.
; 2562 !
; 2563 !--
; 2564
; 2565 BEGIN
; 2566
; 2567 LOCAL
; 2568 STATUS, ! Status returned by various routines
; 2569 EOF_MSG_LEN; ! Length of EOF message to send
; 2570
; 2571 !
; 2572 ! First determine if we have exceed the number of retries that are
; 2573 ! allowed to attempt to send this message.
; 2574 !
; 2575
; 2576 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 2577
; 2578 !
; 2579 ! The number of retries are not exceeded. Increment the number and then
; 2580 ! attempt to send the packet again.
; 2581 !
; 2582 NUM_RETRIES = .NUM_RETRIES + 1;
; 2583 !
; 2584 ! Store character in packet to indicate discard of file
; 2585 ! Character will only be sent if file should be discarded
; 2586 !
; 2587 CH$WCHAR (MSG_EOF_DISCARD, CH$PTR (SND_MSG, PKT_MSG, CHR_SIZE));
; 2588
; 2589 IF .ABT_CUR_FILE OR .ABT_ALL_FILE THEN EOF_MSG_LEN = 1 ELSE EOF_MSG_LEN = 0;
; 2590
; 2591 IF NOT SEND_PACKET (MSG_EOF, .EOF_MSG_LEN, .MSG_NUMBER) THEN RETURN STATE_EX;
; 2592
; 2593 !
; 2594 ! Now get the responce from the remote KERMIT.
; 2595 !
; 2596 STATUS = REC_PACKET ();
; 2597
; 2598 IF NOT .STATUS
; 2599 THEN
; 2600 BEGIN
; 2601
; 2602 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL KER_CHKSUMERR)
; 2603 THEN
; 2604 RETURN .STATE
; 2605 ELSE
; 2606 RETURN STATE_EX;
; 2607
; 2608 END;
; 2609
; 2610 !
; 2611 ! Determine if the packet is good.
; 2612 !
; 2613
; 2614 IF NOT (.REC_TYPE EQL MSG_ACK OR .REC_TYPE EQL MSG_NAK) THEN RETURN STATE_A;
; 2615
; 2616 !
; 2617 ! If this is a NAK and the message number is not the one we just send
; 2618 ! treat this like an ACK, otherwise resend the last packet.
; 2619 !
; 2620
; 2621 IF .REC_TYPE EQL MSG_NAK AND (.REC_SEQ NEQ ((.MSG_NUMBER + 1) AND %O'77')) THEN RETURN .STATE;
; 2622
; 2623 IF .REC_TYPE EQL MSG_ACK AND .REC_SEQ NEQ .MSG_NUMBER THEN RETURN .STATE;
; 2624
; 2625 !
; 2626 ! Here to determine if there is another file to send.
; 2627 !
; 2628 NUM_RETRIES = 0;
; 2629 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 2630
; 2631 IF NOT .ABT_ALL_FILE THEN STATUS = NEXT_FILE () ELSE STATUS = KER_NOMORFILES;
; 2632
; 2633 IF ( NOT .STATUS) OR (.STATUS EQL KER_NOMORFILES)
; 2634 THEN
; 2635 BEGIN
; 2636 IF (.STATUS NEQ KER_NOMORFILES) THEN
; 2637 RETURN STATE_A
; 2638 ELSE
; 2639 RETURN STATE_SB;
; 2640 END
; 2641 ELSE
; 2642 BEGIN
; 2643 FILE_OPEN_FLAG = TRUE; ! Have a file open again
; 2644 IF .FIL_NORMAL_FORM THEN NORMALIZE_FILE (FILE_NAME, FILE_SIZE, -1, -1);
; 2645
; 2646 XFR_STATUS (%C'F', %C'S'); ! Inform display routine
; 2647
; 2648 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 2649 THEN
; 2650 BEGIN
; 2651 TT_TEXT (UPLIT (%ASCIZ'Sending: '));
; 2652 TT_TEXT (FILE_NAME);
; 2653 TT_OUTPUT ();
; 2654 END;
; 2655
; 2656 FILE_CHARS = 0; ! No characters sent yet
; 2657 RETURN STATE_SF;
; 2658 END;
; 2659
; 2660 END; ! End of SEND_EOF
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAG: .ASCII /Sen/
.ASCII /din/
.ASCII /g: /
.ASCII <00>
.SBTTL SEND.EOF SEND_EOF
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; SEND.EOF
U.7: JSR R1,$SAVE4 ; 2526
CMP U.77,PKT.RETRIES ; 2576
BGT 17$
INC U.77 ; 2582
MOVB #104,U.83+4 ; 2587
BIT #1,ABT.CUR.FILE ; 2589
BNE 1$
BIT #1,ABT.ALL.FILE
BEQ 2$
1$: MOV #1,R0 ; *,EOF.MSG.LEN
BR 3$
2$: CLR R0 ; EOF.MSG.LEN
3$: MOV #132,-(SP) ; 2591
MOV R0,-(SP) ; EOF.MSG.LEN,*
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BLO 4$
MOV #23,R0
RTS PC
4$: JSR PC,U.25 ; 2596
BIT #1,R0 ; *,STATUS 2598
BNE 8$
CMP R0,#312 ; STATUS,* 2602
BEQ 5$
CMP R0,#264 ; STATUS,*
BEQ 5$
CMP R0,#162 ; STATUS,*
BNE 6$
5$: MOV U.74,R1 ; 2600
BR 7$
6$: MOV #23,R1
7$: MOV R1,R0
RTS PC
8$: MOV U.81,R1 ; 2614
CLR R2
CMP R1,#131
BNE 9$
INC R2
BR 10$
9$: CMP R1,#116
BNE 17$
10$: CMP R1,#116 ; 2621
BNE 11$
MOV U.78,R1
INC R1
MOV R1,R4
BIC #177700,R4
MOV U.79,R3
CMP R3,R4
BNE 12$
11$: ROR R2 ; 2623
BCC 13$
CMP U.79,U.78
BEQ 13$
12$: MOV U.74,R0
RTS PC
13$: CLR U.77 ; 2628
MOV U.78,R1 ; 2629
INC R1
MOV R1,U.78
BIC #177700,U.78
BIT #1,ABT.ALL.FILE ; 2631
BNE 14$
JSR PC,NEXT.FILE
BR 15$
14$: MOV #121,R0 ; *,STATUS
15$: BIT #1,R0 ; *,STATUS 2633
BEQ 16$
CMP R0,#121 ; STATUS,*
BNE 19$
16$: CMP R0,#121 ; STATUS,* 2636
BEQ 18$
17$: MOV #12,R0 ; 2635
RTS PC
18$: MOV #5,R0
RTS PC ; 2565
19$: MOV #1,U.84 ; 2643
BIT #1,FIL.NORMAL.FORM ; 2644
BEQ 20$
MOV #FILE.NAME,-(SP)
MOV #FILE.SIZE,-(SP)
MOV #-1,-(SP)
MOV (SP),-(SP)
JSR PC,U.26
ADD #10,SP
20$: MOV #106,-(SP) ; 2646
MOV #123,-(SP)
JSR PC,XFR.STATUS
BIT #1,CONNECT.FLAG ; 2648
BNE 21$
BIT #1,TY.FIL
BEQ 21$
MOV #P.AAG,(SP) ; 2651
JSR PC,TT.TEXT
MOV #FILE.NAME,(SP) ; 2652
JSR PC,TT.TEXT
JSR PC,TT.OUTPUT ; 2653
21$: CLR U.85 ; 2656
CMP (SP)+,(SP)+ ; 2642
MOV #2,R0 ; 2565
RTS PC ; 2526
; Routine Size: 173 words, Routine Base: $CODE$ + 4300
; Maximum stack depth per invocation: 10 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2661 %SBTTL 'SEND_INIT'
; 2662 ROUTINE SEND_INIT =
; 2663
; 2664 !++
; 2665 ! FUNCTIONAL DESCRIPTION:
; 2666 !
; 2667 ! This routine will send the initialization packet to the remote
; 2668 ! KERMIT. The message type sent is S.
; 2669 !
; 2670 ! CALLING SEQUENCE:
; 2671 !
; 2672 ! STATE = SEND_INIT();
; 2673 !
; 2674 ! INPUT PARAMETERS:
; 2675 !
; 2676 ! None.
; 2677 !
; 2678 ! IMPLICIT INPUTS:
; 2679 !
; 2680 ! None.
; 2681 !
; 2682 ! OUTPUT PARAMETERS:
; 2683 !
; 2684 ! New state to change the finite state machine to.
; 2685 !
; 2686 ! IMPLICIT OUTPUTS:
; 2687 !
; 2688 ! None.
; 2689 !
; 2690 ! COMPLETION CODES:
; 2691 !
; 2692 ! None.
; 2693 !
; 2694 ! SIDE EFFECTS:
; 2695 !
; 2696 ! None.
; 2697 !
; 2698 !--
; 2699
; 2700 BEGIN
; 2701
; 2702 LOCAL
; 2703 STATUS; ! Status returned by various routines
; 2704
; 2705 SET_SEND_INIT ();
; 2706
; 2707 IF .NUM_RETRIES GTR .SI_RETRIES THEN RETURN STATE_A;
; 2708
; 2709 !
; 2710 ! Count the number of times we try this
; 2711 !
; 2712 NUM_RETRIES = .NUM_RETRIES + 1;
; 2713
; 2714 IF NOT SEND_PACKET (MSG_SND_INIT, P_SI_LENGTH, .MSG_NUMBER) THEN RETURN STATE_EX;
; 2715
; 2716 !
; 2717 ! Determine if we received a packet it good condition. If we timed out or
; 2718 ! got an illegal message, just try again.
; 2719 !
; 2720 STATUS = REC_PACKET ();
; 2721
; 2722 IF NOT .STATUS
; 2723 THEN
; 2724 BEGIN
; 2725
; 2726 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL KER_CHKSUMERR)
; 2727 THEN
; 2728 RETURN .STATE
; 2729 ELSE
; 2730 RETURN STATE_EX;
; 2731
; 2732 END;
; 2733
; 2734 !
; 2735 ! Determine if the packet is good.
; 2736 !
; 2737
; 2738 IF .REC_TYPE NEQ MSG_ACK THEN RETURN .STATE;
; 2739
; 2740 IF .REC_SEQ NEQ .MSG_NUMBER THEN RETURN .STATE;
; 2741
; 2742 !
; 2743 ! Here if we have an ACK for the initialization message that was just sent
; 2744 ! to the remote KERMIT.
; 2745 !
; 2746
; 2747 IF NOT (STATUS = PRS_SEND_INIT ()) THEN RETURN STATE_A;
; 2748
; 2749 BLK_CHK_TYPE = .INI_CHK_TYPE; ! We now use agreed upon block check type
; 2750 NUM_RETRIES = 0;
; 2751 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 2752 RETURN STATE_OF; ! Now need to open the file
; 2753 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.INIT SEND_INIT
.NLIST
.ENABL LSB
.LIST
; SEND.INIT
U.8: MOV R1,-(SP) ; 2662
JSR PC,U.19 ; 2705
CMP U.77,SI.RETRIES ; 2707
BGT 8$
INC U.77 ; 2712
MOV #123,-(SP) ; 2714
MOV #11,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BLO 1$
MOV #23,R0
BR 10$
1$: JSR PC,U.25 ; 2720
BIT #1,R0 ; *,STATUS 2722
BNE 5$
CMP R0,#312 ; STATUS,* 2726
BEQ 2$
CMP R0,#264 ; STATUS,*
BEQ 2$
CMP R0,#162 ; STATUS,*
BNE 3$
2$: MOV U.74,R1 ; 2724
BR 4$
3$: MOV #23,R1
4$: MOV R1,R0
BR 10$
5$: CMP U.81,#131 ; 2738
BNE 6$
CMP U.79,U.78 ; 2740
BEQ 7$
6$: MOV U.74,R0
BR 10$
7$: JSR PC,U.20 ; 2747
ROR R0 ; STATUS
BLO 9$
8$: MOV #12,R0
BR 10$
9$: MOV U.70,U.71 ; 2749
CLR U.77 ; 2750
MOV U.78,R0 ; 2751
INC R0
MOV R0,U.78
BIC #177700,U.78
MOV #22,R0 ; 2700
10$: MOV (SP)+,R1 ; 2662
RTS PC
; Routine Size: 80 words, Routine Base: $CODE$ + 5032
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2754 %SBTTL 'SEND_OPEN_FILE - Open file for sending'
; 2755 ROUTINE SEND_OPEN_FILE =
; 2756
; 2757 !++
; 2758 ! FUNCTIONAL DESCRIPTION:
; 2759 !
; 2760 ! This routine is called from DO_TRANSACTION when the first input file
; 2761 ! needs to be opened.
; 2762 !
; 2763 ! CALLING SEQUENCE:
; 2764 !
; 2765 ! STATE = SEND_OPEN_FILE ();
; 2766 !
; 2767 ! INPUT PARAMETERS:
; 2768 !
; 2769 ! None.
; 2770 !
; 2771 ! IMPLICIT INPUTS:
; 2772 !
; 2773 ! FILE_NAME, FILE_SIZE, etc.
; 2774 !
; 2775 ! OUPTUT PARAMETERS:
; 2776 !
; 2777 ! New state for FSM.
; 2778 !
; 2779 ! IMPLICIT OUTPUTS:
; 2780 !
; 2781 ! None.
; 2782 !
; 2783 ! COMPLETION CODES:
; 2784 !
; 2785 ! None.
; 2786 !
; 2787 ! SIDE EFFECTS:
; 2788 !
; 2789 ! None.
; 2790 !
; 2791 !--
; 2792
; 2793 BEGIN
; 2794
; 2795 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 2796 THEN
; 2797 BEGIN
; 2798 TT_TEXT (UPLIT (%ASCIZ'Sending: '));
; 2799 TT_OUTPUT ();
; 2800 END;
; 2801
; 2802 FILE_CHARS = 0; ! No characters sent yet
; 2803
; 2804 IF NOT .NO_FILE_NEEDED
; 2805 THEN
; 2806
; 2807 IF NOT FILE_OPEN (FNC_READ) THEN RETURN STATE_A ELSE FILE_OPEN_FLAG = TRUE;
; 2808
; 2809 ![023]
; 2810 ![023] If we want normalized file names, beat up the name now
; 2811 ![023]
; 2812
; 2813 IF .FIL_NORMAL_FORM THEN NORMALIZE_FILE (FILE_NAME, FILE_SIZE, -1, -1);
; 2814
; 2815 XFR_STATUS (%C'F', %C'S'); ! Inform display routine
; 2816
; 2817 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 2818 THEN
; 2819 BEGIN
; 2820 TT_TEXT (FILE_NAME);
; 2821 TT_OUTPUT ();
; 2822 END;
; 2823
; 2824 RETURN STATE_SF;
; 2825 END; ! End of FSM_OPEN_FILE
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAH: .ASCII /Sen/
.ASCII /din/
.ASCII /g: /
.ASCII <00>
.SBTTL SEND.OPEN.FILE SEND_OPEN_FILE - Open file for sending
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; SEND.OPEN.FILE
U.5: BIT #1,CONNECT.FLAG ; 2795
BNE 1$
BIT #1,TY.FIL
BEQ 1$
MOV #P.AAH,-(SP) ; 2798
JSR PC,TT.TEXT
JSR PC,TT.OUTPUT ; 2799
TST (SP)+ ; 2797
1$: CLR U.85 ; 2802
BIT #1,U.87 ; 2804
BNE 3$
CLR -(SP) ; 2807
JSR PC,FILE.OPEN
TST (SP)+
ROR R0
BLO 2$
MOV #12,R0
RTS PC
2$: MOV #1,U.84
3$: BIT #1,FIL.NORMAL.FORM ; 2813
BEQ 4$
MOV #FILE.NAME,-(SP)
MOV #FILE.SIZE,-(SP)
MOV #-1,-(SP)
MOV (SP),-(SP)
JSR PC,U.26
ADD #10,SP
4$: MOV #106,-(SP) ; 2815
MOV #123,-(SP)
JSR PC,XFR.STATUS
BIT #1,CONNECT.FLAG ; 2817
BNE 5$
BIT #1,TY.FIL
BEQ 5$
MOV #FILE.NAME,(SP) ; 2820
JSR PC,TT.TEXT
JSR PC,TT.OUTPUT ; 2821
5$: CMP (SP)+,(SP)+ ; 2755
MOV #2,R0 ; 2793
RTS PC ; 2755
; Routine Size: 72 words, Routine Base: $CODE$ + 5272
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2826 %SBTTL 'SEND_GENCMD'
; 2827 ROUTINE SEND_GENCMD =
; 2828
; 2829 !++
; 2830 ! FUNCTIONAL DESCRIPTION:
; 2831 !
; 2832 ! This routine will send a command packet to the server Kermit.
; 2833 ! The new state will depend upon the response. If a send-init
; 2834 ! is received, it will process it and switch to STATE_RF.
; 2835 ! If a text-header is received it will switch to STATE_RD.
; 2836 ! If an ACK is received, it will type the data portion and
; 2837 ! switch to STATE_C.
; 2838 !
; 2839 ! CALLING SEQUENCE:
; 2840 !
; 2841 ! STATE = SEND_GENCMD();
; 2842 !
; 2843 ! INPUT PARAMETERS:
; 2844 !
; 2845 ! None.
; 2846 !
; 2847 ! IMPLICIT INPUTS:
; 2848 !
; 2849 ! GEN_TYPE - Message type to send (normally MSG_KERMIT)
; 2850 ! GEN_SUBTYPE - Message subtype (only if MSG_KERMIT)
; 2851 ! GEN_1DATA - First argument string
; 2852 ! GEN_1SIZE - Size of first argument
; 2853 ! GEN_2DATA - Second argument string
; 2854 ! GEN_2SIZE - Size of second argument
; 2855 ! GEN_3DATA - Third argument string
; 2856 ! GEN_3SIZE - Size of third argument
; 2857 !
; 2858 ! OUTPUT PARAMETERS:
; 2859 !
; 2860 ! New state for the finite state machine.
; 2861 !
; 2862 ! IMPLICIT OUTPUTS:
; 2863 !
; 2864 ! None.
; 2865 !
; 2866 ! COMPLETION CODES:
; 2867 !
; 2868 ! None.
; 2869 !
; 2870 ! SIDE EFFECTS:
; 2871 !
; 2872 ! None.
; 2873 !
; 2874 !--
; 2875
; 2876 BEGIN
; 2877
; 2878 LOCAL
; 2879 POINTER, ! Pointer at DATA_TEXT
; 2880 DATA_TEXT : VECTOR [CH$ALLOCATION (MAX_MSG)], ! Data buffer
; 2881 DATA_SIZE, ! Length of data buffer used
; 2882 STATUS; ! Status returned by various routines
; 2883
; 2884 ROUTINE PACK_DATA (POINTER, LENGTH, SRC_ADDR, SRC_LEN) =
; 2885 !
; 2886 ! Routine to pack an argument into the buffer.
; 2887 !
; 2888 BEGIN
; 2889
; 2890 IF .SRC_LEN GTR MAX_MSG - .LENGTH - 1 THEN SRC_LEN = MAX_MSG - .LENGTH - 1;
; 2891
; 2892 LENGTH = .LENGTH + .SRC_LEN + 1;
; 2893 CH$WCHAR_A (CHAR (.SRC_LEN), .POINTER);
; 2894 .POINTER = CH$MOVE (.SRC_LEN, CH$PTR (.SRC_ADDR), ..POINTER);
; 2895 RETURN .LENGTH;
; 2896 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL PACK.DATA SEND_GENCMD
.NLIST
.ENABL LSB
.LIST
; PACK.DATA
U.100: JSR R1,$SAVE2 ; 2884
MOV 14(SP),R0 ; LENGTH,* 2890
SUB #137,R0
MOV R0,R1
NEG R1
CMP 10(SP),R1 ; SRC.LEN,*
BLE 1$
NEG R0
MOV R0,10(SP) ; *,SRC.LEN
1$: MOV 10(SP),R1 ; SRC.LEN,* 2892
MOV R1,R0
ADD 14(SP),R0 ; LENGTH,*
MOV R0,14(SP) ; *,LENGTH
INC 14(SP) ; LENGTH
MOV @16(SP),R0 ; POINTER,* 2893
MOV R1,R2
ADD #40,R2
MOVB R2,(R0)
INC @16(SP) ; POINTER
MOV R1,-(SP) ; 2894
MOV 14(SP),-(SP) ; SRC.ADDR,*
MOV @22(SP),-(SP) ; POINTER,*
JSR PC,BL$MOV
MOV R0,@24(SP) ; *,POINTER
ADD #6,SP ; 2884
MOV 14(SP),R0 ; LENGTH,* 2888
RTS PC ; 2884
; Routine Size: 45 words, Routine Base: $CODE$ + 5512
; Maximum stack depth per invocation: 7 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 2897 !
; 2898 ! First determine if we have exceed the number of retries that are
; 2899 ! allowed to attempt to send this message.
; 2900 !
; 2901
; 2902 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 2903
; 2904 !
; 2905 ! The number of retries are not exceeded. Increment the number and then
; 2906 ! attempt to send the packet again.
; 2907 !
; 2908 NUM_RETRIES = .NUM_RETRIES + 1;
; 2909 !
; 2910 ! Build the packet data field
; 2911 !
; 2912 POINTER = CH$PTR (DATA_TEXT);
; 2913 DATA_SIZE = 0;
; 2914
; 2915 IF .GEN_TYPE EQL MSG_KERMIT
; 2916 THEN
; 2917 BEGIN
; 2918 CH$WCHAR_A (.GEN_SUBTYPE, POINTER);
; 2919 DATA_SIZE = 1;
; 2920
; 2921 IF .GEN_1SIZE GTR 0 OR .GEN_2SIZE GTR 0 OR .GEN_3SIZE GTR 0
; 2922 THEN
; 2923 BEGIN
; 2924 DATA_SIZE = PACK_DATA (POINTER, .DATA_SIZE, GEN_1DATA, .GEN_1SIZE);
; 2925
; 2926 IF .GEN_2SIZE GTR 0 OR .GEN_3SIZE GTR 0
; 2927 THEN
; 2928 BEGIN
; 2929 DATA_SIZE = PACK_DATA (POINTER, .DATA_SIZE, GEN_2DATA, .GEN_2SIZE);
; 2930
; 2931 IF .GEN_3SIZE GTR 0
; 2932 THEN
; 2933 BEGIN
; 2934 DATA_SIZE = PACK_DATA (POINTER, .DATA_SIZE, GEN_3DATA, .GEN_3SIZE);
; 2935 END;
; 2936
; 2937 END;
; 2938
; 2939 END;
; 2940
; 2941 END
; 2942 ELSE
; 2943 BEGIN
; 2944
; 2945 IF .GEN_1SIZE GTR MAX_MSG THEN GEN_1SIZE = MAX_MSG;
; 2946
; 2947 DATA_SIZE = .GEN_1SIZE;
; 2948 CH$MOVE (.GEN_1SIZE, CH$PTR (GEN_1DATA), .POINTER);
; 2949 END;
; 2950
; 2951 SET_STRING (CH$PTR (DATA_TEXT), .DATA_SIZE, TRUE);
; 2952 BFR_FILL (TRUE);
; 2953 SET_STRING (0, 0, FALSE);
; 2954 !
; 2955 ! Send the packet
; 2956 !
; 2957
; 2958 IF NOT SEND_PACKET (.GEN_TYPE, .SIZE, .MSG_NUMBER) THEN RETURN STATE_EX;
; 2959
; 2960 !
; 2961 ! Now get the responce from the remote KERMIT.
; 2962 !
; 2963 STATUS = REC_PACKET ();
; 2964
; 2965 IF NOT .STATUS
; 2966 THEN
; 2967 BEGIN
; 2968
; 2969 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL KER_CHKSUMERR)
; 2970 THEN
; 2971 RETURN .STATE
; 2972 ELSE
; 2973 RETURN STATE_EX;
; 2974
; 2975 END;
; 2976
; 2977 ! Did we get a send-init?
; 2978
; 2979 SELECTONE .REC_TYPE OF
; 2980 SET
; 2981
; 2982 [MSG_SND_INIT] :
; 2983 BEGIN
; 2984 MSG_NUMBER = .REC_SEQ; ! Initialize sequence numbers
; 2985 ! Determine if the parameters are ok. If not, give up
; 2986
; 2987 IF NOT (STATUS = PRS_SEND_INIT ()) THEN RETURN .STATUS;
; 2988
; 2989 SET_SEND_INIT (); ! Set up our acknowledgement to the send-init
; 2990 SEND_PACKET (MSG_ACK, P_SI_LENGTH, .MSG_NUMBER); ! Send it
; 2991 BLK_CHK_TYPE = .INI_CHK_TYPE; ! Can now use agreed upon type
; 2992 OLD_RETRIES = .NUM_RETRIES;
; 2993 NUM_RETRIES = 0;
; 2994 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 2995 RETURN STATE_RF; ! Now expect file header
; 2996 END;
; 2997
; 2998 [MSG_TEXT] :
; 2999 !
; 3000 ! If we just got a text header, set up for typing on the terminal and
; 3001 ! shift to receiving data
; 3002 !
; 3003 BEGIN
; 3004 TEXT_HEAD_FLAG = TRUE; ! We want terminal output
; 3005 PUT_CHR_ROUTINE = TYPE_CHAR; ! Set up the put a character routine
; 3006 BFR_EMPTY (); ! Dump the packet data to the terminal
; 3007 TT_CRLF (); ! And a CRLF
; 3008 TT_OUTPUT (); ! Dump the output
; 3009 SEND_PACKET (MSG_ACK, 0, .MSG_NUMBER); ! Send an ACK
; 3010 OLD_RETRIES = .NUM_RETRIES;
; 3011 NUM_RETRIES = 0;
; 3012 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3013 RETURN STATE_RD; ! We now want data
; 3014 END;
; 3015
; 3016 [MSG_ACK] :
; 3017 !
; 3018 ! If we get an ACK, just type the data on the terminal and complete the
; 3019 ! transaction.
; 3020 !
; 3021 BEGIN
; 3022 PUT_CHR_ROUTINE = TYPE_CHAR; ! Dump to terminal
; 3023 BFR_EMPTY (); ! Do it
; 3024
; 3025 IF .REC_LENGTH GTR 0 THEN TT_CRLF ();
; 3026
; 3027 RETURN STATE_C; ! And go idle
; 3028 END;
; 3029
; 3030 [MSG_NAK] :
; 3031 !
; 3032 ! If we get a NAK, stay in the same state. We will re-transmit the
; 3033 ! packet again.
; 3034 !
; 3035 RETURN .STATE;
; 3036 TES;
; 3037
; 3038 !
; 3039 ! If we get here, we didn't get anything resembling an acceptable
; 3040 ! packet, so we will abort.
; 3041 !
; 3042 RETURN STATE_A;
; 3043 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.GENCMD SEND_GENCMD
.NLIST
.ENABL LSB
.LIST
; SEND.GENCMD
U.6: MOV R1,-(SP) ; 2827
SUB #142,SP
CMP U.77,PKT.RETRIES ; 2902
BLE 1$
JMP 21$
1$: INC U.77 ; 2908
MOV #2,(SP) ; *,POINTER 2912
ADD SP,(SP) ; DATA.TEXT,POINTER
CLR R1 ; DATA.SIZE 2913
MOV GEN.1SIZE,R0 ; 2921
CMP U.89,#107 ; 2915
BNE 6$
MOVB U.90,@0(SP) ; *,POINTER 2918
INC (SP) ; POINTER
MOV #1,R1 ; *,DATA.SIZE 2919
TST R0 ; 2921
BGT 2$
TST GEN.2SIZE
BGT 2$
TST GEN.3SIZE
BLE 8$
2$: MOV #2,-(SP) ; 2924
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.1DATA,-(SP)
MOV R0,-(SP)
JSR PC,U.100
MOV R0,R1 ; *,DATA.SIZE
MOV GEN.2SIZE,R0 ; 2926
BGT 3$
TST GEN.3SIZE
BLE 5$
3$: MOV #10,(SP) ; 2929
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.2DATA,-(SP)
MOV R0,-(SP)
JSR PC,U.100
MOV R0,R1 ; *,DATA.SIZE
MOV GEN.3SIZE,R0 ; 2931
BLE 4$
MOV #16,(SP) ; 2934
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.3DATA,-(SP)
MOV R0,-(SP)
JSR PC,U.100
MOV R0,R1 ; *,DATA.SIZE
ADD #6,SP ; 2933
4$: ADD #6,SP ; 2928
5$: ADD #10,SP ; 2923
BR 8$ ; 2915
6$: CMP R0,#140 ; 2945
BLE 7$
MOV #140,GEN.1SIZE
7$: MOV GEN.1SIZE,R1 ; *,DATA.SIZE 2947
MOV R1,-(SP) ; GEN.1SIZE,* 2948
MOV #GEN.1DATA,-(SP)
MOV 4(SP),-(SP) ; POINTER,*
JSR PC,BL$MOV
ADD #6,SP ; 2943
8$: MOV #4,-(SP) ; 2951
ADD SP,(SP) ; DATA.TEXT,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #1,-(SP)
JSR PC,U.29
MOV #1,(SP) ; 2952
JSR PC,U.28
CLR (SP) ; 2953
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV U.89,(SP) ; 2958
MOV U.75,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
CMP (SP)+,(SP)+
ROR R0
BLO 9$
ADD #12,SP
MOV #23,R0
BR 18$
9$: JSR PC,U.25 ; 2963
BIT #1,R0 ; *,STATUS 2965
BNE 13$
CMP R0,#312 ; STATUS,* 2969
BEQ 10$
CMP R0,#264 ; STATUS,*
BEQ 10$
CMP R0,#162 ; STATUS,*
BNE 11$
10$: MOV U.74,R1 ; 2967
BR 12$
11$: MOV #23,R1
12$: ADD #12,SP ; 2965
MOV R1,R0 ; 2967
BR 22$
13$: MOV U.81,R1 ; 2979
CMP R1,#123
BNE 15$
MOV U.79,U.78 ; 2984
JSR PC,U.20 ; 2987
BIT #1,R0 ; *,STATUS
BNE 14$
ADD #12,SP
BR 22$
14$: JSR PC,U.19 ; 2989
MOV #131,(SP) ; 2990
MOV #11,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
MOV U.70,U.71 ; 2991
MOV U.77,U.76 ; 2992
CLR U.77 ; 2993
MOV U.78,R0 ; 2994
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #16,SP ; 2979
MOV #7,R0 ; 2983
BR 22$
15$: CMP R1,#130 ; 2979
BNE 16$
MOV #1,U.86 ; 3004
MOV #U.30,U.92 ; 3005
JSR PC,U.27 ; 3006
JSR PC,TT.CRLF ; 3007
JSR PC,TT.OUTPUT ; 3008
MOV #131,(SP) ; 3009
CLR -(SP)
MOV U.78,-(SP)
JSR PC,U.23
MOV U.77,U.76 ; 3010
CLR U.77 ; 3011
MOV U.78,R0 ; 3012
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #16,SP ; 2979
MOV #10,R0 ; 3003
BR 22$
16$: CMP R1,#131 ; 2979
BNE 19$
MOV #U.30,U.92 ; 3022
JSR PC,U.27 ; 3023
TST U.80 ; 3025
BLE 17$
JSR PC,TT.CRLF
17$: ADD #12,SP ; 2979
MOV #11,R0 ; 3021
18$: BR 22$
19$: CMP R1,#116 ; 2979
BNE 20$
ADD #12,SP ; 3035
MOV U.74,R0
BR 22$
20$: ADD #12,SP ; 2827
21$: MOV #12,R0 ; 2876
22$: ADD #142,SP ; 2827
MOV (SP)+,R1
RTS PC
; Routine Size: 275 words, Routine Base: $CODE$ + 5644
; Maximum stack depth per invocation: 61 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3044 %SBTTL 'SEND_BREAK'
; 3045 ROUTINE SEND_BREAK =
; 3046
; 3047 !++
; 3048 ! FUNCTIONAL DESCRIPTION:
; 3049 !
; 3050 ! This routine will send the break (end of transmission) message
; 3051 ! to the remote KERMIT. On an ACK the state becomes STATE_C.
; 3052 !
; 3053 ! CALLING SEQUENCE:
; 3054 !
; 3055 ! STATE = SEND_BREAK();
; 3056 !
; 3057 ! INPUT PARAMETERS:
; 3058 !
; 3059 ! None.
; 3060 !
; 3061 ! IMPLICIT INPUTS:
; 3062 !
; 3063 ! None.
; 3064 !
; 3065 ! OUTPUT PARAMETERS:
; 3066 !
; 3067 ! New state for the finite state machine.
; 3068 !
; 3069 ! IMPLICIT OUTPUTS:
; 3070 !
; 3071 ! None.
; 3072 !
; 3073 ! COMPLETION CODES:
; 3074 !
; 3075 ! None.
; 3076 !
; 3077 ! SIDE EFFECTS:
; 3078 !
; 3079 ! None.
; 3080 !
; 3081 !--
; 3082
; 3083 BEGIN
; 3084
; 3085 LOCAL
; 3086 STATUS; ! Status returned by various routines
; 3087
; 3088 !
; 3089 ! First determine if we have exceed the number of retries that are
; 3090 ! allowed to attempt to send this message.
; 3091 !
; 3092
; 3093 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 3094
; 3095 !
; 3096 ! The number of retries are not exceeded. Increment the number and then
; 3097 ! attempt to send the packet again.
; 3098 !
; 3099 NUM_RETRIES = .NUM_RETRIES + 1;
; 3100
; 3101 IF NOT SEND_PACKET (MSG_BREAK, 0, .MSG_NUMBER) THEN RETURN STATE_EX;
; 3102
; 3103 !
; 3104 ! Now get the responce from the remote KERMIT.
; 3105 !
; 3106 STATUS = REC_PACKET ();
; 3107
; 3108 IF NOT .STATUS
; 3109 THEN
; 3110 BEGIN
; 3111
; 3112 IF (.STATUS EQL KER_ZEROLENMSG) OR (.STATUS EQL KER_TIMEOUT) OR (.STATUS EQL KER_CHKSUMERR)
; 3113 THEN
; 3114 RETURN .STATE
; 3115 ELSE
; 3116 RETURN STATE_EX;
; 3117
; 3118 END;
; 3119
; 3120 !
; 3121 ! Determine if the packet is good.
; 3122 !
; 3123
; 3124 IF NOT (.REC_TYPE EQL MSG_ACK OR .REC_TYPE EQL MSG_NAK) THEN RETURN STATE_A;
; 3125
; 3126 !
; 3127 ! If this is a NAK and the message number is not the one we just send
; 3128 ! treat this like an ACK, otherwise resend the last packet.
; 3129 !
; 3130
; 3131 IF .REC_TYPE EQL MSG_NAK AND .REC_SEQ NEQ 0 THEN RETURN .STATE;
; 3132
; 3133 IF .REC_TYPE EQL MSG_ACK AND .REC_SEQ NEQ .MSG_NUMBER THEN RETURN .STATE;
; 3134
; 3135 !
; 3136 ! Here to determine if there is another file to send.
; 3137 !
; 3138 NUM_RETRIES = 0;
; 3139 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3140 RETURN STATE_C;
; 3141 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.BREAK SEND_BREAK
.NLIST
.ENABL LSB
.LIST
; SEND.BREAK
U.9: MOV R1,-(SP) ; 3045
CMP U.77,PKT.RETRIES ; 3093
BGT 4$
INC U.77 ; 3099
MOV #102,-(SP) ; 3101
CLR -(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
ROR R0
BHIS 1$
JSR PC,U.25 ; 3106
BIT #1,R0 ; *,STATUS 3108
BNE 2$
CMP R0,#312 ; STATUS,* 3112
BEQ 8$
CMP R0,#264 ; STATUS,*
BEQ 8$
CMP R0,#162 ; STATUS,*
BEQ 8$ ; 3110
1$: MOV #23,R0
BR 10$
2$: MOV U.81,R0 ; 3124
CLR R1
CMP R0,#131
BNE 3$
INC R1
BR 5$
3$: CMP R0,#116
BEQ 6$
4$: MOV #12,R0
BR 10$
5$: CMP R0,#116 ; 3131
BNE 7$
6$: TST U.79
BNE 8$
7$: ROR R1 ; 3133
BCC 9$
CMP U.79,U.78
BEQ 9$
8$: MOV U.74,R0
BR 10$
9$: CLR U.77 ; 3138
MOV U.78,R0 ; 3139
INC R0
MOV R0,U.78
BIC #177700,U.78
MOV #11,R0 ; 3083
10$: MOV (SP)+,R1 ; 3045
RTS PC
; Routine Size: 78 words, Routine Base: $CODE$ + 6712
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3142 %SBTTL 'REC_INIT'
; 3143 ROUTINE REC_INIT =
; 3144
; 3145 !++
; 3146 ! FUNCTIONAL DESCRIPTION:
; 3147 !
; 3148 ! This routine will process an initialization message received from
; 3149 ! the remote KERMIT.
; 3150 !
; 3151 ! CALLING SEQUENCE:
; 3152 !
; 3153 ! STATE = REC_INIT();
; 3154 !
; 3155 ! INPUT PARAMETERS:
; 3156 !
; 3157 ! None.
; 3158 !
; 3159 ! IMPLICIT INPUTS:
; 3160 !
; 3161 ! None.
; 3162 !
; 3163 ! OUTPUT PARAMETERS:
; 3164 !
; 3165 ! New machine state.
; 3166 !
; 3167 ! IMPLICIT OUTPUTS:
; 3168 !
; 3169 ! None.
; 3170 !
; 3171 ! COMPLETION CODES:
; 3172 !
; 3173 ! None.
; 3174 !
; 3175 ! SIDE EFFECTS:
; 3176 !
; 3177 ! None.
; 3178 !
; 3179 !--
; 3180
; 3181 BEGIN
; 3182
; 3183 LOCAL
; 3184 STATUS; ! Status returned by various routines
; 3185
; 3186 ROUTINE CHECK_INIT =
; 3187 BEGIN
; 3188
; 3189 IF .REC_TYPE EQL MSG_SND_INIT THEN RETURN TRUE ELSE RETURN FALSE;
; 3190
; 3191 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL CHECK.INIT REC_INIT
.NLIST
.ENABL LSB
.LIST
; CHECK.INIT
U.101: CMP U.81,#123 ; 3189
BNE 1$
MOV #1,R0 ; 3187
RTS PC
1$: CLR R0
RTS PC ; 3186
; Routine Size: 9 words, Routine Base: $CODE$ + 7146
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3192
; 3193 IF NOT (STATUS = REC_MESSAGE (CHECK_INIT))
; 3194 THEN
; 3195
; 3196 IF .STATUS NEQ KER_ABORTED THEN RETURN STATE_A ELSE RETURN STATE_EX;
; 3197
; 3198 MSG_NUMBER = .REC_SEQ;
; 3199
; 3200 IF NOT (STATUS = PRS_SEND_INIT ()) THEN RETURN STATE_A;
; 3201
; 3202 SET_SEND_INIT ();
; 3203 SEND_PACKET (MSG_ACK, P_SI_LENGTH, .MSG_NUMBER);
; 3204 BLK_CHK_TYPE = .INI_CHK_TYPE; ! Can now use agreed upon type
; 3205 OLD_RETRIES = .NUM_RETRIES;
; 3206 NUM_RETRIES = 0;
; 3207 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3208 RETURN STATE_RF;
; 3209 END; ! End of REC_INIT
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL REC.INIT REC_INIT
.NLIST
.ENABL LSB
.LIST
; REC.INIT
U.11: MOV R1,-(SP) ; 3143
MOV #U.101,-(SP) ; 3193
JSR PC,U.24
TST (SP)+
BIT #1,R0 ; *,STATUS
BNE 3$
CMP R0,#272 ; STATUS,* 3196
BEQ 1$
MOV #12,R1 ; 3193
BR 2$
1$: MOV #23,R1
2$: MOV R1,R0 ; 3196
BR 5$
3$: MOV U.79,U.78 ; 3198
JSR PC,U.20 ; 3200
ROR R0 ; STATUS
BLO 4$
MOV #12,R0
BR 5$
4$: JSR PC,U.19 ; 3202
MOV #131,-(SP) ; 3203
MOV #11,-(SP)
MOV U.78,-(SP)
JSR PC,U.23
MOV U.70,U.71 ; 3204
MOV U.77,U.76 ; 3205
CLR U.77 ; 3206
MOV U.78,R0 ; 3207
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #6,SP ; 3143
MOV #7,R0 ; 3181
5$: MOV (SP)+,R1 ; 3143
RTS PC
; Routine Size: 61 words, Routine Base: $CODE$ + 7170
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3210 %SBTTL 'REC_FILE'
; 3211 ROUTINE REC_FILE =
; 3212
; 3213 !++
; 3214 ! FUNCTIONAL DESCRIPTION:
; 3215 !
; 3216 ! This routine expects to receive an MSG_FILE packet from the remote
; 3217 ! KERMIT. If the message is correct this routine will change the state
; 3218 ! to STATE_RD.
; 3219 !
; 3220 ! This routine also expects MSG_SND_INIT, MSG_EOF, or MSG_BREAK.
; 3221 !
; 3222 ! CALLING SEQUENCE:
; 3223 !
; 3224 ! STATE = REC_FILE();
; 3225 !
; 3226 ! INPUT PARAMETERS:
; 3227 !
; 3228 ! None.
; 3229 !
; 3230 ! IMPLICIT INPUTS:
; 3231 !
; 3232 ! None.
; 3233 !
; 3234 ! OUTPUT PARAMETERS:
; 3235 !
; 3236 ! New state.
; 3237 !
; 3238 ! IMPLICIT OUTPUTS:
; 3239 !
; 3240 ! None.
; 3241 !
; 3242 ! COMPLETION CODES:
; 3243 !
; 3244 ! None.
; 3245 !
; 3246 ! SIDE EFFECTS:
; 3247 !
; 3248 ! None.
; 3249 !
; 3250 !--
; 3251
; 3252 BEGIN
; 3253
; 3254 LOCAL
; 3255 STATUS;
; 3256
; 3257 ROUTINE CHECK_FILE =
; 3258 BEGIN
; 3259
; 3260 IF (.REC_TYPE EQL MSG_SND_INIT) OR (.REC_TYPE EQL MSG_EOF) OR (.REC_TYPE EQL MSG_FILE) OR (
; 3261 .REC_TYPE EQL MSG_BREAK) OR (.REC_TYPE EQL MSG_TEXT)
; 3262 THEN
; 3263 RETURN TRUE
; 3264 ELSE
; 3265 RETURN FALSE;
; 3266
; 3267 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL CHECK.FILE REC_FILE
.NLIST
.ENABL LSB
.LIST
; CHECK.FILE
U.102: MOV U.81,R0 ; 3260
CMP R0,#123
BEQ 1$
CMP R0,#132
BEQ 1$
CMP R0,#106
BEQ 1$
CMP R0,#102
BEQ 1$
CMP R0,#130 ; 3261
BNE 2$
1$: MOV #1,R0 ; 3258
RTS PC
2$: CLR R0
RTS PC ; 3257
; Routine Size: 22 words, Routine Base: $CODE$ + 7362
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3268 !
; 3269 ! Initialize the abort flags
; 3270 !
; 3271 ABT_CUR_FILE = FALSE;
; 3272 ABT_ALL_FILE = FALSE;
; 3273 !
; 3274 ! Get a message
; 3275 !
; 3276
; 3277 IF NOT (STATUS = REC_MESSAGE (CHECK_FILE))
; 3278 THEN
; 3279
; 3280 IF .STATUS NEQ KER_ABORTED THEN RETURN STATE_A ELSE RETURN STATE_EX;
; 3281
; 3282 SELECTONE .REC_TYPE OF
; 3283 SET
; 3284
; 3285 [MSG_SND_INIT] :
; 3286 BEGIN
; 3287
; 3288 IF .OLD_RETRIES GTR .SI_RETRIES THEN RETURN STATE_A;
; 3289
; 3290 OLD_RETRIES = .OLD_RETRIES + 1;
; 3291
; 3292 IF ((.MSG_NUMBER - 1) AND %O'77') EQL .REC_SEQ
; 3293 THEN
; 3294 BEGIN
; 3295 SET_SEND_INIT ();
; 3296 BLK_CHK_TYPE = CHK_1CHAR; ! Must use 1 character CHKSUM
; 3297 SEND_PACKET (MSG_ACK, P_SI_LENGTH, .REC_SEQ);
; 3298 BLK_CHK_TYPE = .INI_CHK_TYPE; ! Back to agreed upon type
; 3299 NUM_RETRIES = 0;
; 3300 RETURN .STATE;
; 3301 END
; 3302 ELSE
; 3303 RETURN STATE_A;
; 3304
; 3305 END;
; 3306
; 3307 [MSG_EOF] :
; 3308 BEGIN
; 3309
; 3310 IF .OLD_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 3311
; 3312 OLD_RETRIES = .OLD_RETRIES + 1;
; 3313
; 3314 IF ((.MSG_NUMBER - 1) AND %O'77') EQL .REC_SEQ
; 3315 THEN
; 3316 BEGIN
; 3317 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3318 NUM_RETRIES = 0;
; 3319 RETURN .STATE;
; 3320 END
; 3321 ELSE
; 3322 RETURN STATE_A;
; 3323
; 3324 END;
; 3325
; 3326 [MSG_FILE] :
; 3327 BEGIN
; 3328
; 3329 IF .MSG_NUMBER NEQ .REC_SEQ THEN RETURN STATE_A;
; 3330
; 3331 IF .REC_LENGTH EQL 0
; 3332 THEN
; 3333 BEGIN
; 3334 KRM_ERROR (KER_PROTOERR);
; 3335 RETURN STATE_A;
; 3336 END;
; 3337
; 3338 ![025]
; 3339 ![025] Get file name from packet with all quoting undone
; 3340 ![025]
; 3341 SET_STRING (CH$PTR (FILE_NAME), MAX_FILE_NAME, TRUE);
; 3342 BFR_EMPTY ();
; 3343 FILE_SIZE = SET_STRING (0, 0, FALSE);
; 3344 CH$WCHAR (CHR_NUL, CH$PTR (FILE_NAME, .FILE_SIZE));
; 3345 ![025] FILE_SIZE = .REC_LENGTH;
; 3346 ![025] CH$COPY (.REC_LENGTH, CH$PTR (REC_MSG, PKT_MSG, CHR_SIZE), CHR_NUL, MAX_FILE_NAME,
; 3347 ![025] CH$PTR (FILE_NAME));
; 3348
; 3349 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 3350 THEN
; 3351 BEGIN
; 3352 TT_TEXT (UPLIT (%ASCIZ'Receiving: '));
; 3353 TT_TEXT (FILE_NAME);
; 3354 TT_OUTPUT ();
; 3355 END;
; 3356
; 3357 ![023]
; 3358 ![023] Force file name into normal form if desired
; 3359 ![023]
; 3360
; 3361 IF .FIL_NORMAL_FORM THEN NORMALIZE_FILE (FILE_NAME, FILE_SIZE, 9, 3);
; 3362
; 3363 FILE_CHARS = 0; ! No characters received yet
; 3364
; 3365 IF NOT FILE_OPEN (FNC_WRITE) THEN RETURN STATE_A;
; 3366
; 3367 XFR_STATUS (%C'F', %C'R'); ! Tell display routine
; 3368 TEXT_HEAD_FLAG = FALSE; ! Got an F, not an X
; 3369 FILE_OPEN_FLAG = TRUE;
; 3370 SEND_PACKET (MSG_ACK, 0, .MSG_NUMBER);
; 3371 OLD_RETRIES = .NUM_RETRIES;
; 3372 NUM_RETRIES = 0;
; 3373 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3374 RETURN STATE_RD;
; 3375 END;
; 3376
; 3377 [MSG_TEXT] :
; 3378 !
; 3379 ! If we get a text header, we will want to type the data on
; 3380 ! the terminal. Set up the put a character routine correctly.
; 3381 !
; 3382 BEGIN
; 3383
; 3384 IF .MSG_NUMBER NEQ .REC_SEQ THEN RETURN STATE_A;
; 3385
; 3386 TEXT_HEAD_FLAG = TRUE; ! Got an X, not an F
; 3387 PUT_CHR_ROUTINE = TYPE_CHAR; ! Empty buffer on terminal
; 3388 BFR_EMPTY (); ! Do the header data
; 3389 TT_CRLF (); ! And a crlf
; 3390 SEND_PACKET (MSG_ACK, 0, .MSG_NUMBER);
; 3391 OLD_RETRIES = .NUM_RETRIES;
; 3392 NUM_RETRIES = 0;
; 3393 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3394 RETURN STATE_RD;
; 3395 END;
; 3396
; 3397 [MSG_BREAK] :
; 3398 BEGIN
; 3399
; 3400 IF .MSG_NUMBER NEQ .REC_SEQ THEN RETURN STATE_A;
; 3401
; 3402 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3403 RETURN STATE_C;
; 3404 END;
; 3405
; 3406 [OTHERWISE] :
; 3407 RETURN STATE_A;
; 3408 TES;
; 3409
; 3410 END; ! End of REC_FILE
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAI: .ASCII /Rec/
.ASCII /eiv/
.ASCII /ing/
.ASCII /: /<00>
.SBTTL REC.FILE REC_FILE
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; REC.FILE
U.12: JSR R1,$SAVE2 ; 3211
CLR ABT.CUR.FILE ; 3271
CLR ABT.ALL.FILE ; 3272
MOV #U.102,-(SP) ; 3277
JSR PC,U.24
TST (SP)+
BIT #1,R0 ; *,STATUS
BNE 1$
CMP R0,#272 ; STATUS,* 3280
BNE 5$ ; 3277
MOV #23,R0
RTS PC ; 3280
1$: MOV U.81,R0 ; 3282
CMP R0,#123
BNE 2$
CMP U.76,SI.RETRIES ; 3288
BGT 5$
INC U.76 ; 3290
MOV U.78,R0 ; 3292
DEC R0
MOV U.79,R2
MOV R0,R1
BIC #177700,R1
CMP R1,R2
BNE 5$
JSR PC,U.19 ; 3295
MOV #61,U.71 ; 3296
MOV #131,-(SP) ; 3297
MOV #11,-(SP)
MOV U.79,-(SP)
JSR PC,U.23
MOV U.70,U.71 ; 3298
BR 3$ ; 3299
2$: CMP R0,#132 ; 3282
BNE 4$
CMP U.76,PKT.RETRIES ; 3310
BGT 9$
INC U.76 ; 3312
MOV U.78,R0 ; 3314
DEC R0
MOV U.79,R2
MOV R0,R1
BIC #177700,R1
CMP R1,R2
BNE 9$
MOV #131,-(SP) ; 3317
CLR -(SP)
MOV R2,-(SP) ; REC.SEQ,*
JSR PC,U.23
3$: CLR U.77 ; 3318
ADD #6,SP ; 3316
MOV U.74,R0 ; 3308
RTS PC
4$: CMP R0,#106 ; 3282
BNE 11$
CMP U.78,U.79 ; 3329
BNE 12$
TST U.80 ; 3331
BNE 6$
MOV #242,-(SP) ; 3334
JSR PC,KRM.ERROR
TST (SP)+ ; 3331
5$: BR 9$ ; 3333
6$: MOV #FILE.NAME,-(SP) ; 3341
MOV #204,-(SP)
MOV #1,-(SP)
JSR PC,U.29
JSR PC,U.27 ; 3342
CLR (SP) ; 3343
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV R0,FILE.SIZE
CLRB FILE.NAME(R0) ; 3344
BIT #1,CONNECT.FLAG ; 3349
BNE 7$
BIT #1,TY.FIL
BEQ 7$
MOV #P.AAI,(SP) ; 3352
JSR PC,TT.TEXT
MOV #FILE.NAME,(SP) ; 3353
JSR PC,TT.TEXT
JSR PC,TT.OUTPUT ; 3354
7$: BIT #1,FIL.NORMAL.FORM ; 3361
BEQ 8$
MOV #FILE.NAME,(SP)
MOV #FILE.SIZE,-(SP)
MOV #11,-(SP)
MOV #3,-(SP)
JSR PC,U.26
ADD #6,SP
8$: CLR U.85 ; 3363
MOV #1,(SP) ; 3365
JSR PC,FILE.OPEN
ROR R0
BLO 10$
ADD #12,SP
9$: BR 15$
10$: MOV #106,(SP) ; 3367
MOV #122,-(SP)
JSR PC,XFR.STATUS
CLR U.86 ; 3368
MOV #1,U.84 ; 3369
MOV #131,(SP) ; 3370
CLR -(SP)
MOV U.78,-(SP)
JSR PC,U.23
MOV U.77,U.76 ; 3371
CLR U.77 ; 3372
MOV U.78,R0 ; 3373
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #20,SP ; 3327
BR 13$ ; 3282
11$: CMP R0,#130
BNE 14$
CMP U.78,U.79 ; 3384
12$: BNE 15$
MOV #1,U.86 ; 3386
MOV #U.30,U.92 ; 3387
JSR PC,U.27 ; 3388
JSR PC,TT.CRLF ; 3389
MOV #131,-(SP) ; 3390
CLR -(SP)
MOV U.78,-(SP)
JSR PC,U.23
MOV U.77,U.76 ; 3391
CLR U.77 ; 3392
MOV U.78,R0 ; 3393
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #6,SP ; 3382
13$: MOV #10,R0 ; 3282
RTS PC
14$: CMP R0,#102
BNE 15$
CMP U.78,U.79 ; 3400
BNE 15$
MOV #131,-(SP) ; 3402
CLR -(SP)
MOV U.79,-(SP)
JSR PC,U.23
ADD #6,SP ; 3398
MOV #11,R0 ; 3282
RTS PC
15$: MOV #12,R0
RTS PC ; 3211
; Routine Size: 268 words, Routine Base: $CODE$ + 7436
; Maximum stack depth per invocation: 12 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3411 %SBTTL 'REC_DATA'
; 3412 ROUTINE REC_DATA =
; 3413
; 3414 !++
; 3415 ! FUNCTIONAL DESCRIPTION:
; 3416 !
; 3417 ! This routine will accept data messages and write them to disk.
; 3418 ! It will also accept MSG_FILE, MSG_TEXT and MSG_EOF messages.
; 3419 !
; 3420 ! CALLING SEQUENCE:
; 3421 !
; 3422 ! STATE = REC_DATA();
; 3423 !
; 3424 ! INPUT PARAMETERS:
; 3425 !
; 3426 ! None.
; 3427 !
; 3428 ! IMPLICIT INPUTS:
; 3429 !
; 3430 ! None.
; 3431 !
; 3432 ! OUTPUT PARAMETERS:
; 3433 !
; 3434 ! New state for the finite state machine.
; 3435 !
; 3436 ! IMPLICIT OUTPUTS:
; 3437 !
; 3438 ! None.
; 3439 !
; 3440 ! COMPLETION CODES:
; 3441 !
; 3442 ! None.
; 3443 !
; 3444 ! SIDE EFFECTS:
; 3445 !
; 3446 ! None.
; 3447 !
; 3448 !--
; 3449
; 3450 BEGIN
; 3451
; 3452 LOCAL
; 3453 STATUS;
; 3454
; 3455 ROUTINE CHECK_DATA =
; 3456 BEGIN
; 3457
; 3458 IF .REC_TYPE EQL MSG_DATA OR (.REC_TYPE EQL MSG_FILE AND NOT .TEXT_HEAD_FLAG) OR .REC_TYPE
; 3459 EQL MSG_EOF OR (.REC_TYPE EQL MSG_TEXT AND .TEXT_HEAD_FLAG)
; 3460 THEN
; 3461 RETURN TRUE
; 3462 ELSE
; 3463 RETURN FALSE;
; 3464
; 3465 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL CHECK.DATA REC_DATA
.NLIST
.ENABL LSB
.LIST
; CHECK.DATA
U.103: MOV U.81,R0 ; 3458
CMP R0,#104
BEQ 2$
CMP R0,#106
BNE 1$
BIT #1,U.86
BEQ 2$
1$: CMP R0,#132 ; 3459
BEQ 2$
CMP R0,#130
BNE 3$
BIT #1,U.86
BEQ 3$
2$: MOV #1,R0 ; 3456
RTS PC
3$: CLR R0
RTS PC ; 3455
; Routine Size: 27 words, Routine Base: $CODE$ + 10466
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3466
; 3467 LOCAL
; 3468 SUB_TYPE, ! Subtype for XFR_STATUS
; 3469 DISCARD_FILE_FLAG, ! Sender requested discard
; 3470 ACK_MSG_LEN; ! Length of ACK to send
; 3471
; 3472 !
; 3473 ! First get a message
; 3474 !
; 3475
; 3476 IF NOT (STATUS = REC_MESSAGE (CHECK_DATA))
; 3477 THEN
; 3478
; 3479 IF .STATUS NEQ KER_ABORTED THEN RETURN STATE_A ELSE RETURN STATE_EX;
; 3480
; 3481 SELECTONE .REC_TYPE OF
; 3482 SET
; 3483
; 3484 [MSG_DATA] :
; 3485 BEGIN
; 3486
; 3487 IF .MSG_NUMBER NEQ .REC_SEQ
; 3488 THEN
; 3489 BEGIN
; 3490
; 3491 IF .OLD_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 3492
; 3493 OLD_RETRIES = .OLD_RETRIES + 1;
; 3494
; 3495 IF ((.MSG_NUMBER - 1) AND %O'77') EQL .REC_SEQ
; 3496 THEN
; 3497 BEGIN
; 3498 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3499 NUM_RETRIES = 0;
; 3500 RETURN .STATE;
; 3501 END
; 3502 ELSE
; 3503 RETURN STATE_A;
; 3504
; 3505 END;
; 3506
; 3507 !
; 3508 ! Here if we have a message with a valid message number
; 3509 !
; 3510
; 3511 IF NOT BFR_EMPTY () THEN RETURN STATE_A;
; 3512
; 3513 !
; 3514 ! Check if we wish to abort for some reason
; 3515 !
; 3516
; 3517 IF .ABT_CUR_FILE
; 3518 THEN
; 3519 BEGIN
; 3520 CH$WCHAR (MSG_ACK_ABT_CUR, CH$PTR (SND_MSG, PKT_MSG, CHR_SIZE));
; 3521 ACK_MSG_LEN = 1;
; 3522 END
; 3523 ELSE
; 3524
; 3525 IF .ABT_ALL_FILE
; 3526 THEN
; 3527 BEGIN
; 3528 CH$WCHAR (MSG_ACK_ABT_ALL, CH$PTR (SND_MSG, PKT_MSG, CHR_SIZE));
; 3529 ACK_MSG_LEN = 1;
; 3530 END
; 3531 ELSE
; 3532 ACK_MSG_LEN = 0;
; 3533
; 3534 !
; 3535 ! Now send the ACK
; 3536 !
; 3537 SEND_PACKET (MSG_ACK, .ACK_MSG_LEN, .REC_SEQ);
; 3538 OLD_RETRIES = .NUM_RETRIES;
; 3539 NUM_RETRIES = 0;
; 3540 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3541 RETURN STATE_RD;
; 3542 END;
; 3543
; 3544 [MSG_FILE, MSG_TEXT] :
; 3545 BEGIN
; 3546
; 3547 IF .OLD_RETRIES GTR .PKT_RETRIES THEN RETURN STATE_A;
; 3548
; 3549 OLD_RETRIES = .OLD_RETRIES + 1;
; 3550
; 3551 IF ((.MSG_NUMBER - 1) AND %O'77') EQL .REC_SEQ
; 3552 THEN
; 3553 BEGIN
; 3554 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3555 NUM_RETRIES = 0;
; 3556 RETURN .STATE;
; 3557 END
; 3558 ELSE
; 3559 RETURN STATE_A;
; 3560
; 3561 END;
; 3562
; 3563 [MSG_EOF] :
; 3564 BEGIN
; 3565
; 3566 IF .MSG_NUMBER NEQ .REC_SEQ THEN RETURN STATE_A;
; 3567
; 3568 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3569
; 3570 IF NOT .TEXT_HEAD_FLAG
; 3571 THEN
; 3572 BEGIN
; 3573 FILE_OPEN_FLAG = FALSE;
; 3574 DISCARD_FILE_FLAG = FALSE; ! Assume we want file
; 3575
; 3576 IF .REC_LENGTH EQL 1
; 3577 THEN
; 3578
; 3579 IF CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG, CHR_SIZE)) EQL MSG_EOF_DISCARD
; 3580 THEN
; 3581 DISCARD_FILE_FLAG = TRUE;
; 3582
; 3583 IF ( NOT .CONNECT_FLAG) AND .TY_FIL
; 3584 THEN
; 3585 BEGIN
; 3586
; 3587 IF .DISCARD_FILE_FLAG
; 3588 THEN
; 3589
; 3590 IF .ABT_FLAG
; 3591 THEN
; 3592 TT_TEXT (UPLIT (%ASCIZ' [Interrupted]'))
; 3593 ELSE
; 3594 TT_TEXT (UPLIT (%ASCIZ' [Interrupted, partial file saved]'))
; 3595
; 3596 ELSE
; 3597 TT_TEXT (UPLIT (%ASCIZ' [OK]'));
; 3598
; 3599 TT_CRLF ();
; 3600 END;
; 3601
; 3602 IF NOT FILE_CLOSE (.DISCARD_FILE_FLAG AND .ABT_FLAG) THEN RETURN STATE_A;
; 3603
; 3604 IF .DISCARD_FILE_FLAG
; 3605 THEN
; 3606
; 3607 IF .ABT_FLAG THEN SUB_TYPE = %C'X' ELSE SUB_TYPE = %C'D'
; 3608
; 3609 ELSE
; 3610 SUB_TYPE = %C'C';
; 3611
; 3612 END
; 3613 ELSE
; 3614 BEGIN
; 3615 TT_CRLF (); ! Make sure we have a CRLF
; 3616 TT_OUTPUT (); ! And make sure all output is sent
; 3617 END;
; 3618
; 3619 XFR_STATUS (%C'F', .SUB_TYPE);
; 3620 MSG_NUMBER = (.MSG_NUMBER + 1) AND %O'77';
; 3621 RETURN STATE_RF;
; 3622 END;
; 3623
; 3624 [OTHERWISE] :
; 3625 RETURN STATE_A;
; 3626 TES;
; 3627
; 3628 END; ! End of REC_DATA
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAJ: .ASCII / [I/
.ASCII /nte/
.ASCII /rru/
.ASCII /pte/
.ASCII /d]/<00>
.ASCII <00>
P.AAK: .ASCII / [I/
.ASCII /nte/
.ASCII /rru/
.ASCII /pte/
.ASCII /d, /
.ASCII /par/
.ASCII /tia/
.ASCII /l f/
.ASCII /ile/
.ASCII / sa/
.ASCII /ved/
.ASCII /]/<00><00>
P.AAL: .ASCII / [O/
.ASCII /K]/<00>
.SBTTL REC.DATA REC_DATA
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; REC.DATA
U.13: JSR R1,$SAVE3 ; 3412
MOV #U.103,-(SP) ; 3476
JSR PC,U.24
TST (SP)+
BIT #1,R0 ; *,STATUS
BNE 1$
CMP R0,#272 ; STATUS,* 3479
BNE 3$ ; 3476
MOV #23,R0
RTS PC ; 3479
1$: MOV U.81,R0 ; 3481
CMP R0,#104
BNE 9$
MOV U.79,R1 ; 3487
CMP U.78,R1
BEQ 2$
CMP U.76,PKT.RETRIES ; 3491
BGT 3$
INC U.76 ; 3493
MOV U.78,R0 ; 3495
DEC R0
MOV R1,R3
MOV R0,R2
BIC #177700,R2
CMP R2,R3
BNE 3$
MOV #131,-(SP) ; 3498
CLR -(SP)
MOV R1,-(SP)
BR 11$
2$: JSR PC,U.27 ; 3511
ROR R0
BLO 4$
3$: JMP 23$
4$: BIT #1,ABT.CUR.FILE ; 3517
BEQ 5$
MOVB #130,U.83+4 ; 3520
BR 6$ ; 3521
5$: BIT #1,ABT.ALL.FILE ; 3525
BEQ 7$
MOVB #132,U.83+4 ; 3528
6$: MOV #1,R0 ; *,ACK.MSG.LEN 3529
BR 8$ ; 3525
7$: CLR R0 ; ACK.MSG.LEN 3532
8$: MOV #131,-(SP) ; 3537
MOV R0,-(SP) ; ACK.MSG.LEN,*
MOV U.79,-(SP)
JSR PC,U.23
MOV U.77,U.76 ; 3538
CLR U.77 ; 3539
MOV U.78,R0 ; 3540
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #6,SP ; 3485
MOV #10,R0 ; 3481
RTS PC
9$: CMP R0,#106
BEQ 10$
CMP R0,#130
BNE 12$
10$: CMP U.76,PKT.RETRIES ; 3547
BGT 3$
INC U.76 ; 3549
MOV U.78,R0 ; 3551
DEC R0
MOV U.79,R2
MOV R0,R1
BIC #177700,R1
CMP R1,R2
BNE 23$
MOV #131,-(SP) ; 3554
CLR -(SP)
MOV R2,-(SP) ; REC.SEQ,*
11$: JSR PC,U.23
CLR U.77 ; 3555
ADD #6,SP ; 3553
MOV U.74,R0 ; 3545
RTS PC
12$: CMP R0,#132 ; 3481
BNE 23$
CMP U.78,U.79 ; 3566
BNE 23$
MOV #131,-(SP) ; 3568
CLR -(SP)
MOV U.79,-(SP)
JSR PC,U.23
BIT #1,U.86 ; 3570
BNE 21$
CLR U.84 ; 3573
CLR R1 ; DISCARD.FILE.FL 3574
CMP U.80,#1 ; 3576
BNE 13$
CMPB U.82+4,#104 ; 3579
BNE 13$
MOV #1,R1 ; *,DISCARD.FILE.FL 3581
13$: BIT #1,CONNECT.FLAG ; 3583
BNE 17$
BIT #1,TY.FIL
BEQ 17$
BIT #1,R1 ; *,DISCARD.FILE.FL 3587
BEQ 15$
BIT #1,ABT.FLAG ; 3590
BEQ 14$
MOV #P.AAJ,(SP) ; 3592
BR 16$
14$: MOV #P.AAK,(SP) ; 3594
BR 16$
15$: MOV #P.AAL,(SP) ; 3597
16$: JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 3599
17$: MOV R1,R0 ; DISCARD.FILE.FL,* 3602
MOV ABT.FLAG,(SP)
COM R0
BIC R0,(SP)
JSR PC,FILE.CLOSE
ROR R0
BLO 18$
ADD #6,SP
BR 23$
18$: ROR R1 ; DISCARD.FILE.FL 3604
BCC 20$
BIT #1,ABT.FLAG ; 3607
BEQ 19$
MOV #130,R0 ; *,SUB.TYPE
BR 22$
19$: MOV #104,R0 ; *,SUB.TYPE
BR 22$ ; 3604
20$: MOV #103,R0 ; *,SUB.TYPE 3610
BR 22$ ; 3570
21$: JSR PC,TT.CRLF ; 3615
JSR PC,TT.OUTPUT ; 3616
22$: MOV #106,(SP) ; 3619
MOV R0,-(SP) ; SUB.TYPE,*
JSR PC,XFR.STATUS
MOV U.78,R0 ; 3620
INC R0
MOV R0,U.78
BIC #177700,U.78
ADD #10,SP ; 3564
MOV #7,R0 ; 3481
RTS PC
23$: MOV #12,R0
RTS PC ; 3412
; Routine Size: 241 words, Routine Base: $CODE$ + 10554
; Maximum stack depth per invocation: 9 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3629 %SBTTL 'SERVER - Generic commands'
; 3630 ROUTINE SERVER_GENERIC =
; 3631
; 3632 !++
; 3633 ! FUNCTIONAL DESCRIPTION:
; 3634 !
; 3635 ! This routine will handle the generic server messages.
; 3636 ! The generic server messages include FINISH, LOGOUT.
; 3637 !
; 3638 ! CALLING SEQUENCE:
; 3639 !
; 3640 ! STATE = SERVER_GENERIC();
; 3641 !
; 3642 ! INPUT PARAMETERS:
; 3643 !
; 3644 ! None.
; 3645 !
; 3646 ! IMPLICIT INPUTS:
; 3647 !
; 3648 ! Generic message receive in REC_MSG.
; 3649 !
; 3650 ! OUTPUT PARAMETERS:
; 3651 !
; 3652 ! Returns new state for FSM
; 3653 !
; 3654 ! IMPLICIT OUTPUTS:
; 3655 !
; 3656 ! None.
; 3657 !
; 3658 ! COMPLETION CODES:
; 3659 !
; 3660 ! None.
; 3661 !
; 3662 ! SIDE EFFECTS:
; 3663 !
; 3664 ! None.
; 3665 !
; 3666 !--
; 3667
; 3668 BEGIN
; 3669
; 3670 LOCAL
; 3671 STATUS, ! Returned status
; 3672 G_FUNC, ! Generic command function
; 3673 POINTER, ! Character pointer
; 3674 DATA_TEXT : VECTOR [CH$ALLOCATION (MAX_MSG)], ! Unpacked message
; 3675 DATA_SIZE; ! Actual size of data
; 3676
; 3677 ROUTINE UNPACK_DATA (POINTER, SIZE, DST_ADDR, DST_LEN) =
; 3678 !
; 3679 ! Routine to unpack an argument.
; 3680 ! This will copy the argument data to the desired buffer.
; 3681 !
; 3682 BEGIN
; 3683
; 3684 IF .SIZE GTR 0 ! If we have something to unpack
; 3685 THEN
; 3686 BEGIN
; 3687 .DST_LEN = UNCHAR (CH$RCHAR_A (.POINTER));
; 3688
; 3689 IF ..DST_LEN GTR .SIZE - 1 THEN .DST_LEN = .SIZE - 1;
; 3690
; 3691 CH$COPY (..DST_LEN, ..POINTER, CHR_NUL, MAX_MSG, CH$PTR (.DST_ADDR));
; 3692 .POINTER = CH$PLUS (..POINTER, ..DST_LEN);
; 3693 RETURN .SIZE - ..DST_LEN - 1;
; 3694 END
; 3695 ELSE
; 3696 !
; 3697 ! If nothing left in buffer, return the current size (0)
; 3698 !
; 3699 RETURN .SIZE;
; 3700
; 3701 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL UNPACK.DATA SERVER - Generic commands
.NLIST
.ENABL LSB
.LIST
; UNPACK.DATA
U.104: JSR R1,$SAVE3 ; 3677
MOV 16(SP),R3 ; SIZE,* 3684
BLE 2$
MOV 12(SP),R2 ; DST.LEN,* 3687
MOV 20(SP),R1 ; POINTER,*
INC (R1)
MOV (R1),R0
MOVB -1(R0),(R2)
CLRB 1(R2)
SUB #40,(R2)
MOV R3,R0 ; 3689
DEC R0
CMP (R2),R0
BLE 1$
MOV R0,(R2)
1$: MOV (R2),-(SP) ; 3691
MOV (R1),-(SP)
CLR -(SP)
MOV #140,-(SP)
MOV 24(SP),-(SP) ; DST.ADDR,*
MOV #-5,-(SP)
JSR PC,BL$CPY
ADD (R2),(R1) ; 3692
MOV R3,R0 ; 3693
SUB (R2),R0
DEC R0
ADD #14,SP ; 3686
RTS PC ; 3682
2$: MOV R3,R0
RTS PC ; 3677
; Routine Size: 42 words, Routine Base: $CODE$ + 11516
; Maximum stack depth per invocation: 11 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3702 !
; 3703 ! First unpack the message data into its various pieces
; 3704 !
; 3705 SET_STRING (CH$PTR (DATA_TEXT), MAX_MSG, TRUE); ! Initialize for unpacking
; 3706 BFR_EMPTY (); ! Unpack the data
; 3707 DATA_SIZE = SET_STRING (0, 0, FALSE); ! All done, get size
; 3708
; 3709 IF .DATA_SIZE LEQ 0
; 3710 THEN
; 3711 BEGIN
; 3712 KRM_ERROR (KER_PROTOERR); ! Someone screwed up
; 3713 RETURN STATE_A; ! Since no subtype
; 3714 END;
; 3715
; 3716 !
; 3717 ! Get the arguments from the unpacked data (if any)
; 3718 !
; 3719 GEN_1SIZE = 0; ! Assume no args
; 3720 GEN_2SIZE = 0; ! none at all
; 3721 GEN_3SIZE = 0;
; 3722 CH$WCHAR (CHR_NUL, CH$PTR (GEN_1DATA)); ! Ensure all are null terminated
; 3723 CH$WCHAR (CHR_NUL, CH$PTR (GEN_2DATA));
; 3724 CH$WCHAR (CHR_NUL, CH$PTR (GEN_3DATA));
; 3725 POINTER = CH$PTR (DATA_TEXT, 1); ! Point at second character
; 3726 DATA_SIZE = .DATA_SIZE - 1; ! Account for subtype
; 3727
; 3728 IF .DATA_SIZE GTR 0 ! Room for first arg?
; 3729 THEN
; 3730 BEGIN
; 3731 DATA_SIZE = UNPACK_DATA (POINTER, .DATA_SIZE, GEN_1DATA, GEN_1SIZE);
; 3732
; 3733 IF .DATA_SIZE GTR 0 ! Second argument present?
; 3734 THEN
; 3735 BEGIN
; 3736 DATA_SIZE = UNPACK_DATA (POINTER, .DATA_SIZE, GEN_2DATA, GEN_2SIZE);
; 3737
; 3738 IF .DATA_SIZE GTR 0 ! Third argument here?
; 3739 THEN
; 3740 DATA_SIZE = UNPACK_DATA (POINTER, .DATA_SIZE, GEN_3DATA, GEN_3SIZE);
; 3741
; 3742 END;
; 3743
; 3744 END;
; 3745
; 3746 SELECTONE CH$RCHAR (CH$PTR (DATA_TEXT)) OF
; 3747 SET
; 3748 !
; 3749 ! EXIT command, just return the status to the upper level
; 3750 !
; 3751
; 3752 [MSG_GEN_EXIT] :
; 3753 BEGIN
; 3754 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3755 RETURN STATE_FI;
; 3756 END;
; 3757 !
; 3758 ! LOGOUT command, ACK the message then call the system routine to
; 3759 ! kill the process (log the job out, etc.)
; 3760 !
; 3761
; 3762 [MSG_GEN_LOGOUT] :
; 3763 BEGIN
; 3764 SEND_PACKET (MSG_ACK, 0, .REC_SEQ);
; 3765 SY_LOGOUT ();
; 3766 RETURN STATE_LG;
; 3767 END;
; 3768 !
; 3769 ! For a type command, just set up a transfer flagging we want a text header
; 3770 ! instead of a file header.
; 3771 !
; 3772
; 3773 [MSG_GEN_TYPE] :
; 3774 BEGIN
; 3775 CH$COPY (.GEN_1SIZE, CH$PTR (GEN_1DATA), CHR_NUL, MAX_FILE_NAME, CH$PTR (FILE_NAME));
; 3776 FILE_SIZE = .GEN_1SIZE;
; 3777 TEXT_HEAD_FLAG = TRUE; ! Now want text header
; 3778 XFR_STATUS (%C'I', %C'G'); ! Tell display routine we are doing a command
; 3779
; 3780 IF .STATE EQL STATE_II AND .BLK_CHK_TYPE EQL .INI_CHK_TYPE
; 3781 THEN
; 3782 RETURN STATE_OF ! Must open the file
; 3783 ELSE
; 3784 RETURN STATE_S; ! Start the transaction with a send
; 3785
; 3786 END;
; 3787
; 3788 [MSG_GEN_DIRECTORY] :
; 3789 G_FUNC = GC_DIRECTORY;
; 3790
; 3791 [MSG_GEN_DISK_USAGE] :
; 3792 G_FUNC = GC_DISK_USAGE;
; 3793
; 3794 [MSG_GEN_DELETE] :
; 3795 G_FUNC = GC_DELETE;
; 3796
; 3797 [MSG_GEN_HELP] :
; 3798 G_FUNC = GC_HELP;
; 3799
; 3800 [MSG_GEN_LOGIN] :
; 3801 G_FUNC = GC_LGN;
; 3802
; 3803 [MSG_GEN_CONNECT] :
; 3804 G_FUNC = GC_CONNECT;
; 3805
; 3806 [MSG_GEN_RENAME] :
; 3807 G_FUNC = GC_RENAME;
; 3808
; 3809 [MSG_GEN_COPY] :
; 3810 G_FUNC = GC_COPY;
; 3811
; 3812 [MSG_GEN_WHO] :
; 3813 G_FUNC = GC_WHO;
; 3814
; 3815 [MSG_GEN_SEND] :
; 3816 G_FUNC = GC_SEND_MSG;
; 3817
; 3818 [MSG_GEN_QUERY] :
; 3819 G_FUNC = GC_STATUS;
; 3820 !
; 3821 ! Here if we have a function that is not implemented in KERMSG.
; 3822 !
; 3823
; 3824 [OTHERWISE] :
; 3825 BEGIN
; 3826 KRM_ERROR (KER_UNIMPLGEN);
; 3827 RETURN STATE_A;
; 3828 END;
; 3829 TES;
; 3830
; 3831 !
; 3832 ! If we get here, we have gotten a known type of generic message that
; 3833 ! we need to have our operating system dependent routine handle.
; 3834 !
; 3835 RETURN CALL_SY_RTN (.G_FUNC);
; 3836 END; ! End of SERVER_GENERIC
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SERVER.GENERIC SERVER - Generic commands
.NLIST
.ENABL LSB
.LIST
; SERVER.GENERIC
U.14: JSR R1,$SAVE2 ; 3630
SUB #142,SP
MOV #4,-(SP) ; 3705
ADD SP,(SP) ; DATA.TEXT,*
MOV #140,-(SP)
MOV #1,-(SP)
JSR PC,U.29
JSR PC,U.27 ; 3706
CLR (SP) ; 3707
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV R0,R1 ; *,DATA.SIZE
BGT 1$ ; 3709
MOV #242,(SP) ; 3712
JMP 22$
1$: CLR GEN.1SIZE ; 3719
CLR GEN.2SIZE ; 3720
CLR GEN.3SIZE ; 3721
CLRB GEN.1DATA ; 3722
CLRB GEN.2DATA ; 3723
CLRB GEN.3DATA ; 3724
MOV #15,12(SP) ; *,POINTER 3725
ADD SP,12(SP) ; DATA.TEXT+1,POINTER
DEC R1 ; DATA.SIZE 3726
.WORD CLV!CLC
; 3728
BLE 4$
MOV #12,(SP) ; 3731
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.1DATA,-(SP)
MOV #GEN.1SIZE,-(SP)
JSR PC,U.104
MOV R0,R1 ; *,DATA.SIZE
BLE 3$ ; 3733
MOV #20,(SP) ; 3736
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.2DATA,-(SP)
MOV #GEN.2SIZE,-(SP)
JSR PC,U.104
MOV R0,R1 ; *,DATA.SIZE
BLE 2$ ; 3738
MOV #26,(SP) ; 3740
ADD SP,(SP) ; POINTER,*
MOV R1,-(SP) ; DATA.SIZE,*
MOV #GEN.3DATA,-(SP)
MOV #GEN.3SIZE,-(SP)
JSR PC,U.104
ADD #6,SP
2$: ADD #6,SP ; 3735
3$: ADD #6,SP ; 3730
4$: CLR R1 ; 3746
BISB 14(SP),R1 ; DATA.TEXT,*
CMP R1,#106
BNE 5$
MOV #131,(SP) ; 3754
CLR -(SP)
MOV U.79,-(SP)
JSR PC,U.23
ADD #16,SP ; 3746
MOV #20,R0 ; 3753
BR 9$
5$: CMP R1,#114 ; 3746
BNE 6$
MOV #131,(SP) ; 3764
CLR -(SP)
MOV U.79,-(SP)
JSR PC,U.23
JSR PC,SY.LOGOUT ; 3765
ADD #16,SP ; 3746
MOV #21,R0 ; 3763
BR 24$
6$: CMP R1,#124 ; 3746
BNE 10$
MOV GEN.1SIZE,(SP) ; 3775
MOV #GEN.1DATA,-(SP)
CLR -(SP)
MOV #204,-(SP)
MOV #FILE.NAME,-(SP)
MOV #-5,-(SP)
JSR PC,BL$CPY
MOV GEN.1SIZE,FILE.SIZE ; 3776
MOV #1,U.86 ; 3777
MOV #111,(SP) ; 3778
MOV #107,-(SP)
JSR PC,XFR.STATUS
CMP U.74,#17 ; 3780
BNE 7$
CMP U.71,U.70
BNE 7$
MOV #22,R0 ; 3774
BR 8$
7$: MOV #1,R0
8$: ADD #26,SP ; 3746
9$: BR 24$ ; 3774
10$: CMP R1,#104 ; 3746
BNE 11$
MOV #2,R2 ; *,G.FUNC 3789
BR 23$ ; 3746
11$: CMP R1,#125
BNE 12$
MOV #3,R2 ; *,G.FUNC 3792
BR 23$ ; 3746
12$: CMP R1,#105
BNE 13$
MOV #4,R2 ; *,G.FUNC 3795
BR 23$ ; 3746
13$: CMP R1,#110
BNE 14$
MOV #6,R2 ; *,G.FUNC 3798
BR 23$ ; 3746
14$: CMP R1,#111
BNE 15$
MOV #10,R2 ; *,G.FUNC 3801
BR 23$ ; 3746
15$: CMP R1,#103
BNE 16$
MOV #11,R2 ; *,G.FUNC 3804
BR 23$ ; 3746
16$: CMP R1,#122
BNE 17$
MOV #12,R2 ; *,G.FUNC 3807
BR 23$ ; 3746
17$: CMP R1,#113
BNE 18$
MOV #13,R2 ; *,G.FUNC 3810
BR 23$ ; 3746
18$: CMP R1,#127
BNE 19$
MOV #14,R2 ; *,G.FUNC 3813
BR 23$ ; 3746
19$: CMP R1,#115
BNE 20$
MOV #15,R2 ; *,G.FUNC 3816
BR 23$ ; 3746
20$: CMP R1,#121
BNE 21$
MOV #16,R2 ; *,G.FUNC 3819
BR 23$ ; 3746
21$: MOV #222,(SP) ; 3826
22$: JSR PC,KRM.ERROR
ADD #12,SP ; 3746
MOV #12,R0 ; 3825
BR 24$
23$: MOV R2,(SP) ; G.FUNC,* 3835
JSR PC,U.16
ADD #12,SP ; 3630
24$: ADD #142,SP
RTS PC
; Routine Size: 248 words, Routine Base: $CODE$ + 11642
; Maximum stack depth per invocation: 67 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3837 %SBTTL 'HOST_COMMAND - perform a host command'
; 3838 ROUTINE HOST_COMMAND =
; 3839
; 3840 !++
; 3841 ! FUNCTIONAL DESCRIPTION:
; 3842 !
; 3843 ! This routine will handle the host command packet.
; 3844 ! It will set up the data for the call to the system routine.
; 3845 !
; 3846 ! CALLING SEQUENCE:
; 3847 !
; 3848 ! STATE = HOST_COMMAND();
; 3849 !
; 3850 ! INPUT PARAMETERS:
; 3851 !
; 3852 ! None.
; 3853 !
; 3854 ! IMPLICIT INPUTS:
; 3855 !
; 3856 ! Generic message receive in REC_MSG.
; 3857 !
; 3858 ! OUTPUT PARAMETERS:
; 3859 !
; 3860 ! Returns new state for FSM
; 3861 !
; 3862 ! IMPLICIT OUTPUTS:
; 3863 !
; 3864 ! None.
; 3865 !
; 3866 ! COMPLETION CODES:
; 3867 !
; 3868 ! None.
; 3869 !
; 3870 ! SIDE EFFECTS:
; 3871 !
; 3872 ! None.
; 3873 !
; 3874 !--
; 3875
; 3876 BEGIN
; 3877 GEN_1SIZE = 0;
; 3878 GEN_2SIZE = 0;
; 3879 GEN_3SIZE = 0;
; 3880
; 3881 IF .REC_LENGTH LEQ 0
; 3882 THEN
; 3883 BEGIN
; 3884 KRM_ERROR (KER_PROTOERR); ! Return an error
; 3885 RETURN STATE_A; ! Just abort
; 3886 END;
; 3887
; 3888 SET_STRING (CH$PTR (GEN_1DATA), MAX_MSG, TRUE); ! Start writing to buffer
; 3889 BFR_EMPTY (); ! Dump the text
; 3890 GEN_1SIZE = SET_STRING (0, 0, FALSE); ! Get the result
; 3891 RETURN CALL_SY_RTN (GC_COMMAND);
; 3892 END; ! End of HOST_COMMAND
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL HOST.COMMAND HOST_COMMAND - perform a host command
.NLIST
.ENABL LSB
.LIST
; HOST.COMMAND
U.15: CLR GEN.1SIZE ; 3877
CLR GEN.2SIZE ; 3878
CLR GEN.3SIZE ; 3879
TST U.80 ; 3881
BGT 1$
MOV #242,-(SP) ; 3884
JSR PC,KRM.ERROR
TST (SP)+ ; 3881
MOV #12,R0 ; 3883
RTS PC
1$: MOV #GEN.1DATA,-(SP) ; 3888
MOV #140,-(SP)
MOV #1,-(SP)
JSR PC,U.29
JSR PC,U.27 ; 3889
CLR (SP) ; 3890
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV R0,GEN.1SIZE
MOV #17,(SP) ; 3891
JSR PC,U.16
ADD #12,SP ; 3838
RTS PC
; Routine Size: 41 words, Routine Base: $CODE$ + 12622
; Maximum stack depth per invocation: 6 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3893 %SBTTL 'CALL_SY_RTN - handle operating system dependent functions'
; 3894 ROUTINE CALL_SY_RTN (G_FUNC) =
; 3895
; 3896 !++
; 3897 ! FUNCTIONAL DESCRIPTION:
; 3898 !
; 3899 ! This routine will handle calling the operating system dependent routine
; 3900 ! for a server function and returning the response.
; 3901 !
; 3902 ! CALLING SEQUENCE:
; 3903 !
; 3904 ! STATE = CALL_SY_RTN(.G_FUNC);
; 3905 !
; 3906 ! INPUT PARAMETERS:
; 3907 !
; 3908 ! G_FUNC - Generic function code
; 3909 !
; 3910 ! IMPLICIT INPUTS:
; 3911 !
; 3912 ! Generic message data in GEN_1DATA
; 3913 !
; 3914 ! OUTPUT PARAMETERS:
; 3915 !
; 3916 ! Returns new state for FSM
; 3917 !
; 3918 ! IMPLICIT OUTPUTS:
; 3919 !
; 3920 ! None.
; 3921 !
; 3922 ! COMPLETION CODES:
; 3923 !
; 3924 ! None.
; 3925 !
; 3926 ! SIDE EFFECTS:
; 3927 !
; 3928 ! None.
; 3929 !
; 3930 !--
; 3931
; 3932 BEGIN
; 3933
; 3934 LOCAL
; 3935 STRING_ADDRESS, ! Address of string result
; 3936 STRING_LENGTH, ! Length of string result
; 3937 GET_CHR_SUBROUTINE, ! Routine to get a response character
; 3938 STATUS; ! Status value
; 3939
; 3940 !
; 3941 ! Call the routine with the desired type of command.
; 3942 !
; 3943 STRING_LENGTH = 0; ! Initialize for no string
; 3944 GET_CHR_SUBROUTINE = 0; ! And no subroutine
; 3945 IF NOT SY_GENERIC (.G_FUNC, STRING_ADDRESS, STRING_LENGTH, GET_CHR_SUBROUTINE)
; 3946 THEN
; 3947 RETURN STATE_A; ! And abort
; 3948
; 3949
; 3950 IF .STRING_LENGTH GTR 0
; 3951 THEN
; 3952 BEGIN
; 3953 SET_STRING (CH$PTR (.STRING_ADDRESS), .STRING_LENGTH, TRUE);
; 3954
; 3955 IF .STRING_LENGTH LSS .SEND_PKT_SIZE - PKT_OVR_HEAD
; 3956 THEN
; 3957 BEGIN
; 3958 BFR_FILL (TRUE); ! If it should fit, pack it in
; 3959
; 3960 IF SET_STRING (0, 0, FALSE) GEQ .STRING_LENGTH
; 3961 THEN ! It fit, so just send the ACK
; 3962
; 3963 IF SEND_PACKET (MSG_ACK, .SIZE, .REC_SEQ) THEN RETURN STATE_C ELSE RETURN STATE_EX;
; 3964
; 3965 !
; 3966 ! It didn't fit, reset the pointers to the beginning
; 3967 !
; 3968 SET_STRING (CH$PTR (.STRING_ADDRESS), .STRING_LENGTH, TRUE);
; 3969 END;
; 3970
; 3971 NO_FILE_NEEDED = TRUE; ! Don't need a file
; 3972 END
; 3973 ELSE
; 3974
; 3975 IF .GET_CHR_SUBROUTINE NEQ 0 ! If we got a subroutine back
; 3976 THEN
; 3977 BEGIN
; 3978 GET_CHR_ROUTINE = .GET_CHR_SUBROUTINE;
; 3979 NO_FILE_NEEDED = TRUE;
; 3980 END;
; 3981
; 3982 TEXT_HEAD_FLAG = TRUE; ! Send to be typed
; 3983 XFR_STATUS (%C'I', %C'G'); ! Doing a generic command
; 3984
; 3985 IF .STATE EQL STATE_II AND .BLK_CHK_TYPE EQL .INI_CHK_TYPE
; 3986 THEN
; 3987 RETURN STATE_OF
; 3988 ELSE
; 3989 RETURN STATE_S; ! Send the response
; 3990
; 3991 END; ! End of CALL_SY_RTN
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL CALL.SY.RTN CALL_SY_RTN - handle operating system dependent
.NLIST
.ENABL LSB
.LIST
; CALL.SY.RTN
U.16: MOV R1,-(SP) ; 3894
TST -(SP)
CLR -(SP) ; STRING.LENGTH 3943
CLR -(SP) ; GET.CHR.SUBROUT 3944
MOV 12(SP),-(SP) ; G.FUNC,* 3945
MOV #10,-(SP)
ADD SP,(SP) ; STRING.ADDRESS,*
MOV #10,-(SP)
ADD SP,(SP) ; STRING.LENGTH,*
MOV #10,-(SP)
ADD SP,(SP) ; GET.CHR.SUBROUT,*
JSR PC,SY.GENERIC
ADD #10,SP
ROR R0
BLO 1$
MOV #12,R0 ; 3947
BR 10$
1$: MOV 2(SP),R1 ; STRING.LENGTH,* 3950
BLE 6$
MOV 4(SP),-(SP) ; STRING.ADDRESS,* 3953
MOV R1,-(SP)
MOV #1,-(SP)
JSR PC,U.29
MOV U.64,R0 ; 3955
SUB #3,R0
CMP R1,R0
BGE 5$
MOV #1,(SP) ; 3958
JSR PC,U.28
CLR (SP) ; 3960
CLR -(SP)
CLR -(SP)
JSR PC,U.29
CMP (SP)+,(SP)+
CMP R0,R1
BLT 4$
MOV #131,(SP) ; 3963
MOV U.75,-(SP)
MOV U.79,-(SP)
JSR PC,U.23
CMP (SP)+,(SP)+
ROR R0
BCC 2$
MOV #11,R0 ; 3960
BR 3$
2$: MOV #23,R0
3$: ADD #6,SP
BR 10$ ; 3963
4$: MOV 12(SP),(SP) ; STRING.ADDRESS,* 3968
MOV R1,-(SP)
MOV #1,-(SP)
JSR PC,U.29
CMP (SP)+,(SP)+ ; 3957
5$: MOV #1,U.87 ; 3971
ADD #6,SP ; 3952
BR 7$ ; 3950
6$: MOV (SP),R0 ; GET.CHR.SUBROUT,* 3975
BEQ 7$
MOV R0,U.91 ; 3978
MOV #1,U.87 ; 3979
7$: MOV #1,U.86 ; 3982
MOV #111,-(SP) ; 3983
MOV #107,-(SP)
JSR PC,XFR.STATUS
CMP U.74,#17 ; 3985
BNE 8$
CMP U.71,U.70
BNE 8$
MOV #22,R0 ; 3932
BR 9$
8$: MOV #1,R0
9$: CMP (SP)+,(SP)+ ; 3894
10$: ADD #6,SP
MOV (SP)+,R1
RTS PC
; Routine Size: 119 words, Routine Base: $CODE$ + 12744
; Maximum stack depth per invocation: 10 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 3992 %SBTTL 'Message processing -- PRS_SEND_INIT - Parse send init params'
; 3993 ROUTINE PRS_SEND_INIT =
; 3994
; 3995 !++
; 3996 ! FUNCTIONAL DESCRIPTION:
; 3997 !
; 3998 ! This routine will parse the SEND_INIT parameters that were sent by
; 3999 ! the remote Kermit. The items will be stored into the low segment.
; 4000 !
; 4001 ! CALLING SEQUENCE:
; 4002 !
; 4003 ! PRS_SEND_INIT ();
; 4004 !
; 4005 ! INPUT PARAMETERS:
; 4006 !
; 4007 ! None.
; 4008 !
; 4009 ! IMPLICIT INPUTS:
; 4010 !
; 4011 ! Message stored in REC_MSG.
; 4012 !
; 4013 ! OUTPUT PARAMETERS:
; 4014 !
; 4015 ! None.
; 4016 !
; 4017 ! IMPLICIT OUTPUTS:
; 4018 !
; 4019 ! None.
; 4020 !
; 4021 ! COMPLETION CODES:
; 4022 !
; 4023 ! None.
; 4024 !
; 4025 ! SIDE EFFECTS:
; 4026 !
; 4027 ! None.
; 4028 !
; 4029 !--
; 4030
; 4031 BEGIN
; 4032 ! The following section of code will parse the various send parameters
; 4033 ! that are found in the send-init message. The following code will store
; 4034 ! the following as the value.
; 4035 !
; 4036 ! If the user specified a value then the user supplied value will be used else
; 4037 ! the value in the message and if none in the message then the default value.
; 4038 !
; 4039 ! User supplied values are denoted as positive values in SND_xxxxxxx.
; 4040 !
; 4041 ! Parse the packet size
; 4042 !
; 4043 SEND_PKT_SIZE = (IF .SND_PKT_SIZE GEQ 0 THEN .SND_PKT_SIZE ELSE
; 4044 BEGIN
; 4045
; 4046 IF .REC_LENGTH GTR P_SI_BUFSIZ
; 4047 THEN
; P 4048 UNCHAR (CH$RCHAR (CH$PTR (REC_MSG,
; 4049 PKT_MSG + P_SI_BUFSIZ, CHR_SIZE)))
; 4050 ELSE
; 4051 ABS (.SND_PKT_SIZE)
; 4052
; 4053 END
; 4054 );
; 4055 !
; 4056 ! Parse the time out value
; 4057 !
; 4058 SEND_TIMEOUT = (IF .SND_TIMEOUT GEQ 0 THEN .SND_TIMEOUT ELSE
; 4059 BEGIN
; 4060
; 4061 IF .REC_LENGTH GTR P_SI_TIMOUT
; 4062 THEN
; P 4063 UNCHAR (CH$RCHAR (CH$PTR (REC_MSG,
; 4064 PKT_MSG + P_SI_TIMOUT, CHR_SIZE)))
; 4065 ELSE
; 4066 ABS (.SND_TIMEOUT)
; 4067
; 4068 END
; 4069 );
; 4070 !
; 4071 ! Parse the number of padding characters supplied
; 4072 !
; 4073 SEND_NPAD = (IF .SND_NPAD GEQ 0 THEN .SND_NPAD ELSE
; 4074 BEGIN
; 4075
; 4076 IF .REC_LENGTH GTR P_SI_NPAD
; 4077 THEN
; P 4078 UNCHAR (CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG + P_SI_NPAD,
; 4079 CHR_SIZE)))
; 4080 ELSE
; 4081 ABS (.SND_NPAD)
; 4082
; 4083 END
; 4084 );
; 4085 !
; 4086 ! Parse the padding character
; 4087 !
; 4088 SEND_PADCHAR = (IF .SND_PADCHAR GEQ 0 THEN .SND_PADCHAR ELSE
; 4089 BEGIN
; 4090
; 4091 IF .REC_LENGTH GTR P_SI_PAD
; 4092 THEN
; P 4093 CTL (CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG + P_SI_PAD,
; 4094 CHR_SIZE)))
; 4095 ELSE
; 4096 ABS (.SND_PADCHAR)
; 4097
; 4098 END
; 4099 );
; 4100 !
; 4101 ! Parse the end of line character
; 4102 !
; 4103 SEND_EOL = (IF .SND_EOL GEQ 0 THEN .SND_EOL ELSE
; 4104 BEGIN
; 4105
; 4106 IF .REC_LENGTH GTR P_SI_EOL
; 4107 THEN
; P 4108 UNCHAR (CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG + P_SI_EOL,
; 4109 CHR_SIZE)))
; 4110 ELSE
; 4111 ABS (.SND_EOL)
; 4112
; 4113 END
; 4114 );
; 4115 !
; 4116 ! Parse the quoting character
; 4117 !
; 4118 SEND_QUOTE_CHR = (IF .SND_QUOTE_CHR GEQ 0 THEN .SND_QUOTE_CHR ELSE
; 4119 BEGIN
; 4120
; 4121 IF .REC_LENGTH GTR P_SI_QUOTE
; 4122 THEN
; 4123 CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG + P_SI_QUOTE,
; 4124 CHR_SIZE))
; 4125 ELSE
; 4126 ABS (.SND_QUOTE_CHR)
; 4127
; 4128 END
; 4129 );
; 4130 !
; 4131 ! Parse the 8-bit quoting character
; 4132 !
; 4133 ! If the character was not included in the packet, assume no eight-bit
; 4134 ! quoting allowed (we are probably talking to an old version of Kermit).
; 4135 !
; 4136 SEND_8QUOTE_CHR = (IF .REC_LENGTH GTR P_SI_8QUOTE THEN CH$RCHAR (CH$PTR (REC_MSG,
; 4137 PKT_MSG + P_SI_8QUOTE, CHR_SIZE)) ELSE %C'N' ! Assume no 8-bit quoting allowed
; 4138 );
; 4139 !
; 4140 ! Parse the checksum type
; 4141 !
; 4142
; 4143 IF .REC_LENGTH GTR P_SI_CHKTYPE
; 4144 THEN
; 4145 BEGIN
; 4146
; 4147 LOCAL
; 4148 REQ_CHK_TYPE;
; 4149
; 4150 REQ_CHK_TYPE = CH$RCHAR (CH$PTR (REC_MSG, PKT_MSG + P_SI_CHKTYPE, CHR_SIZE));
; 4151
; 4152 IF .REC_TYPE NEQ MSG_ACK
; 4153 THEN
; 4154
; 4155 IF .REQ_CHK_TYPE GEQ CHK_1CHAR AND .REQ_CHK_TYPE LEQ CHK_CRC
; 4156 THEN
; 4157 INI_CHK_TYPE = .REQ_CHK_TYPE
; 4158 ELSE
; 4159 INI_CHK_TYPE = CHK_1CHAR
; 4160
; 4161 ELSE
; 4162
; 4163 IF .REQ_CHK_TYPE NEQ .CHKTYPE
; 4164 THEN
; 4165 INI_CHK_TYPE = CHK_1CHAR
; 4166 ELSE
; 4167 INI_CHK_TYPE = .REQ_CHK_TYPE
; 4168
; 4169 END
; 4170 ELSE
; 4171 INI_CHK_TYPE = CHK_1CHAR; ! Only single character checksum if not specified
; 4172
; 4173 !
; 4174 ! Parse the repeat character
; 4175 !
; 4176 REPT_CHR = (IF .REC_LENGTH GTR P_SI_REPEAT THEN CH$RCHAR (CH$PTR (REC_MSG,
; 4177 PKT_MSG + P_SI_REPEAT, CHR_SIZE)) ELSE %C' ');
; 4178 !
; 4179 ! Check for a valid quoting character. If it is not valid, then we have
; 4180 ! a protocol error
; 4181 !
; 4182
; 4183 IF NOT ((.SEND_QUOTE_CHR GEQ %O'41' AND .SEND_QUOTE_CHR LEQ %O'76') OR (.SEND_QUOTE_CHR GEQ %O
; 4184 '140' AND .SEND_QUOTE_CHR LEQ %O'176'))
; 4185 THEN
; 4186 BEGIN
; 4187 KRM_ERROR (KER_PROTOERR);
; 4188 RETURN KER_PROTOERR;
; 4189 END;
; 4190
; 4191 !
; 4192 ! Check for a valid 8 bit quoting and set the 8 bit quoting flag as needed
; 4193 !
; 4194
; 4195 IF ( NOT ((.SEND_8QUOTE_CHR GEQ %O'041' AND .SEND_8QUOTE_CHR LEQ %O'076') OR (.SEND_8QUOTE_CHR
; 4196 GEQ %O'140' AND .SEND_8QUOTE_CHR LEQ %O'176') OR (.SEND_8QUOTE_CHR EQL %C'N') OR (
; 4197 .SEND_8QUOTE_CHR EQL %C'Y'))) OR .SEND_8QUOTE_CHR EQL .SEND_QUOTE_CHR
; 4198 OR .SEND_8QUOTE_CHR EQL .RCV_QUOTE_CHR
; 4199 THEN
; 4200 BEGIN
; 4201 KRM_ERROR (KER_PROTOERR);
; 4202 RETURN KER_PROTOERR;
; 4203 END;
; 4204
; 4205 IF .SEND_8QUOTE_CHR EQL %C'Y' THEN SEND_8QUOTE_CHR = .RECV_8QUOTE_CHR;
; 4206
; 4207 IF .SEND_8QUOTE_CHR NEQ %C'N' AND .SEND_8QUOTE_CHR NEQ %C'Y'
; 4208 THEN
; 4209 FLAG_8QUOTE = TRUE
; 4210 ELSE
; 4211 FLAG_8QUOTE = FALSE;
; 4212
; 4213 !
; 4214 ! Check the repeat character and set flags
; 4215 !
; 4216
; 4217 IF ( NOT ((.REPT_CHR GEQ %O'41' AND .REPT_CHR LEQ %O'76') OR (.REPT_CHR GEQ %O'140' AND
; 4218 .REPT_CHR LEQ %O'176')) OR .REPT_CHR EQL .SEND_QUOTE_CHR OR .REPT_CHR EQL .SEND_8QUOTE_CHR OR .REPT_CHR EQL .RCV_Q
; 4219 AND .REPT_CHR NEQ %C' '
; 4220 THEN
; 4221 BEGIN
; 4222 KRM_ERROR (KER_PROTOERR);
; 4223 RETURN KER_PROTOERR;
; 4224 END;
; 4225
; 4226 IF .REPT_CHR NEQ %C' ' THEN FLAG_REPEAT = TRUE ELSE FLAG_REPEAT = FALSE;
; 4227
; 4228 RETURN KER_NORMAL;
; 4229 END; ! End of PRS_SEND_INIT
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL PRS.SEND.INIT Message processing -- PRS_SEND_INIT - Parse sen
.NLIST
.ENABL LSB
.LIST
; PRS.SEND.INIT
U.20: MOV R1,-(SP) ; 3993
MOV SND.PKT.SIZE,R0 ; 4043
BGE 2$
TST U.80 ; 4046
BLE 1$
CLR R0 ; 4049
BISB U.82+4,R0
SUB #40,R0
BR 2$ ; 4044
1$: MOV R0,-(SP) ; 4051
JSR PC,BL$ABS
TST (SP)+
2$: MOV R0,U.64 ; 4043
MOV SND.TIMEOUT,R0 ; 4058
BGE 4$
CMP U.80,#1 ; 4061
BLE 3$
CLR R0 ; 4064
BISB U.82+5,R0
SUB #40,R0
BR 4$ ; 4059
3$: MOV R0,-(SP) ; 4066
JSR PC,BL$ABS
TST (SP)+
4$: MOV R0,SEND.TIMEOUT ; 4058
MOV SND.NPAD,R0 ; 4073
BGE 6$
CMP U.80,#2 ; 4076
BLE 5$
CLR R0 ; 4079
BISB U.82+6,R0
SUB #40,R0
BR 6$ ; 4074
5$: MOV R0,-(SP) ; 4081
JSR PC,BL$ABS
TST (SP)+
6$: MOV R0,U.65 ; 4073
MOV SND.PADCHAR,R0 ; 4088
BGE 8$
CMP U.80,#3 ; 4091
BLE 7$
MOV #100,R1 ; 4094
CLR R0
BISB U.82+7,R0
XOR R0,R1
MOV R1,R0 ; 4089
BR 8$
7$: MOV R0,-(SP) ; 4096
JSR PC,BL$ABS
TST (SP)+
8$: MOV R0,U.66 ; 4088
MOV SND.EOL,R0 ; 4103
BGE 10$
CMP U.80,#4 ; 4106
BLE 9$
CLR R0 ; 4109
BISB U.82+10,R0
SUB #40,R0
BR 10$ ; 4104
9$: MOV R0,-(SP) ; 4111
JSR PC,BL$ABS
TST (SP)+
10$: MOV R0,U.67 ; 4103
MOV SND.QUOTE.CHR,R0 ; 4118
BGE 12$
CMP U.80,#5 ; 4121
BLE 11$
CLR R0 ; 4119
BISB U.82+11,R0
BR 12$
11$: MOV R0,-(SP) ; 4126
JSR PC,BL$ABS
TST (SP)+
12$: MOV R0,U.68 ; 4118
MOV U.80,R1 ; 4136
CMP R1,#6
BLE 13$
CLR R0
BISB U.82+12,R0
BR 14$
13$: MOV #116,R0
14$: MOV R0,U.69
CMP R1,#7 ; 4143
BLE 17$
CLR R0 ; REQ.CHK.TYPE 4150
BISB U.82+13,R0 ; *,REQ.CHK.TYPE
CMP U.81,#131 ; 4152
BEQ 15$
CMP R0,#61 ; REQ.CHK.TYPE,* 4155
BLT 17$
CMP R0,#63 ; REQ.CHK.TYPE,*
BGT 17$
BR 16$ ; 4157
15$: CMP R0,CHKTYPE ; REQ.CHK.TYPE,* 4163
BNE 17$ ; 4165
16$: MOV R0,U.70 ; REQ.CHK.TYPE,* 4167
BR 18$ ; 4143
17$: MOV #61,U.70 ; 4171
18$: CMP R1,#10 ; 4176
BLE 19$
CLR R0
BISB U.82+14,R0
BR 20$
19$: MOV #40,R0
20$: MOV R0,U.63
MOV U.68,R0 ; 4183
CMP R0,#41
BLT 21$
CMP R0,#76
BLE 22$
21$: CMP R0,#140
BLT 32$
CMP R0,#176 ; 4184
BGT 32$ ; 4187
22$: MOV U.69,R0 ; 4195
CMP R0,#41
BLT 23$
CMP R0,#76
BLE 25$
23$: CMP R0,#140 ; 4196
BLT 24$
CMP R0,#176
BLE 25$
24$: CMP R0,#116
BEQ 25$
CMP R0,#131
BNE 32$
25$: CMP R0,U.68 ; 4197
BEQ 32$
CMP R0,RCV.QUOTE.CHR ; 4198
BEQ 32$ ; 4201
CMP U.69,#131 ; 4205
BNE 26$
MOV U.62,U.69
26$: MOV U.69,R1 ; 4207
CMP R1,#116
BEQ 27$
CMP R1,#131
BEQ 27$
MOV #1,U.72 ; 4209
BR 28$ ; 4207
27$: CLR U.72 ; 4211
28$: MOV U.63,R0 ; 4217
CMP R0,#41
BLT 29$
CMP R0,#76
BLE 30$
29$: CMP R0,#140
BLT 31$
CMP R0,#176 ; 4218
BGT 31$
30$: CMP R0,U.68
BEQ 31$
CMP R0,R1
BEQ 31$
CMP R0,RCV.QUOTE.CHR
BNE 33$
31$: CMP R0,#40 ; 4219
BEQ 33$
32$: MOV #242,-(SP) ; 4222
JSR PC,KRM.ERROR
TST (SP)+ ; 4217
MOV #242,R0 ; 4221
BR 36$
33$: CMP U.63,#40 ; 4226
BEQ 34$
MOV #1,U.73
BR 35$
34$: CLR U.73
35$: MOV #1,R0 ; 4031
36$: MOV (SP)+,R1 ; 3993
RTS PC
; Routine Size: 272 words, Routine Base: $CODE$ + 13322
; Maximum stack depth per invocation: 3 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4230 %SBTTL 'SET_SEND_INIT'
; 4231 ROUTINE SET_SEND_INIT : NOVALUE =
; 4232
; 4233 !++
; 4234 ! FUNCTIONAL DESCRIPTION:
; 4235 !
; 4236 ! This routine will initialize the various parameters for the
; 4237 ! MSG_SND_INIT message.
; 4238 !
; 4239 ! CALLING SEQUENCE:
; 4240 !
; 4241 ! SET_SEND_INIT();
; 4242 !
; 4243 ! INPUT PARAMETERS:
; 4244 !
; 4245 ! None.
; 4246 !
; 4247 ! IMPLICIT INPUTS:
; 4248 !
; 4249 ! None.
; 4250 !
; 4251 ! OUTPUT PARAMETERS:
; 4252 !
; 4253 ! None.
; 4254 !
; 4255 ! IMPLICIT OUTPUTS:
; 4256 !
; 4257 ! SND_MSG parameters set up.
; 4258 !
; 4259 ! COMPLETION CODES:
; 4260 !
; 4261 ! None.
; 4262 !
; 4263 ! SIDE EFFECTS:
; 4264 !
; 4265 ! None.
; 4266 !
; 4267 !--
; 4268
; 4269 BEGIN
; 4270 CH$WCHAR (CHAR (.RCV_PKT_SIZE), CH$PTR (SND_MSG, PKT_MSG + P_SI_BUFSIZ, CHR_SIZE));
; 4271 CH$WCHAR (CHAR (.RCV_TIMEOUT), CH$PTR (SND_MSG, PKT_MSG + P_SI_TIMOUT, CHR_SIZE));
; 4272 CH$WCHAR (CHAR (.RCV_NPAD), CH$PTR (SND_MSG, PKT_MSG + P_SI_NPAD, CHR_SIZE));
; 4273 CH$WCHAR (CTL (.RCV_PADCHAR), CH$PTR (SND_MSG, PKT_MSG + P_SI_PAD, CHR_SIZE));
; 4274 CH$WCHAR (CHAR (.RCV_EOL), CH$PTR (SND_MSG, PKT_MSG + P_SI_EOL, CHR_SIZE));
; 4275 CH$WCHAR (.RCV_QUOTE_CHR, CH$PTR (SND_MSG, PKT_MSG + P_SI_QUOTE, CHR_SIZE));
; 4276 CH$WCHAR (.SEND_8QUOTE_CHR, CH$PTR (SND_MSG, PKT_MSG + P_SI_8QUOTE, CHR_SIZE));
; 4277 CH$WCHAR (.INI_CHK_TYPE, CH$PTR (SND_MSG, PKT_MSG + P_SI_CHKTYPE, CHR_SIZE));
; 4278 CH$WCHAR (.REPT_CHR, CH$PTR (SND_MSG, PKT_MSG + P_SI_REPEAT, CHR_SIZE));
; 4279 END; ! End of SET_SEND_INIT
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SET.SEND.INIT SET_SEND_INIT
.NLIST
.ENABL LSB
.LIST
; SET.SEND.INIT
U.19: MOV R1,-(SP) ; 4231
MOV RCV.PKT.SIZE,R0 ; 4270
ADD #40,R0
MOVB R0,U.83+4
MOV RCV.TIMEOUT,R0 ; 4271
ADD #40,R0
MOVB R0,U.83+5
MOV RCV.NPAD,R0 ; 4272
ADD #40,R0
MOVB R0,U.83+6
MOV RCV.PADCHAR,R1 ; 4273
MOV #100,R0
XOR R0,R1
MOVB R1,U.83+7
MOV RCV.EOL,R0 ; 4274
ADD #40,R0
MOVB R0,U.83+10
MOVB RCV.QUOTE.CHR,U.83+11 ; 4275
MOVB U.69,U.83+12 ; 4276
MOVB U.70,U.83+13 ; 4277
MOVB U.63,U.83+14 ; 4278
MOV (SP)+,R1 ; 4231
RTS PC
; Routine Size: 46 words, Routine Base: $CODE$ + 14362
; Maximum stack depth per invocation: 2 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4280 %SBTTL 'SEND_PACKET'
; 4281 ROUTINE SEND_PACKET (TYPE, LENGTH, MN) =
; 4282
; 4283 !++
; 4284 ! FUNCTIONAL DESCRIPTION:
; 4285 !
; 4286 ! This routine will cause a packet to be sent over the line
; 4287 ! that has been opened by OPEN_TERMINAL.
; 4288 !
; 4289 ! CALLING SEQUENCE:
; 4290 !
; 4291 ! SEND_PACKET(Type, Length);
; 4292 !
; 4293 ! INPUT PARAMETERS:
; 4294 !
; 4295 ! TYPE - Type of packet to send.
; 4296 !
; 4297 ! LENGTH - Length of the packet being sent.
; 4298 !
; 4299 ! IMPLICIT INPUTS:
; 4300 !
; 4301 ! None.
; 4302 !
; 4303 ! OUTPUT PARAMETERS:
; 4304 !
; 4305 ! None.
; 4306 !
; 4307 ! IMPLICIT OUTPUTS:
; 4308 !
; 4309 ! None.
; 4310 !
; 4311 ! COMPLETION CODES:
; 4312 !
; 4313 ! None.
; 4314 !
; 4315 ! SIDE EFFECTS:
; 4316 !
; 4317 ! None.
; 4318 !
; 4319 !--
; 4320
; 4321 BEGIN
; 4322
; 4323 LOCAL
; 4324 FILLER : VECTOR [CH$ALLOCATION (MAX_MSG, CHR_SIZE)],
; 4325 TOT_MSG_LEN, ! Length of message including all characters
; 4326 CHKSUM, ! Checksum for the message we calculate
; 4327 POINTER; ! Pointer to the information in the message
; 4328
; 4329 !
; 4330 ! Do any filler processing that the remote KERMIT requires.
; 4331 !
; 4332
; 4333 IF .SEND_NPAD NEQ 0
; 4334 THEN
; 4335 BEGIN
; 4336 CH$FILL (.SEND_PADCHAR, MAX_MSG, CH$PTR (FILLER, 0, CHR_SIZE));
; 4337 !
; 4338 ! Update the send stats
; 4339 !
; 4340 SMSG_TOTAL_CHARS = .SMSG_TOTAL_CHARS + .SEND_NPAD;
; 4341 !
; 4342 ! Send the fill
; 4343 !
; 4344 DO_PARITY (FILLER, .SEND_NPAD + PKT_TOT_OVR_HEAD);
; 4345 SEND (FILLER, .SEND_NPAD + PKT_TOT_OVR_HEAD);
; 4346 END;
; 4347
; 4348 !
; 4349 ! Store the header information into the message.
; 4350 !
; 4351 CH$WCHAR (.TYPE, CH$PTR (SND_MSG, PKT_TYPE, CHR_SIZE));
; 4352 CH$WCHAR (.SND_SOH, CH$PTR (SND_MSG, PKT_MARK, CHR_SIZE));
; 4353 CH$WCHAR (CHAR (.LENGTH + PKT_OVR_HEAD + (.BLK_CHK_TYPE - CHK_1CHAR)),
; 4354 CH$PTR (SND_MSG,
; 4355 PKT_COUNT, CHR_SIZE));
; 4356 CH$WCHAR (CHAR ((IF .MN LSS 0 THEN 0 ELSE .MN)), CH$PTR (SND_MSG, PKT_SEQ, CHR_SIZE));
; 4357 !
; 4358 ! Calculate the block check value
; 4359 !
; 4360 POINTER = CH$PTR (SND_MSG, PKT_MARK + 1, CHR_SIZE);
; 4361 CHKSUM = CALC_BLOCK_CHECK (.POINTER, .LENGTH + PKT_OVR_HEAD);
; 4362 TOT_MSG_LEN = .LENGTH + PKT_TOT_OVR_HEAD;
; 4363 !
; 4364 ! Store the checksum into the message
; 4365 !
; 4366 POINTER = CH$PTR (SND_MSG, .LENGTH + PKT_OVR_HEAD + 1, CHR_SIZE);
; 4367
; 4368 CASE .BLK_CHK_TYPE FROM CHK_1CHAR TO CHK_CRC OF
; 4369 SET
; 4370
; 4371 [CHK_1CHAR] :
; 4372 CH$WCHAR_A (CHAR (.CHKSUM), POINTER);
; 4373
; 4374 [CHK_2CHAR] :
; 4375 BEGIN
; 4376 CH$WCHAR_A (CHAR (.CHKSUM<6, 6>), POINTER);
; 4377 CH$WCHAR_A (CHAR (.CHKSUM<0, 6>), POINTER);
; 4378 TOT_MSG_LEN = .TOT_MSG_LEN + 1;
; 4379 END;
; 4380
; 4381 [CHK_CRC] :
; 4382 BEGIN
; 4383 CH$WCHAR_A (CHAR (.CHKSUM<12, 4>), POINTER);
; 4384 CH$WCHAR_A (CHAR (.CHKSUM<6, 6>), POINTER);
; 4385 CH$WCHAR_A (CHAR (.CHKSUM<0, 6>), POINTER);
; 4386 TOT_MSG_LEN = .TOT_MSG_LEN + 2;
; 4387 END;
; 4388 TES;
; 4389
; 4390 !
; 4391 ! Store in the end of line character
; 4392 !
; 4393 CH$WCHAR_A (.SEND_EOL, POINTER);
; 4394 !
; 4395 ! If we are debugging then type out the message we are sending.
; 4396 !
; 4397 DBG_SEND (SND_MSG, (.TOT_MSG_LEN));
; 4398 !
; 4399 ! Update the stats for total characters and the data characters
; 4400 !
; 4401 SMSG_TOTAL_CHARS = .SMSG_TOTAL_CHARS + .TOT_MSG_LEN;
; 4402 ! Make data characters really be that, not just characters in data field
; 4403 ! SMSG_DATA_CHARS = .SMSG_DATA_CHARS + .LENGTH;
; 4404
; 4405 IF .TYPE EQL MSG_NAK
; 4406 THEN
; 4407 BEGIN
; 4408 SMSG_NAKS = .SMSG_NAKS + 1;
; 4409 XFR_STATUS (%C'S', %C'N');
; 4410 END
; 4411 ELSE
; 4412 BEGIN
; 4413 SMSG_COUNT = .SMSG_COUNT + 1;
; 4414 XFR_STATUS (%C'S', %C'P');
; 4415 END;
; 4416
; 4417 !
; 4418 ! Check if we are in IBM mode and need to wait for an XON first
; 4419 ! We will not wait if this is a packet which might be going out
; 4420 ! without previous traffic (generic commands, init packets).
; 4421
; 4422 IF .IBM_FLAG AND NOT (.TYPE EQL MSG_SND_INIT OR .TYPE EQL MSG_SER_INIT OR .TYPE EQL MSG_RCV_INIT
; 4423 OR .TYPE EQL MSG_COMMAND OR .TYPE EQL MSG_KERMIT)
; 4424 THEN
; 4425
; 4426 IF NOT IBM_WAIT () THEN RETURN KER_ABORTED;
; 4427
; 4428 !
; 4429 ! Now call the O/S routine to send the message out to the remote KERMIT
; 4430 !
; 4431 DO_PARITY (SND_MSG, .TOT_MSG_LEN);
; 4432 RETURN SEND (SND_MSG, .TOT_MSG_LEN);
; 4433 END; ! End of SEND_PACKET
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SEND.PACKET SEND_PACKET
.NLIST
.ENABL LSB
.LIST
; SEND.PACKET
U.23: JSR R1,$SAVE4 ; 4281
SUB #140,SP
TST U.65 ; 4333
BEQ 1$
MOV U.66,-(SP) ; 4336
MOV #140,-(SP)
MOV #6,-(SP)
ADD SP,(SP) ; FILLER,*
JSR PC,BL$FIL
ADD U.65,SMSG.TOTAL.CHARS ; 4340
MOV #6,(SP) ; 4344
ADD SP,(SP) ; FILLER,*
MOV U.65,-(SP)
ADD #6,(SP)
JSR PC,U.21
MOV #10,(SP) ; 4345
ADD SP,(SP) ; FILLER,*
MOV U.65,-(SP)
ADD #6,(SP)
JSR PC,SEND
ADD #12,SP ; 4335
1$: MOV 160(SP),R2 ; TYPE,* 4351
MOVB R2,U.83+3
MOVB SND.SOH,U.83 ; 4352
MOV 156(SP),R1 ; LENGTH,* 4353
MOV R1,R0
ADD U.71,R0
MOV R0,R3
SUB #16,R3
MOVB R3,U.83+1
MOV 154(SP),R0 ; MN,* 4356
BGE 2$
CLR R0
2$: MOV R0,R3
ADD #40,R3
MOVB R3,U.83+2
MOV #U.83+1,R4 ; *,POINTER 4360
MOV R4,-(SP) ; POINTER,* 4361
MOV R1,-(SP)
ADD #3,(SP)
JSR PC,U.18
MOV R1,R3 ; *,TOT.MSG.LEN 4362
ADD #6,R3 ; *,TOT.MSG.LEN
ADD #U.83,R1 ; 4366
MOV R1,R4 ; *,POINTER
ADD #4,R4 ; *,POINTER
MOV U.71,R1 ; 4368
SUB #61,R1
ASL R1
ADD P.AAM(R1),PC ; Case dispatch
4$: MOV R0,R1 ; CHKSUM,* 4372
ADD #40,R1
MOVB R1,(R4) ; *,POINTER
BR 7$ ; 4368
5$: MOV R0,R1 ; CHKSUM,* 4376
ASH #-6,R1
BIC #177700,R1
ADD #40,R1
MOVB R1,(R4)+ ; *,POINTER
MOV R0,R1 ; CHKSUM,* 4377
BIC #177700,R1
ADD #40,R1
MOVB R1,(R4) ; *,POINTER
INC R3 ; TOT.MSG.LEN 4378
BR 7$ ; 4368
6$: MOV R0,R1 ; CHKSUM,* 4383
ASH #-14,R1
BIC #177760,R1
ADD #40,R1
MOVB R1,(R4)+ ; *,POINTER
MOV R0,R1 ; CHKSUM,* 4384
ASH #-6,R1
BIC #177700,R1
ADD #40,R1
MOVB R1,(R4)+ ; *,POINTER
MOV R0,R1 ; CHKSUM,* 4385
BIC #177700,R1
ADD #40,R1
MOVB R1,(R4) ; *,POINTER
ADD #2,R3 ; *,TOT.MSG.LEN 4386
7$: INC R4 ; POINTER 4372
MOVB U.67,(R4)+ ; *,POINTER 4393
MOV #U.83,(SP) ; 4397
MOV R3,-(SP) ; TOT.MSG.LEN,*
JSR PC,U.34
ADD R3,SMSG.TOTAL.CHARS ; TOT.MSG.LEN,* 4401
CMP R2,#116 ; 4405
BNE 8$
INC SMSG.NAKS ; 4408
MOV #123,(SP) ; 4409
MOV #116,-(SP)
BR 9$
8$: INC SMSG.COUNT ; 4413
MOV #123,(SP) ; 4414
MOV #120,-(SP)
9$: JSR PC,XFR.STATUS
BIT #1,IBM.FLAG ; 4422
BEQ 10$
CMP R2,#123
BEQ 10$
CMP R2,#111
BEQ 10$
CMP R2,#122
BEQ 10$
CMP R2,#103 ; 4423
BEQ 10$
CMP R2,#107
BEQ 10$
JSR PC,IBM.WAIT ; 4426
ROR R0
BLO 10$
ADD #10,SP
MOV #272,R0
BR 11$
10$: MOV #U.83,(SP) ; 4431
MOV R3,-(SP) ; TOT.MSG.LEN,*
JSR PC,U.21
MOV #U.83,(SP) ; 4432
MOV R3,-(SP) ; TOT.MSG.LEN,*
JSR PC,SEND
ADD #14,SP ; 4281
11$: ADD #140,SP
RTS PC
; Routine Size: 204 words, Routine Base: $CODE$ + 14516
; Maximum stack depth per invocation: 60 words
.PSECT $PLIT$, RO , D
P.AAM: ; CASE Table for SEND.PACKET+0254 4368
3$: .WORD 0 ; [4$]
.WORD 12 ; [5$]
.WORD 52 ; [6$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4434 %SBTTL 'REC_MESSAGE - Receive a message'
; 4435 ROUTINE REC_MESSAGE (CHK_ROUTINE) =
; 4436
; 4437 !++
; 4438 ! FUNCTIONAL DESCRIPTION:
; 4439 !
; 4440 ! This routine will handle the retry processing for the various
; 4441 ! messages that can be received.
; 4442 !
; 4443 ! CALLING SEQUENCE:
; 4444 !
; 4445 ! INPUT PARAMETERS:
; 4446 !
; 4447 ! None.
; 4448 !
; 4449 ! IMPLICIT INPUTS:
; 4450 !
; 4451 ! None.
; 4452 !
; 4453 ! OUTPUT PARAMETERS:
; 4454 !
; 4455 ! None.
; 4456 !
; 4457 ! IMPLICIT OUTPUTS:
; 4458 !
; 4459 ! None.
; 4460 !
; 4461 ! COMPLETION CODES:
; 4462 !
; 4463 ! KER_NORMAL - Normal return
; 4464 ! KER_RETRIES - Too many retries
; 4465 ! (What ever REC_PACKET returns).
; 4466 !
; 4467 ! SIDE EFFECTS:
; 4468 !
; 4469 ! None.
; 4470 !
; 4471 !--
; 4472
; 4473 BEGIN
; 4474
; 4475 LOCAL
; 4476 STATUS; ! Status returned by various routines
; 4477
; 4478 RETURN
; 4479
; 4480 WHILE TRUE DO
; 4481 BEGIN
; 4482
; 4483 IF .NUM_RETRIES GTR .PKT_RETRIES THEN RETURN KER_RETRIES;
; 4484
; 4485 NUM_RETRIES = .NUM_RETRIES + 1;
; 4486 STATUS = REC_PACKET ();
; 4487
; 4488 IF NOT .STATUS AND .STATUS NEQ KER_CHKSUMERR AND .STATUS NEQ KER_TIMEOUT
; 4489 THEN
; 4490 EXITLOOP .STATUS;
; 4491
; 4492 IF NOT .STATUS
; 4493 THEN
; 4494 SEND_PACKET (MSG_NAK, 0, .MSG_NUMBER) ![024]
; 4495 ELSE
; 4496 BEGIN
; 4497 ![021]
; 4498 ![021] If the packet type is not acceptable by our caller, nak it so the
; 4499 ![021] other end tries again, and abort the current operation. This is so
; 4500 ![021] we will return to server mode (if we are running that way) quickly
; 4501 ![021] when the other Kermit has been aborted and then restarted, and should
; 4502 ![021] also make restarting quick, since we will not need to wait for the
; 4503 ![021] other Kermit to time this message out before retransmitting.
; 4504 ![021]
; 4505
; 4506 IF NOT (.CHK_ROUTINE) ()
; 4507 THEN
; 4508 BEGIN
; 4509 SEND_PACKET (MSG_NAK, 0, .REC_SEQ);
; 4510 RETURN KER_RETRIES;
; 4511 END
; 4512 ELSE
; 4513 EXITLOOP KER_NORMAL;
; 4514
; 4515 END;
; 4516
; 4517 END;
; 4518
; 4519 END; ! End of REC_PARSE
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL REC.MESSAGE REC_MESSAGE - Receive a message
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; REC.MESSAGE
U.24: MOV R1,-(SP) ; 4435
1$: CMP U.77,PKT.RETRIES ; 4483
BGT 4$
INC U.77 ; 4485
JSR PC,U.25 ; 4486
MOV R0,R1 ; *,STATUS
BIT #1,R1 ; *,STATUS 4488
BNE 3$
CMP R1,#162 ; STATUS,*
BEQ 2$
CMP R1,#264 ; STATUS,*
BNE 6$ ; 4490
2$: BIT #1,R1 ; *,STATUS 4492
BNE 3$
MOV #116,-(SP) ; 4494
CLR -(SP)
MOV U.78,-(SP)
JSR PC,U.23
ADD #6,SP
BR 1$ ; 4492
3$: JSR PC,@4(SP) ; *,CHK.ROUTINE 4506
ROR R0
BLO 5$
MOV #116,-(SP) ; 4509
CLR -(SP)
MOV U.79,-(SP)
JSR PC,U.23
ADD #6,SP ; 4506
4$: MOV #202,R0 ; 4508
BR 6$
5$: MOV #1,R0 ; 4513
6$: MOV (SP)+,R1 ; 4435
RTS PC
; Routine Size: 52 words, Routine Base: $CODE$ + 15346
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4520 %SBTTL 'REC_PACKET'
; 4521 ROUTINE REC_PACKET =
; 4522
; 4523 !++
; 4524 ! FUNCTIONAL DESCRIPTION:
; 4525 !
; 4526 ! This routine will do the oppoiste of SEND_PACKET. It will wait
; 4527 ! for the message to be read from the remote and then it will
; 4528 ! check the message for validity.
; 4529 !
; 4530 ! CALLING SEQUENCE:
; 4531 !
; 4532 ! Flag = REC_PACKET();
; 4533 !
; 4534 ! INPUT PARAMETERS:
; 4535 !
; 4536 ! None.
; 4537 !
; 4538 ! IMPLICIT INPUTS:
; 4539 !
; 4540 ! None.
; 4541 !
; 4542 ! OUTPUT PARAMETERS:
; 4543 !
; 4544 ! None.
; 4545 !
; 4546 ! IMPLICIT OUTPUTS:
; 4547 !
; 4548 ! REC_MSG - Contains the message received.
; 4549 !
; 4550 ! COMPLETION CODES:
; 4551 !
; 4552 ! True - Packet receive ok.
; 4553 ! False - Problem occured during the receiving of the packet.
; 4554 !
; 4555 ! SIDE EFFECTS:
; 4556 !
; 4557 ! None.
; 4558 !
; 4559 !--
; 4560
; 4561 BEGIN
; 4562
; 4563 BIND
; 4564 ATTEMPT_TEXT = UPLIT (%ASCIZ'Attempting to receive');
; 4565
; 4566 LOCAL
; 4567 STATUS, ! Status returned by various routines
; 4568 MSG_LENGTH,
; 4569 ERR_POINTER, ! Pointer to the error buffer
; 4570 POINTER,
; 4571 CHKSUM; ! Checksum of the message
; 4572
; 4573 !
; 4574 ! Attempt to read the message from the remote.
; 4575 !
; 4576 ! DO
; 4577 ! BEGIN
; 4578
; 4579 IF .DEBUG_FLAG
; 4580 THEN
; 4581 BEGIN
; 4582
; 4583 LOCAL
; 4584 OLD_RTN;
; 4585
; 4586 OLD_RTN = TT_SET_OUTPUT (DBG_DUMP);
; 4587 TT_TEXT (ATTEMPT_TEXT);
; 4588 TT_CRLF ();
; 4589 TT_SET_OUTPUT (.OLD_RTN);
; 4590 END;
; 4591
; 4592 !
; 4593 ! If status type out requested, do it once
; 4594 !
; 4595
; 4596 IF .TYP_STS_FLAG
; 4597 THEN
; 4598 BEGIN
; 4599 STS_OUTPUT ();
; 4600 TYP_STS_FLAG = FALSE;
; 4601 END;
; 4602
; 4603 !
; 4604 ! Receive the message from the remote Kermit
; 4605 !
; 4606 STATUS = RECEIVE (REC_MSG, MSG_LENGTH);
; 4607 !
; 4608 ! Check for timeouts
; 4609 !
; 4610
; 4611 IF .STATUS EQL KER_TIMEOUT THEN XFR_STATUS (%C'R', %C'T');
; 4612
; 4613 !
; 4614 ! If it failed return the status to the upper level
; 4615 !
; 4616
; 4617 IF NOT .STATUS THEN RETURN .STATUS;
; 4618
; 4619 !
; 4620 ! Determine if we got a good message
; 4621 !
; 4622
; 4623 IF .MSG_LENGTH EQL 0
; 4624 THEN
; 4625 BEGIN
; 4626 RETURN KER_ZEROLENMSG;
; 4627 END;
; 4628
; 4629 !
; 4630 ! Update the stats on the total number of characters received.
; 4631 !
; 4632 RMSG_TOTAL_CHARS = .RMSG_TOTAL_CHARS + .MSG_LENGTH;
; 4633 !
; 4634 ! Initialize the checksum and others
; 4635 !
; 4636 REC_TYPE = CH$RCHAR (CH$PTR (REC_MSG, PKT_TYPE, CHR_SIZE));
; 4637 !
; 4638 ! Now break the message apart byte by byte.
; 4639 !
; 4640 REC_LENGTH = UNCHAR (CH$RCHAR (CH$PTR (REC_MSG, PKT_COUNT, CHR_SIZE))) - PKT_OVR_HEAD - (
; 4641 .BLK_CHK_TYPE - CHK_1CHAR);
; 4642 REC_SEQ = UNCHAR (CH$RCHAR (CH$PTR (REC_MSG, PKT_SEQ, CHR_SIZE)));
; 4643 !
; 4644 ! In order to detect a remote server Kermit aborting back to the idle
; 4645 ! state without giving us any indication, we will accept a NAK which
; 4646 ! has a single character checksum so long as it also is message sequence
; 4647 ! number zero. Note that we will reset the block check type if this
; 4648 ! is the case.
; 4649 !
; 4650
; 4651 IF .BLK_CHK_TYPE NEQ CHK_1CHAR AND .REC_SEQ EQL 0 AND .REC_LENGTH LSS 1 - (.BLK_CHK_TYPE -
; 4652 CHK_1CHAR) AND .REC_TYPE EQL MSG_NAK
; 4653 THEN
; 4654 BLK_CHK_TYPE = CHK_1CHAR;
; 4655
; 4656 !
; 4657 ! Typed the packet if we are debugging
; 4658 !
; 4659 DBG_RECEIVE (REC_MSG);
; 4660 !
; 4661 ! Now compute the final checksum and make sure that it is identical
; 4662 ! to what we received from the remote KERMIT
; 4663 !
; 4664 POINTER = CH$PTR (REC_MSG, PKT_MARK + 1, CHR_SIZE);
; 4665 CHKSUM = CALC_BLOCK_CHECK (.POINTER, .REC_LENGTH + PKT_OVR_HEAD);
; 4666 POINTER = CH$PTR (REC_MSG, .REC_LENGTH + PKT_OVR_HEAD + 1, CHR_SIZE);
; 4667
; 4668 CASE .BLK_CHK_TYPE FROM CHK_1CHAR TO CHK_CRC OF
; 4669 SET
; 4670
; 4671 [CHK_1CHAR] :
; 4672
; 4673 IF .CHKSUM NEQ UNCHAR (CH$RCHAR_A (POINTER)) THEN RETURN KER_CHKSUMERR;
; 4674
; 4675 [CHK_2CHAR] :
; 4676
; P 4677 IF (.CHKSUM<6, 6> NEQ UNCHAR (CH$RCHAR_A (POINTER))) OR (.CHKSUM<0, 6> NEQ UNCHAR (
; 4678 CH$RCHAR_A (POINTER)))
; 4679 THEN
; 4680 RETURN KER_CHKSUMERR;
; 4681
; 4682 [CHK_CRC] :
; 4683
; P 4684 IF (.CHKSUM<12, 4> NEQ UNCHAR (CH$RCHAR_A (POINTER))) OR (.CHKSUM<6, 6> NEQ UNCHAR (
; 4685 CH$RCHAR_A (POINTER))) OR (.CHKSUM<0, 6> NEQ UNCHAR (CH$RCHAR_A (POINTER)))
; 4686 THEN
; 4687 RETURN KER_CHKSUMERR;
; 4688
; 4689 TES;
; 4690
; 4691 !
; 4692 ! Update the stats
; 4693 !
; 4694 ! RMSG_DATA_CHARS = .RMSG_DATA_CHARS + .REC_LENGTH;
; 4695
; 4696 IF .REC_TYPE EQL MSG_NAK
; 4697 THEN
; 4698 BEGIN
; 4699 RMSG_NAKS = .RMSG_NAKS + 1;
; 4700 XFR_STATUS (%C'R', %C'N');
; 4701 END
; 4702 ELSE
; 4703 BEGIN
; 4704 RMSG_COUNT = .RMSG_COUNT + 1;
; 4705 XFR_STATUS (%C'R', %C'P');
; 4706 END;
; 4707
; 4708 !
; 4709 ! Now check to see if we have an E type (Error) packet.
; 4710 !
; 4711
; 4712 IF .REC_TYPE NEQ MSG_ERROR THEN RETURN KER_NORMAL;
; 4713
; 4714 !
; 4715 ! Here to process an error packet. Call the user routine to output the
; 4716 ! error message to the terminal.
; 4717 !
; 4718 !
; 4719 ![026] Use decoding routine to fetch the error text
; 4720 !
; 4721 CH$FILL (CHR_NUL, MAX_MSG + 1, CH$PTR (LAST_ERROR));
; 4722 SET_STRING (CH$PTR (LAST_ERROR), MAX_MSG, TRUE);
; 4723 BFR_EMPTY ();
; 4724 SET_STRING (0, 0, FALSE);
; 4725 ![026] ERR_POINTER = CH$PTR (LAST_ERROR);
; 4726 ![026] POINTER = CH$PTR (REC_MSG, PKT_MSG, CHR_SIZE);
; 4727 ![026]
; 4728 ![026] INCR I FROM 1 TO .REC_LENGTH DO
; 4729 ![026] CH$WCHAR_A (CH$RCHAR_A (POINTER), ERR_POINTER);
; 4730 ![026]
; 4731 ![026] CH$WCHAR (CHR_NUL, ERR_POINTER);
; 4732 TT_TEXT (LAST_ERROR);
; 4733 TT_CRLF ();
; 4734 RETURN KER_ERRMSG;
; 4735 END; ! End of REC_PACKET
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAN: .ASCII /Att/
.ASCII /emp/
.ASCII /tin/
.ASCII /g t/
.ASCII /o r/
.ASCII /ece/
.ASCII /ive/
.ASCII <00>
; ATTEMPT.TEXT
U.105= P.AAN
.SBTTL REC.PACKET REC_PACKET
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; REC.PACKET
U.25: JSR R1,$SAVE4 ; 4521
TST -(SP)
BIT #1,DEBUG.FLAG ; 4579
BEQ 1$
MOV #DBG.DUMP,-(SP) ; 4586
JSR PC,TT.SET.OUTPUT
MOV R0,R1 ; *,OLD.RTN
MOV #U.105,(SP) ; 4587
JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 4588
MOV R1,(SP) ; OLD.RTN,* 4589
JSR PC,TT.SET.OUTPUT
TST (SP)+ ; 4581
1$: BIT #1,TYP.STS.FLAG ; 4596
BEQ 2$
JSR PC,U.32 ; 4599
CLR TYP.STS.FLAG ; 4600
2$: MOV #U.82,-(SP) ; 4606
MOV #4,-(SP)
ADD SP,(SP) ; MSG.LENGTH,*
JSR PC,RECEIVE
MOV R0,R1 ; *,STATUS
CMP R1,#264 ; STATUS,* 4611
BNE 3$
MOV #122,(SP)
MOV #124,-(SP)
JSR PC,XFR.STATUS
TST (SP)+
3$: BIT #1,R1 ; *,STATUS 4617
BNE 4$
CMP (SP)+,(SP)+
MOV R1,R0 ; STATUS,*
BR 5$
4$: MOV 4(SP),R0 ; MSG.LENGTH,* 4623
BNE 6$
CMP (SP)+,(SP)+
MOV #312,R0 ; 4625
5$: JMP 18$
6$: ADD R0,RMSG.TOTAL.CHARS ; 4632
CLR U.81 ; 4636
MOVB U.82+3,U.81
CLR R0 ; 4640
BISB U.82+1,R0
SUB U.71,R0
MOV R0,U.80
ADD #16,U.80
CLR U.79 ; 4642
MOVB U.82+2,U.79
SUB #40,U.79
CMP U.71,#61 ; 4651
BEQ 7$
TST U.79
BNE 7$
MOV U.71,R0
SUB #62,R0
NEG R0
CMP U.80,R0
BGE 7$
CMP U.81,#116 ; 4652
BNE 7$
MOV #61,U.71 ; 4654
7$: MOV #U.82,(SP) ; 4659
JSR PC,U.35
MOV #U.82+1,R2 ; *,POINTER 4664
MOV R2,(SP) ; POINTER,* 4665
MOV U.80,-(SP)
ADD #3,(SP)
JSR PC,U.18
MOV U.80,R1 ; 4666
ADD #U.82,R1
MOV R1,R2 ; *,POINTER
ADD #4,R2 ; *,POINTER
MOV U.71,R1 ; 4668
SUB #61,R1
ASL R1
ADD P.AAO(R1),PC ; Case dispatch
9$: CLR R1 ; 4673
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
CMP R0,R1 ; CHKSUM,*
BR 12$
10$: CLR R1 ; 4677
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
MOV R1,R4
MOV R0,R3 ; CHKSUM,*
ASH #-6,R3
BIC #177700,R3
CMP R3,R4
BNE 13$
CLR R1 ; 4678
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
MOV R1,R4 ; 4677
MOV R0,R3 ; CHKSUM,*
BIC #177700,R3
CMP R3,R4
BR 12$
11$: CLR R1 ; 4684
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
MOV R1,R4
MOV R0,R3 ; CHKSUM,*
ASH #-14,R3
BIC #177760,R3
CMP R3,R4
BNE 13$
CLR R1 ; 4685
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
MOV R1,R4 ; 4684
MOV R0,R3 ; CHKSUM,*
ASH #-6,R3
BIC #177700,R3
CMP R3,R4
BNE 13$
CLR R1 ; 4685
BISB (R2)+,R1 ; POINTER,*
SUB #40,R1
MOV R1,R3
MOV R0,R2 ; CHKSUM,*
BIC #177700,R2
CMP R2,R3
12$: BEQ 14$
13$: ADD #6,SP ; 4687
MOV #162,R0
BR 18$
14$: CMP U.81,#116 ; 4696
BNE 15$
INC RMSG.NAKS ; 4699
MOV #122,(SP) ; 4700
MOV #116,-(SP)
BR 16$
15$: INC RMSG.COUNT ; 4704
MOV #122,(SP) ; 4705
MOV #120,-(SP)
16$: JSR PC,XFR.STATUS
CMP U.81,#105 ; 4712
BEQ 17$
ADD #10,SP
MOV #1,R0
BR 18$
17$: CLR (SP) ; 4721
MOV #141,-(SP)
MOV #LAST.ERROR,-(SP)
JSR PC,BL$FIL
MOV #LAST.ERROR,(SP) ; 4722
MOV #140,-(SP)
MOV #1,-(SP)
JSR PC,U.29
JSR PC,U.27 ; 4723
CLR (SP) ; 4724
CLR -(SP)
CLR -(SP)
JSR PC,U.29
MOV #LAST.ERROR,(SP) ; 4732
JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 4733
ADD #24,SP ; 4521
MOV #152,R0 ; 4561
18$: TST (SP)+ ; 4521
RTS PC
; Routine Size: 265 words, Routine Base: $CODE$ + 15516
; Maximum stack depth per invocation: 17 words
.PSECT $PLIT$, RO , D
P.AAO: ; CASE Table for REC.PACKET+0414 4668
8$: .WORD 0 ; [9$]
.WORD 14 ; [10$]
.WORD 70 ; [11$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4736 %SBTTL 'CALC_BLOCK_CHECK'
; 4737 ROUTINE CALC_BLOCK_CHECK (POINTER, LENGTH) =
; 4738
; 4739 !++
; 4740 ! FUNCTIONAL DESCRIPTION:
; 4741 !
; 4742 ! This routine will calculate the proper value for the block check
; 4743 ! for a given message. The value it returns is dependant upon the
; 4744 ! type of block check requested in BLK_CHK_TYPE.
; 4745 !
; 4746 ! CALLING SEQUENCE:
; 4747 !
; 4748 ! CHKSUM = CALC_BLOCK_CHECK (.POINTER, .LENGTH);
; 4749 !
; 4750 ! INPUT PARAMETERS:
; 4751 !
; 4752 ! POINTER - A character pointer to the first character to be
; 4753 ! included in the block check.
; 4754 !
; 4755 ! LENGTH - The number of characters to be included.
; 4756 !
; 4757 ! IMPLICIT INPUTS:
; 4758 !
; 4759 ! BLK_CHK_TYPE - The type of block check to generate.
; 4760 !
; 4761 ! OUPTUT PARAMETERS:
; 4762 !
; 4763 ! The value is the block check.
; 4764 !
; 4765 ! IMPLICIT OUTPUTS:
; 4766 !
; 4767 ! None.
; 4768 !
; 4769 ! COMPLETION CODES:
; 4770 !
; 4771 ! None.
; 4772 !
; 4773 ! SIDE EFFECTS:
; 4774 !
; 4775 ! None.
; 4776 !
; 4777 !--
; 4778
; 4779 BEGIN
; 4780
; 4781 LOCAL
; 4782 BLOCK_CHECK, ! To build initial block check value
; 4783 I; ! Loop counter
; 4784
; 4785 BLOCK_CHECK = 0; ! Start out at 0
; 4786
; 4787 CASE .BLK_CHK_TYPE FROM CHK_1CHAR TO CHK_CRC OF
; 4788 SET
; 4789
; 4790 [CHK_1CHAR, CHK_2CHAR] :
; 4791
; 4792 INCR I FROM 1 TO .LENGTH DO
; 4793 BLOCK_CHECK = .BLOCK_CHECK + CH$RCHAR_A (POINTER);
; 4794
; 4795 [CHK_CRC] :
; 4796 BLOCK_CHECK = CRCCLC (.POINTER, .LENGTH);
; 4797 TES;
; 4798
; 4799 IF .BLK_CHK_TYPE EQL CHK_1CHAR
; 4800 THEN
; 4801 BLOCK_CHECK = (.BLOCK_CHECK + ((.BLOCK_CHECK AND %O'300')/%O'100')) AND %O'77';
; 4802
; 4803 RETURN .BLOCK_CHECK; ! Return the correct value
; 4804 END; ! End of CALC_BLOCK_CHK
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL CALC.BLOCK.CHECK CALC_BLOCK_CHECK
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; CALC.BLOCK.CHECK
U.18: JSR R1,$SAVE3 ; 4737
CLR R2 ; BLOCK.CHECK 4785
MOV U.71,R0 ; 4787
SUB #61,R0
ASL R0
ADD P.AAP(R0),PC ; Case dispatch
2$: CLR R1 ; I 4792
BR 4$
3$: INC 14(SP) ; POINTER 4793
MOV 14(SP),R0 ; POINTER,*
CLR R3
BISB -1(R0),R3
ADD R3,R2 ; *,BLOCK.CHECK
4$: INC R1 ; I 4792
CMP R1,12(SP) ; I,LENGTH
BLE 3$
BR 6$ ; 4787
5$: MOV 14(SP),-(SP) ; POINTER,* 4796
MOV 14(SP),-(SP) ; LENGTH,*
JSR PC,CRCCLC
MOV R0,R2 ; *,BLOCK.CHECK
CMP (SP)+,(SP)+
6$: CMP U.71,#61 ; 4799
BNE 7$
MOV R2,R0 ; BLOCK.CHECK,* 4801
BIC #177477,R0
MOV R0,R1
SXT R0
DIV #100,R0
ADD R2,R0 ; BLOCK.CHECK,*
MOV R0,R2 ; *,BLOCK.CHECK
BIC #177700,R2 ; *,BLOCK.CHECK
7$: MOV R2,R0 ; BLOCK.CHECK,* 4779
RTS PC ; 4737
; Routine Size: 50 words, Routine Base: $CODE$ + 16540
; Maximum stack depth per invocation: 7 words
.PSECT $PLIT$, RO , D
P.AAP: ; CASE Table for CALC.BLOCK.CHEC+0020 4787
1$: .WORD 0 ; [2$]
.WORD 0 ; [2$]
.WORD 36 ; [5$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4805 %SBTTL 'NORMALIZE_FILE - Put file name into normal form'
; 4806 ROUTINE NORMALIZE_FILE (FILE_ADDRESS, FILE_LENGTH, NAME_LENGTH, TYPE_LENGTH) : NOVALUE =
; 4807
; 4808 !++
; 4809 ! FUNCTIONAL DESCRIPTION:
; 4810 !
; 4811 ! This routine will ensure that a file specification is in normal
; 4812 ! form. It does this by replacing all non-alphanumeric characters
; 4813 ! (except the first period) with "X". It will also ensure that
; 4814 ! the resulting specification (of form name.type) has only
; 4815 ! a specified number of characters in the name portion and type portion.
; 4816 !
; 4817 ! CALLING SEQUENCE:
; 4818 !
; 4819 ! NORMALIZE_FILE (FILE_ADDRESS, FILE_LENGTH, NAME_LENGTH, TYPE_LENGTH);
; 4820 !
; 4821 ! INPUT PARAMETERS:
; 4822 !
; 4823 ! FILE_ADDRESS - Address of file specification string to be normalized
; 4824 !
; 4825 ! FILE_LENGTH - Length of file specification
; 4826 !
; 4827 ! NAME_LENGTH - Maximum length desired for "name" portion.
; 4828 !
; 4829 ! TYPE_LENGTH - Maximum length desired for "type" portion.
; 4830 !
; 4831 ! With both NAME_LENGTH and TYPE_LENGTH, a negative value indicates
; 4832 ! unlimited lenght.
; 4833 !
; 4834 ! IMPLICIT INPUTS:
; 4835 !
; 4836 ! None.
; 4837 !
; 4838 ! OUPTUT PARAMETERS:
; 4839 !
; 4840 ! FILE_LENGTH - The length of the resulting file spec
; 4841 !
; 4842 ! NAME_LENGTH - The actual length of the resulting file name
; 4843 !
; 4844 ! TYPE_LENGTH - The actual length of the resulting file type
; 4845 !
; 4846 ! IMPLICIT OUTPUTS:
; 4847 !
; 4848 ! None.
; 4849 !
; 4850 ! COMPLETION CODES:
; 4851 !
; 4852 ! None.
; 4853 !
; 4854 ! SIDE EFFECTS:
; 4855 !
; 4856 ! None.
; 4857 !
; 4858 !--
; 4859
; 4860 BEGIN
; 4861
; 4862 LOCAL
; 4863 CH, ! Character being processed
; 4864 POINTER, ! Pointer to file spec
; 4865 WRT_POINTER, ! Pointer to write file spec
; 4866 WRT_SIZE,
; 4867 FIRST_PERIOD, ! Flag we have seen a period
; 4868 IGNORE_BAD, ! Flag we should ignore bad characters
; 4869 BAD_CHAR, ! Flag this character was bad
; 4870 FILE_CTR, ! Counter for overall length
; 4871 NAME_CTR, ! Counter for name characters
; 4872 TYPE_CTR; ! Counter for type characters
; 4873
; 4874 FILE_CTR = 0;
; 4875 NAME_CTR = 0;
; 4876 TYPE_CTR = 0;
; 4877 WRT_SIZE = 0;
; 4878 FIRST_PERIOD = FALSE; ! No periods yet
; 4879 POINTER = CH$PTR (.FILE_ADDRESS); ! Set up pointer to file name
; 4880 WRT_POINTER = .POINTER;
; 4881
; 4882 IF .NAME_LENGTH EQL 0 THEN FIRST_PERIOD = TRUE; ! Pretend we did name already
; 4883
; 4884 IGNORE_BAD = FALSE;
; 4885
; 4886 IF .NAME_LENGTH GTR 0
; 4887 THEN
; 4888 BEGIN
; 4889
; 4890 DECR I FROM ..FILE_LENGTH TO 0 DO
; 4891
; 4892 IF CH$RCHAR_A (POINTER) EQL %C'.'
; 4893 THEN
; 4894 BEGIN
; 4895 IGNORE_BAD = TRUE;
; 4896 EXITLOOP;
; 4897 END;
; 4898
; 4899 END;
; 4900
; 4901 POINTER = .WRT_POINTER;
; 4902
; 4903 WHILE .FILE_CTR LSS ..FILE_LENGTH DO
; 4904 BEGIN
; 4905 CH = CH$RCHAR_A (POINTER); ! Get a character
; 4906 FILE_CTR = .FILE_CTR + 1;
; 4907
; 4908 IF (.CH LSS %C'0' AND (.CH NEQ %C'.' OR .FIRST_PERIOD)) OR .CH GTR %C'z' OR (.CH GTR %C'9'
; 4909 AND .CH LSS %C'A') OR (.CH GTR %C'Z' AND .CH LSS %C'a')
; 4910 THEN
; 4911 BEGIN
; 4912 BAD_CHAR = TRUE;
; 4913 CH = %C'X';
; 4914 END
; 4915 ELSE
; 4916 BEGIN
; 4917 BAD_CHAR = FALSE;
; 4918
; 4919 IF .CH GEQ %C'a' THEN CH = .CH - (%C'a' - %C'A');
; 4920
; 4921 END;
; 4922
; 4923 IF .CH EQL %C'.'
; 4924 THEN
; 4925 BEGIN
; 4926 FIRST_PERIOD = TRUE;
; 4927 CH$WCHAR_A (.CH, WRT_POINTER);
; 4928 WRT_SIZE = .WRT_SIZE + 1;
; 4929 END
; 4930 ELSE
; 4931
; 4932 IF NOT .BAD_CHAR OR NOT .IGNORE_BAD
; 4933 THEN
; 4934
; 4935 IF NOT .FIRST_PERIOD
; 4936 THEN
; 4937 BEGIN
; 4938
; 4939 IF .NAME_LENGTH LSS 0 OR .NAME_CTR LSS .NAME_LENGTH
; 4940 THEN
; 4941 BEGIN
; 4942 NAME_CTR = .NAME_CTR + 1;
; 4943 WRT_SIZE = .WRT_SIZE + 1;
; 4944 CH$WCHAR_A (.CH, WRT_POINTER);
; 4945 END;
; 4946
; 4947 END
; 4948 ELSE
; 4949
; 4950 IF .TYPE_LENGTH LSS 0 OR .TYPE_CTR LSS .TYPE_LENGTH
; 4951 THEN
; 4952 BEGIN
; 4953 TYPE_CTR = .TYPE_CTR + 1;
; 4954 WRT_SIZE = .WRT_SIZE + 1;
; 4955 CH$WCHAR_A (.CH, WRT_POINTER);
; 4956 END;
; 4957
; 4958 END;
; 4959
; 4960 .FILE_LENGTH = .WRT_SIZE;
; 4961 CH$WCHAR_A (CHR_NUL, WRT_POINTER);
; 4962 END; ! End of NORMALIZE_FILE
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL NORMALIZE.FILE NORMALIZE_FILE - Put file name into normal form
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; NORMALIZE.FILE
U.26: JSR R1,$SAVE5 ; 4806
CMP -(SP),-(SP)
CLR -(SP) ; FILE.CTR 4874
CLR -(SP) ; NAME.CTR 4875
CLR -(SP) ; TYPE.CTR 4876
CLR R3 ; WRT.SIZE 4877
CLR R4 ; FIRST.PERIOD 4878
MOV 36(SP),R2 ; FILE.ADDRESS,POINTER 4879
MOV R2,-(SP) ; POINTER,WRT.POINTER 4880
MOV 34(SP),R5 ; NAME.LENGTH,* 4882
BNE 1$
MOV #1,R4 ; *,FIRST.PERIOD
1$: CLR 10(SP) ; IGNORE.BAD 4884
TST R5 ; 4886
BLE 4$
MOV @36(SP),R0 ; FILE.LENGTH,I 4890
BLT 4$
2$: CMPB (R2)+,#56 ; POINTER,* 4892
BNE 3$
MOV #1,10(SP) ; *,IGNORE.BAD 4895
BR 4$ ; 4894
3$: DEC R0 ; I 4890
BGE 2$
4$: MOV (SP),R2 ; WRT.POINTER,POINTER 4901
5$: CMP 6(SP),@36(SP) ; FILE.CTR,FILE.LENGTH 4903
BGE 17$
CLR R1 ; CH 4905
BISB (R2)+,R1 ; POINTER,CH
INC 6(SP) ; FILE.CTR 4906
CMP R1,#60 ; CH,* 4908
BGE 6$
CMP R1,#56 ; CH,*
BNE 8$
BIT #1,R4 ; *,FIRST.PERIOD
BNE 8$
6$: CMP R1,#172 ; CH,*
BGT 8$
CMP R1,#71 ; CH,*
BLE 7$
CMP R1,#101 ; CH,* 4909
BLT 8$
7$: CMP R1,#132 ; CH,*
BLE 9$
CMP R1,#141 ; CH,*
BGE 9$
8$: MOV #1,12(SP) ; *,BAD.CHAR 4912
MOV #130,R1 ; *,CH 4913
BR 10$ ; 4908
9$: CLR 12(SP) ; BAD.CHAR 4917
CMP R1,#141 ; CH,* 4919
BLT 10$
SUB #40,R1 ; *,CH
10$: CMP R1,#56 ; CH,* 4923
BNE 11$
MOV #1,R4 ; *,FIRST.PERIOD 4926
MOVB R1,@0(SP) ; CH,WRT.POINTER 4927
ADD R4,(SP) ; *,WRT.POINTER
ADD R4,R3 ; *,WRT.SIZE 4928
BR 5$ ; 4923
11$: BIT #1,12(SP) ; *,BAD.CHAR 4932
BEQ 12$
BIT #1,10(SP) ; *,IGNORE.BAD
BNE 5$
12$: BIT #1,R4 ; *,FIRST.PERIOD 4935
BNE 14$
TST R5 ; 4939
BLT 13$
CMP 4(SP),R5 ; NAME.CTR,*
BGE 5$
13$: INC 4(SP) ; NAME.CTR 4942
BR 16$ ; 4943
14$: MOV 32(SP),R0 ; TYPE.LENGTH,* 4950
BLT 15$
CMP 2(SP),R0 ; TYPE.CTR,*
BGE 5$
15$: INC 2(SP) ; TYPE.CTR 4953
16$: INC R3 ; WRT.SIZE 4954
MOVB R1,@0(SP) ; CH,WRT.POINTER 4955
INC (SP) ; WRT.POINTER
BR 5$ ; 4932
17$: MOV R3,@36(SP) ; WRT.SIZE,FILE.LENGTH 4960
CLRB @0(SP) ; WRT.POINTER 4961
INC (SP)+ ; WRT.POINTER
ADD #12,SP ; 4806
RTS PC
; Routine Size: 128 words, Routine Base: $CODE$ + 16704
; Maximum stack depth per invocation: 13 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 4963 %SBTTL 'Buffer filling -- Main routine'
; 4964 ROUTINE BFR_FILL (FIRST_FLAG) =
; 4965
; 4966 !++
; 4967 ! FUNCTIONAL DESCRIPTION:
; 4968 !
; 4969 ! This routine will fill the buffer with data from the file. It
; 4970 ! will do all the quoting that is required.
; 4971 !
; 4972 ! CALLING SEQUENCE:
; 4973 !
; 4974 ! EOF_FLAG = BFR_FILL(.FIRST_FLAG);
; 4975 !
; 4976 ! INPUT PARAMETERS:
; 4977 !
; 4978 ! FIRST_FLAG - Flag whether first call for this file
; 4979 !
; 4980 ! IMPLICIT INPUTS:
; 4981 !
; 4982 ! None.
; 4983 !
; 4984 ! OUTPUT PARAMETERS:
; 4985 !
; 4986 ! True - Buffer filled may be at end of file.
; 4987 ! False - At end of file.
; 4988 !
; 4989 ! IMPLICIT OUTPUTS:
; 4990 !
; 4991 ! Number of characters stored in the buffer.
; 4992 !
; 4993 ! COMPLETION CODES:
; 4994 !
; 4995 ! None.
; 4996 !
; 4997 ! SIDE EFFECTS:
; 4998 !
; 4999 ! None.
; 5000 !
; 5001 !--
; 5002
; 5003 BEGIN
; 5004
; 5005 LITERAL
; 5006 NO_CHAR = -1, ! No character next
; 5007 EOF_CHAR = -2; ! EOF seen
; 5008
; 5009 LOCAL
; 5010 I, ! Temp loop index
; 5011 MAX_SIZE, ! Maximum size of data
; 5012 POINTER; ! Pointer into the message buffer
; 5013
; 5014 OWN
; 5015 NEXT_CHR, ! Saved character
; 5016 STATUS, ! Status value
; 5017 REPEAT_COUNT, ! Number of times character repeated
; 5018 CHAR_8_BIT, ! 8 bit character from file
; 5019 CHRS : VECTOR [5], ! String needed to represent character
; 5020 CHR_IDX, ! Index into CHRS
; 5021 OLD_CHAR_8_BIT, ! Previous 8-bit character
; 5022 OLD_CHRS : VECTOR [5], ! String for previous character
; 5023 OLD_CHR_IDX; ! Index for previous character
; 5024
; 5025 ROUTINE GET_QUOTED_CHAR =
; 5026 !
; 5027 ! This routine gets a character from the file and returns both
; 5028 ! the character and the string needed to represent the character
; 5029 ! if it needs quoting.
; 5030 !
; 5031 BEGIN
; 5032
; 5033 IF .NEXT_CHR GEQ 0
; 5034 THEN
; 5035 BEGIN
; 5036 CHAR_8_BIT = .NEXT_CHR;
; 5037 NEXT_CHR = NO_CHAR;
; 5038 STATUS = KER_NORMAL;
; 5039 END
; 5040 ELSE
; 5041
; 5042 IF .NEXT_CHR EQL NO_CHAR
; 5043 THEN
; 5044 STATUS = (.GET_CHR_ROUTINE) (CHAR_8_BIT)
; 5045 ELSE
; 5046 STATUS = KER_EOF;
; 5047
; 5048 IF .STATUS EQL KER_NORMAL
; 5049 THEN
; 5050 BEGIN
; 5051 !
; 5052 ! Determine if we should just quote the character
; 5053 ! Either:
; 5054 ! Character is a delete (177 octal)
; 5055 ! or Character is a control character (less than 40 octal)
; 5056 ! or Character is a quote character
; 5057 ! or Character is the repeat character and doing repeat compression
; 5058 ! or Character is an eight bit quote character and doing eight bit
; 5059 ! quoting.
; 5060 !
; 5061
; 5062 IF ((.CHAR_8_BIT AND %O'177') LSS %C' ') OR ((.CHAR_8_BIT AND %O'177') EQL CHR_DEL) OR (
; 5063 (.CHAR_8_BIT AND %O'177') EQL .RCV_QUOTE_CHR) OR (.FLAG_REPEAT AND ((.CHAR_8_BIT
; 5064 AND %O'177') EQL .REPT_CHR)) OR (.FLAG_8QUOTE AND ((.CHAR_8_BIT AND %O'177') EQL
; 5065 .SEND_8QUOTE_CHR))
; 5066 THEN
; 5067 BEGIN
; 5068 !
; 5069 ! If the character is a control character or delete we must do a CTL(Character)
; 5070 ! so it is something that we can be sure we can send.
; 5071 !
; 5072
; 5073 IF ((.CHAR_8_BIT AND %O'177') LSS %C' ') OR ((.CHAR_8_BIT AND %O'177') EQL CHR_DEL)
; 5074 THEN
; 5075 CHRS [0] = CTL (.CHAR_8_BIT)
; 5076 ELSE
; 5077 CHRS [0] = .CHAR_8_BIT;
; 5078
; 5079 CHR_IDX = 1;
; 5080 CHRS [1] = .RCV_QUOTE_CHR; ![035] Use character we said we would send
; 5081 END
; 5082 ELSE
; 5083 BEGIN
; 5084 CHR_IDX = 0;
; 5085 CHRS [0] = .CHAR_8_BIT;
; 5086 END;
; 5087
; 5088 END;
; 5089
; 5090 RETURN .STATUS;
; 5091 END;
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $OWN$, D
; NEXT.CHR
U.106: .BLKW 1
; STATUS
U.107: .BLKW 1
; REPEAT.COUNT
U.108: .BLKW 1
; CHAR.8.BIT
U.109: .BLKW 1
; CHRS
U.110: .BLKW 5
; CHR.IDX
U.111: .BLKW 1
; OLD.CHAR.8.BIT
U.112: .BLKW 1
; OLD.CHRS
U.113: .BLKW 5
; OLD.CHR.IDX
U.114: .BLKW 1
.SBTTL GET.QUOTED.CHAR Buffer filling -- Main routine
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; GET.QUOTED.CHAR
U.115: JSR R1,$SAVE3 ; 5025
MOV U.106,R0 ; 5033
BLT 1$
MOV R0,U.109 ; 5036
MOV #-1,U.106 ; 5037
MOV #1,U.107 ; 5038
BR 3$ ; 5033
1$: INC R0 ; 5042
BNE 2$
MOV #U.109,-(SP) ; 5044
JSR PC,@U.91
MOV R0,U.107
TST (SP)+
BR 3$ ; 5042
2$: MOV #101,U.107 ; 5046
3$: CMP U.107,#1 ; 5048
BNE 11$
MOV U.109,R0 ; 5062
CLR R1
MOV R0,R2
BIC #177600,R2
CMP R2,#40
BHIS 4$
INC R1
BR 6$
4$: MOV #177,R2
BIC R0,R2
BEQ 6$
MOV RCV.QUOTE.CHR,R3
MOV R0,R2
BIC #177600,R2
CMP R2,R3
BEQ 6$
BIT #1,U.73 ; 5063
BEQ 5$
MOV U.63,R3
MOV R0,R2
BIC #177600,R2
CMP R2,R3
BEQ 6$
5$: BIT #1,U.72 ; 5064
BEQ 10$
MOV U.69,R3
MOV R0,R2
BIC #177600,R2
CMP R2,R3
BNE 10$
6$: ROR R1 ; 5073
BLO 7$
MOV #177,R1
BIC R0,R1
BNE 8$
7$: MOV #100,U.110 ; 5075
XOR R0,U.110
BR 9$ ; 5073
8$: MOV R0,U.110 ; 5077
9$: MOV #1,U.111 ; 5079
MOV RCV.QUOTE.CHR,U.110+2 ; 5080
BR 11$ ; 5062
10$: CLR U.111 ; 5084
MOV R0,U.110 ; 5085
11$: MOV U.107,R0 ; 5031
RTS PC ; 5025
; Routine Size: 103 words, Routine Base: $CODE$ + 17304
; Maximum stack depth per invocation: 6 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5092 ROUTINE GET_8_QUOTED_CHAR =
; 5093 !
; 5094 ! This routine will get the quoted representation of a character
; 5095 ! (by calling GET_QUOTED_CHAR), and return the 8th-bit quoted
; 5096 ! representation.
; 5097 !
; 5098 BEGIN
; 5099
; 5100 IF (STATUS = GET_QUOTED_CHAR ()) EQL KER_NORMAL
; 5101 THEN
; 5102 BEGIN
; 5103 !
; 5104 ! Determine if we must quote the eighth bit (parity bit on)
; 5105 !
; 5106
; 5107 IF (((.CHRS [0] AND %O'177') NEQ .CHRS [0]) AND .FLAG_8QUOTE)
; 5108 THEN
; 5109 BEGIN
; 5110 CHRS [0] = .CHRS [0] AND %O'177';
; 5111 CHR_IDX = .CHR_IDX + 1;
; 5112 CHRS [.CHR_IDX] = .SEND_8QUOTE_CHR;
; 5113 END;
; 5114
; 5115 END;
; 5116
; 5117 RETURN .STATUS;
; 5118 END;
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL GET.8.QUOTED.CHAR Buffer filling -- Main routine
.NLIST
.ENABL LSB
.LIST
; GET.8.QUOTED.CHAR
U.116: MOV R1,-(SP) ; 5092
JSR PC,U.115 ; 5100
MOV R0,U.107
CMP R0,#1
BNE 1$
MOV U.110,R1 ; 5107
MOV R1,R0 ; CHRS,*
BIC #177600,R0
CMP R0,R1
BEQ 1$
BIT #1,U.72
BEQ 1$
BIC #177600,U.110 ; 5110
INC U.111 ; 5111
MOV U.111,R0 ; 5112
ASL R0
MOV U.69,U.110(R0)
1$: MOV U.107,R0 ; 5098
MOV (SP)+,R1 ; 5092
RTS PC
; Routine Size: 34 words, Routine Base: $CODE$ + 17622
; Maximum stack depth per invocation: 2 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5119 !
; 5120 ! Start of code for BFR_FILL
; 5121 !
; 5122 ! Initialize pointer and count
; 5123 !
; 5124 SIZE = 0;
; 5125 POINTER = CH$PTR (SND_MSG, PKT_MSG, CHR_SIZE);
; 5126 MAX_SIZE = .SEND_PKT_SIZE - PKT_OVR_HEAD - (.BLK_CHK_TYPE - CHK_1CHAR);
; 5127 !
; 5128 ! If last call got an error or eof, return it now
; 5129 !
; 5130
; 5131 IF NOT .FIRST_FLAG AND (.STATUS NEQ KER_NORMAL) THEN RETURN .STATUS;
; 5132
; 5133 !
; 5134 ! If first time for a file prime the pump with the first character.
; 5135 !
; 5136
; 5137 IF .FIRST_FLAG
; 5138 THEN
; 5139 BEGIN
; 5140 FIRST_FLAG = FALSE;
; 5141 NEXT_CHR = -1; ! No backed up character
; 5142
; 5143 IF .FLAG_8QUOTE THEN STATUS = GET_8_QUOTED_CHAR () ELSE STATUS = GET_QUOTED_CHAR ();
; 5144
; 5145 IF .STATUS NEQ KER_NORMAL THEN RETURN .STATUS;
; 5146
; 5147 OLD_CHAR_8_BIT = .CHAR_8_BIT;
; 5148
; 5149 INCR OLD_CHR_IDX FROM 0 TO .CHR_IDX DO
; 5150 OLD_CHRS [.OLD_CHR_IDX] = .CHRS [.OLD_CHR_IDX];
; 5151
; 5152 OLD_CHR_IDX = .CHR_IDX;
; 5153 REPEAT_COUNT = 0; ! Character was not repeated yet
; 5154 ! Will always be incremented
; 5155 END;
; 5156
; 5157 !
; 5158 ! Otherwise, loop until we fill buffer
; 5159 !
; 5160
; 5161 WHILE .SIZE LSS .MAX_SIZE DO ! Normal exit is via an EXITLOOP
; 5162 BEGIN
; 5163 !
; 5164 ! Check if we are doing run compression
; 5165 !
; 5166
; 5167 IF .FLAG_REPEAT
; 5168 THEN
; 5169 BEGIN
; 5170 !
; 5171 ! Here with previous character in OLD_xxx. As long as we
; 5172 ! are getting the same character, just count the run.
; 5173 !
; 5174
; 5175 WHILE (.CHAR_8_BIT EQL .OLD_CHAR_8_BIT) AND (.REPEAT_COUNT LSS 94) DO
; 5176 BEGIN
; 5177 REPEAT_COUNT = .REPEAT_COUNT + 1;
; 5178
; 5179 IF .FLAG_8QUOTE THEN STATUS = GET_8_QUOTED_CHAR () ELSE STATUS = GET_QUOTED_CHAR ();
; 5180
; 5181 IF .STATUS NEQ KER_NORMAL
; 5182 THEN
; 5183
; 5184 IF .STATUS NEQ KER_EOF
; 5185 THEN
; 5186 CHAR_8_BIT = NO_CHAR
; 5187 ELSE
; 5188 BEGIN
; 5189 CHAR_8_BIT = EOF_CHAR;
; 5190 CHR_IDX = -1;
; 5191 END;
; 5192
; 5193 END;
; 5194
; 5195 IF .OLD_CHR_IDX + 1 + 2 LSS ((.OLD_CHR_IDX + 1)*.REPEAT_COUNT)
; 5196 THEN
; 5197 BEGIN
; 5198
; 5199 IF .SIZE + .OLD_CHR_IDX + 1 + 2 GTR .MAX_SIZE
; 5200 THEN
; 5201 BEGIN
; 5202
; 5203 IF .CHAR_8_BIT EQL .OLD_CHAR_8_BIT
; 5204 THEN
; 5205 BEGIN
; 5206 NEXT_CHR = .CHAR_8_BIT;
; 5207 REPEAT_COUNT = .REPEAT_COUNT - 1;
; 5208 END;
; 5209
; 5210 IF .CHAR_8_BIT EQL EOF_CHAR
; 5211 THEN
; 5212 BEGIN
; 5213 NEXT_CHR = EOF_CHAR; ! Remember EOF for next time
; 5214 STATUS = KER_NORMAL; ! And give good return now
; 5215 END;
; 5216
; 5217 EXITLOOP;
; 5218 END;
; 5219
; 5220 OLD_CHRS [.OLD_CHR_IDX + 1] = CHAR (.REPEAT_COUNT);
; 5221 OLD_CHRS [.OLD_CHR_IDX + 2] = .REPT_CHR;
; 5222 OLD_CHR_IDX = .OLD_CHR_IDX + 2;
; 5223 !
; 5224 ! Count the number of file characters this represents
; 5225 !
; 5226 SMSG_DATA_CHARS = .SMSG_DATA_CHARS + .REPEAT_COUNT - 1;
; 5227 FILE_CHARS = .FILE_CHARS + .REPEAT_COUNT - 1;
; 5228 REPEAT_COUNT = 1; ! Only one time for this string
; 5229 END;
; 5230
; 5231 !
; 5232 ! If we don't have enough room for this character, wait till next
; 5233 ! time.
; 5234 !
; 5235
; 5236 IF .SIZE + (.OLD_CHR_IDX + 1)*.REPEAT_COUNT GTR .MAX_SIZE
; 5237 THEN
; 5238 BEGIN
; 5239 ! If the next character is the same, the count will get incremented
; 5240 ! next time we enter, so back it off now.
; 5241
; 5242 IF .CHAR_8_BIT EQL .OLD_CHAR_8_BIT
; 5243 THEN
; 5244 BEGIN
; 5245 NEXT_CHR = .CHAR_8_BIT;
; 5246 REPEAT_COUNT = .REPEAT_COUNT - 1;
; 5247 END;
; 5248
; 5249 EXITLOOP;
; 5250 END;
; 5251
; 5252 SMSG_DATA_CHARS = .SMSG_DATA_CHARS + .REPEAT_COUNT;
; 5253 FILE_CHARS = .FILE_CHARS + .REPEAT_COUNT;
; 5254
; 5255 DECR REPEAT_COUNT FROM .REPEAT_COUNT TO 1 DO
; 5256
; 5257 DECR I FROM .OLD_CHR_IDX TO 0 DO
; 5258 BEGIN
; 5259 CH$WCHAR_A (.OLD_CHRS [.I], POINTER);
; 5260 SIZE = .SIZE + 1;
; 5261 END;
; 5262
; 5263 !
; 5264 ! If we got an error (or EOF) then exit
; 5265 !
; 5266
; 5267 IF (.STATUS NEQ KER_NORMAL) THEN EXITLOOP;
; 5268
; 5269 !
; 5270 ! Otherwise, copy the character which broke the run
; 5271 !
; 5272 OLD_CHAR_8_BIT = .CHAR_8_BIT;
; 5273
; 5274 INCR OLD_CHR_IDX FROM 0 TO .CHR_IDX DO
; 5275 OLD_CHRS [.OLD_CHR_IDX] = .CHRS [.OLD_CHR_IDX];
; 5276
; 5277 OLD_CHR_IDX = .CHR_IDX;
; 5278 REPEAT_COUNT = 0;
; 5279 END
; 5280 ELSE
; 5281 !
; 5282 ! Here if we are not doing run compression. We can do things much
; 5283 ! easier.
; 5284 !
; 5285 BEGIN
; 5286
; 5287 IF (.SIZE + .CHR_IDX + 1) GTR .MAX_SIZE THEN EXITLOOP;
; 5288
; 5289 SMSG_DATA_CHARS = .SMSG_DATA_CHARS + 1;
; 5290 FILE_CHARS = .FILE_CHARS + 1;
; 5291
; 5292 DECR CHR_IDX FROM .CHR_IDX TO 0 DO
; 5293 BEGIN
; 5294 CH$WCHAR_A (.CHRS [.CHR_IDX], POINTER);
; 5295 SIZE = .SIZE + 1;
; 5296 END;
; 5297
; 5298 IF .FLAG_8QUOTE THEN STATUS = GET_8_QUOTED_CHAR () ELSE STATUS = GET_QUOTED_CHAR ();
; 5299
; 5300 IF (.STATUS NEQ KER_NORMAL) THEN EXITLOOP;
; 5301
; 5302 END;
; 5303
; 5304 END;
; 5305
; 5306 !
; 5307 ! Determine if we really stored anything into the buffer.
; 5308 !
; 5309
; 5310 IF .SIZE NEQ 0 THEN RETURN KER_NORMAL ELSE RETURN .STATUS;
; 5311
; 5312 END; ! End of BFR_FILL
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL BFR.FILL Buffer filling -- Main routine
.NLIST
.ENABL LSB
.LIST
; BFR.FILL
U.28: JSR R1,$SAVE5 ; 4964
CLR U.75 ; 5124
MOV #U.83+4,R5 ; *,POINTER 5125
MOV U.64,R0 ; 5126
SUB U.71,R0
MOV R0,R4 ; *,MAX.SIZE
ADD #56,R4 ; *,MAX.SIZE
BIT #1,16(SP) ; *,FIRST.FLAG 5131
BNE 1$
CMP U.107,#1
BNE 4$
BIT #1,16(SP) ; *,FIRST.FLAG 5137
BEQ 9$
1$: CLR 16(SP) ; FIRST.FLAG 5140
MOV #-1,U.106 ; 5141
BIT #1,U.72 ; 5143
BEQ 2$
JSR PC,U.116
BR 3$
2$: JSR PC,U.115
3$: MOV R0,U.107
CMP R0,#1 ; STATUS,* 5145
4$: BEQ 5$
JMP 34$
5$: MOV U.109,U.112 ; 5147
CLR R1 ; OLD.CHR.IDX 5149
BR 7$
6$: MOV R1,R0 ; OLD.CHR.IDX,* 5150
ASL R0
MOV U.110(R0),U.113(R0)
INC R1 ; OLD.CHR.IDX 5149
7$: CMP R1,U.111 ; OLD.CHR.IDX,*
BLE 6$
8$: MOV U.111,U.114 ; 5152
CLR U.108 ; 5153
9$: CMP U.75,R4 ; *,MAX.SIZE 5161
BGE 16$
BIT #1,U.73 ; 5167
BNE 10$
JMP 28$
10$: CMP U.109,U.112 ; 5175
BNE 14$
CMP U.108,#136
BGE 14$
INC U.108 ; 5177
BIT #1,U.72 ; 5179
BEQ 11$
JSR PC,U.116
BR 12$
11$: JSR PC,U.115
12$: MOV R0,U.107
CMP R0,#1 ; STATUS,* 5181
BEQ 10$
CMP R0,#101 ; STATUS,* 5184
BEQ 13$
MOV #-1,U.109 ; 5186
BR 10$ ; 5184
13$: MOV #-2,U.109 ; 5189
MOV #-1,U.111 ; 5190
BR 10$ ; 5181
14$: MOV U.114,R2 ; 5195
MOV R2,R0
ADD #3,R0
MOV R2,R3
INC R3
MOV R3,R1
MUL U.108,R1
CMP R0,R1
BGE 18$
MOV R2,R0 ; 5199
ADD U.75,R0
ADD #3,R0
CMP R0,R4 ; *,MAX.SIZE
BLE 17$
MOV U.109,R0 ; 5203
CMP R0,U.112
BNE 15$
MOV R0,U.106 ; 5206
DEC U.108 ; 5207
15$: CMP R0,#-2 ; 5210
BNE 25$
MOV #-2,U.106 ; 5213
MOV #1,U.107 ; 5214
16$: BR 19$ ; 5201
17$: MOV R3,R1 ; 5220
ASL R1
MOV U.108,R0
MOV R0,U.113(R1)
ADD #40,U.113(R1)
MOV R2,R1 ; 5221
ASL R1
MOV U.63,U.113+4(R1)
ADD #2,U.114 ; 5222
MOV R0,R1 ; 5226
ADD SMSG.DATA.CHARS,R1
MOV R1,SMSG.DATA.CHARS
DEC SMSG.DATA.CHARS
MOV R0,R1 ; 5227
ADD U.85,R1
MOV R1,U.85
DEC U.85
MOV #1,U.108 ; 5228
18$: MOV U.114,R1 ; 5236
INC R1
MUL U.108,R1
ADD U.75,R1
CMP R1,R4 ; *,MAX.SIZE
BLE 20$
CMP U.109,U.112 ; 5242
BNE 33$
MOV U.109,U.106 ; 5245
DEC U.108 ; 5246
19$: BR 33$ ; 5238
20$: MOV U.108,R0 ; 5252
ADD R0,SMSG.DATA.CHARS
ADD R0,U.85 ; 5253
TST R0 ; REPEAT.COUNT 5255
BLE 24$
21$: MOV U.114,R1 ; *,I 5257
BLT 23$
22$: MOV R1,R2 ; I,* 5259
ASL R2
MOVB U.113(R2),(R5)+ ; *,POINTER
INC U.75 ; 5260
DEC R1 ; I 5257
BGE 22$
23$: SOB R0,21$ ; REPEAT.COUNT,* 5255
24$: CMP U.107,#1 ; 5267
25$: BNE 33$
MOV U.109,U.112 ; 5272
CLR R1 ; OLD.CHR.IDX 5274
BR 27$
26$: MOV R1,R0 ; OLD.CHR.IDX,* 5275
ASL R0
MOV U.110(R0),U.113(R0)
INC R1 ; OLD.CHR.IDX 5274
27$: CMP R1,U.111 ; OLD.CHR.IDX,*
BLE 26$
JMP 8$ ; 5277
28$: MOV U.75,R0 ; 5287
ADD U.111,R0
INC R0
CMP R0,R4 ; *,MAX.SIZE
BGT 33$
INC SMSG.DATA.CHARS ; 5289
INC U.85 ; 5290
MOV U.111,R1 ; *,CHR.IDX 5292
BLT 30$
29$: MOV R1,R0 ; CHR.IDX,* 5294
ASL R0
MOVB U.110(R0),(R5)+ ; *,POINTER
INC U.75 ; 5295
DEC R1 ; CHR.IDX 5292
BGE 29$
30$: BIT #1,U.72 ; 5298
BEQ 31$
JSR PC,U.116
BR 32$
31$: JSR PC,U.115
32$: MOV R0,U.107
CMP R0,#1 ; STATUS,* 5300
BNE 33$
JMP 9$
33$: TST U.75 ; 5310
BEQ 34$
MOV #1,R0 ; 5003
RTS PC
34$: MOV U.107,R0
RTS PC ; 4964
; Routine Size: 290 words, Routine Base: $CODE$ + 17726
; Maximum stack depth per invocation: 7 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5313 %SBTTL 'BFR_EMPTY'
; 5314 ROUTINE BFR_EMPTY =
; 5315
; 5316 !++
; 5317 ! FUNCTIONAL DESCRIPTION:
; 5318 !
; 5319 ! This routine will empty the data from the REC_MSG message buffer
; 5320 ! to the file. It will process quoting characters.
; 5321 !
; 5322 ! CALLING SEQUENCE:
; 5323 !
; 5324 ! Flag = BFR_EMPTY();
; 5325 !
; 5326 ! INPUT PARAMETERS:
; 5327 !
; 5328 ! None.
; 5329 !
; 5330 ! IMPLICIT INPUTS:
; 5331 !
; 5332 ! None.
; 5333 !
; 5334 ! OUTPUT PARAMETERS:
; 5335 !
; 5336 ! True - No problems writing the file.
; 5337 ! False - I/O error writing the file.
; 5338 !
; 5339 ! IMPLICIT OUTPUTS:
; 5340 !
; 5341 ! None.
; 5342 !
; 5343 ! COMPLETION CODES:
; 5344 !
; 5345 ! None.
; 5346 !
; 5347 ! SIDE EFFECTS:
; 5348 !
; 5349 ! None.
; 5350 !
; 5351 !--
; 5352
; 5353 BEGIN
; 5354
; 5355 LOCAL
; 5356 STATUS, ! Status returned by various routines
; 5357 REPEAT_COUNT, ! Count of times to repeat character
; 5358 TURN_BIT_8_ON, ! If eight bit quoting
; 5359 COUNTER, ! Count of the characters left
; 5360 CHARACTER, ! Character we are processing
; 5361 POINTER; ! Pointer to the data
; 5362
; 5363 POINTER = CH$PTR (REC_MSG, PKT_MSG, CHR_SIZE);
; 5364 COUNTER = 0;
; 5365
; 5366 WHILE (.COUNTER LSS .REC_LENGTH) DO
; 5367 BEGIN
; 5368 CHARACTER = CH$RCHAR_A (POINTER);
; 5369 COUNTER = .COUNTER + 1;
; 5370 !
; 5371 ! If the character is the repeat character (and we are doing repeat
; 5372 ! compression), then get the count.
; 5373 !
; 5374
; 5375 IF ((.CHARACTER EQL .REPT_CHR) AND .FLAG_REPEAT)
; 5376 THEN
; 5377 BEGIN
; 5378 REPEAT_COUNT = UNCHAR (CH$RCHAR_A (POINTER) AND %O'177');
; 5379 CHARACTER = CH$RCHAR_A (POINTER);
; 5380 COUNTER = .COUNTER + 2;
; 5381 END
; 5382 ELSE
; 5383 REPEAT_COUNT = 1;
; 5384
; 5385 !
; 5386 ! If the character is an eight bit quoting character and we are doing eight
; 5387 ! bit quoting then turn on the flag so we turn the eighth bit on when we
; 5388 ! get the real character.
; 5389 !
; 5390
; 5391 IF ((.CHARACTER EQL .SEND_8QUOTE_CHR) AND .FLAG_8QUOTE)
; 5392 THEN
; 5393 BEGIN
; 5394 TURN_BIT_8_ON = TRUE;
; 5395 COUNTER = .COUNTER + 1;
; 5396 CHARACTER = CH$RCHAR_A (POINTER);
; 5397 END
; 5398 ELSE
; 5399 TURN_BIT_8_ON = FALSE;
; 5400
; 5401 !
; 5402 ! Now determine if we are quoting the character. If so then we must eat
; 5403 ! the quoting character and get the real character.
; 5404 !
; 5405
; 5406 IF .CHARACTER EQL .SEND_QUOTE_CHR ![035] Is this character other Kermit sends as quote?
; 5407 THEN
; 5408 BEGIN
; 5409 CHARACTER = CH$RCHAR_A (POINTER);
; 5410 COUNTER = .COUNTER + 1;
; 5411 !
; 5412 ! Determine if we must undo what someone else has done to the character
; 5413 !
; 5414
; P 5415 IF ((.CHARACTER AND %O'177') GEQ CTL (CHR_DEL)) AND ((.CHARACTER AND %O'177') LEQ CTL (
; 5416 CHR_DEL) + %O'40')
; 5417 THEN
; 5418 CHARACTER = CTL (.CHARACTER);
; 5419
; 5420 END;
; 5421
; 5422 !
; 5423 ! Turn on the eight bit if needed and then write the character out
; 5424 !
; 5425
; 5426 IF .TURN_BIT_8_ON THEN CHARACTER = .CHARACTER OR %O'200';
; 5427
; 5428 RMSG_DATA_CHARS = .RMSG_DATA_CHARS + .REPEAT_COUNT;
; 5429 FILE_CHARS = .FILE_CHARS + .REPEAT_COUNT;
; 5430
; 5431 DECR REPEAT_COUNT FROM .REPEAT_COUNT TO 1 DO
; 5432 BEGIN
; 5433 STATUS = (.PUT_CHR_ROUTINE) (.CHARACTER);
; 5434
; 5435 IF NOT .STATUS THEN RETURN .STATUS;
; 5436
; 5437 END;
; 5438
; 5439 END;
; 5440
; 5441 RETURN KER_NORMAL;
; 5442 END; ! End of BFR_EMPTY
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL BFR.EMPTY BFR_EMPTY
.NLIST
.ENABL LSB
.LIST
; BFR.EMPTY
U.27: JSR R1,$SAVE5 ; 5314
TST -(SP)
MOV #U.82+4,R4 ; *,POINTER 5363
CLR R3 ; COUNTER 5364
1$: CMP R3,U.80 ; COUNTER,* 5366
BGE 10$
CLR R2 ; CHARACTER 5368
BISB (R4)+,R2 ; POINTER,CHARACTER
INC R3 ; COUNTER 5369
CMP R2,U.63 ; CHARACTER,* 5375
BNE 2$
BIT #1,U.73
BEQ 2$
MOVB (R4)+,R5 ; POINTER,REPEAT.COUNT 5378
BIC #177600,R5 ; *,REPEAT.COUNT
SUB #40,R5 ; *,REPEAT.COUNT
CLR R2 ; CHARACTER 5379
BISB (R4)+,R2 ; POINTER,CHARACTER
ADD #2,R3 ; *,COUNTER 5380
BR 3$ ; 5375
2$: MOV #1,R5 ; *,REPEAT.COUNT 5383
3$: CMP R2,U.69 ; CHARACTER,* 5391
BNE 4$
BIT #1,U.72
BEQ 4$
MOV #1,(SP) ; *,TURN.BIT.8.ON 5394
ADD (SP),R3 ; *,COUNTER 5395
ADD (SP),R4 ; *,POINTER 5396
CLR R2 ; CHARACTER
BISB -1(R4),R2 ; *(POINTER),CHARACTER
BR 5$ ; 5391
4$: CLR (SP) ; TURN.BIT.8.ON 5399
5$: CMP R2,U.68 ; CHARACTER,* 5406
BNE 6$
CLR R2 ; CHARACTER 5409
BISB (R4)+,R2 ; POINTER,CHARACTER
INC R3 ; COUNTER 5410
MOV R2,R1 ; CHARACTER,* 5415
BIC #177600,R1
CMP R1,#77
BLO 6$
MOV R2,R1 ; CHARACTER,*
BIC #177600,R1
CMP R1,#137
BHI 6$
MOV #100,R1 ; 5418
XOR R1,R2 ; *,CHARACTER
6$: BIT #1,(SP) ; *,TURN.BIT.8.ON 5426
BEQ 7$
BIS #200,R2 ; *,CHARACTER
7$: ADD R5,RMSG.DATA.CHARS ; REPEAT.COUNT,* 5428
ADD R5,U.85 ; REPEAT.COUNT,* 5429
MOV R5,R1 ; REPEAT.COUNT,REPEAT.COUNT 5431
BLE 1$
8$: MOV R2,-(SP) ; CHARACTER,* 5433
JSR PC,@U.92
BIT #1,R0 ; *,STATUS 5435
BNE 9$
TST (SP)+
BR 11$
9$: TST (SP)+ ; 5432
SOB R1,8$ ; REPEAT.COUNT,* 5431
BR 1$ ; 5366
10$: MOV #1,R0 ; 5353
11$: TST (SP)+ ; 5314
RTS PC
; Routine Size: 94 words, Routine Base: $CODE$ + 21032
; Maximum stack depth per invocation: 9 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5443 %SBTTL 'Buffer filling and emptying subroutines'
; 5444 ROUTINE SET_STRING (POINTER, LENGTH, START) =
; 5445
; 5446 !++
; 5447 ! FUNCTIONAL DESCRIPTION:
; 5448 !
; 5449 ! This routine is used to set up the buffer filling and emptying
; 5450 ! routines to use a string for input (or output) rather than
; 5451 ! the file I/O routines.
; 5452 !
; 5453 ! CALLING SEQUENCE:
; 5454 !
; 5455 ! SET_STRING (.POINTER, .LENGTH, .START)
; 5456 !
; 5457 ! INPUT PARAMETERS:
; 5458 !
; 5459 ! POINTER - Character pointer to string
; 5460 !
; 5461 ! LENGTH - Number of characters in string
; 5462 !
; 5463 ! START - True to start string, false to end it
; 5464 !
; 5465 ! IMPLICIT INPUTS:
; 5466 !
; 5467 ! None.
; 5468 !
; 5469 ! OUPTUT PARAMETERS:
; 5470 !
; 5471 ! Returns 0 if START = TRUE, actual number of characters used
; 5472 ! by last string if START = FALSE.
; 5473 !
; 5474 ! IMPLICIT OUTPUTS:
; 5475 !
; 5476 ! GET_CHR_ROUTINE and PUT_CHR_ROUTINE modifed so that string
; 5477 ! routines are called instead of file I/O.
; 5478 !
; 5479 ! COMPLETION CODES:
; 5480 !
; 5481 ! None.
; 5482 !
; 5483 ! SIDE EFFECTS:
; 5484 !
; 5485 ! None.
; 5486 !
; 5487 !--
; 5488
; 5489 BEGIN
; 5490
; 5491 OWN
; 5492 STR_POINTER, ! Pointer to string
; 5493 STR_LENGTH, ! Length of string
; 5494 STR_ORG_LENGTH, ! Original length of string
; 5495 OLD_GET_CHR, ! Old get-char routine
; 5496 OLD_PUT_CHR; ! Old put-char routine
; 5497
; 5498 !
; 5499 ! Routine to get a character from the string
; 5500 !
; 5501 ROUTINE GET_STRING (CHAR_ADDRESS) =
; 5502 BEGIN
; 5503 !
; 5504 ! If some characters are left, count down the length and get next character
; 5505 ! Otherwise return and end of file indication.
; 5506 !
; 5507
; 5508 IF .STR_LENGTH GTR 0
; 5509 THEN
; 5510 BEGIN
; 5511 STR_LENGTH = .STR_LENGTH - 1;
; 5512 .CHAR_ADDRESS = CH$RCHAR_A (STR_POINTER);
; 5513 RETURN KER_NORMAL;
; 5514 END
; 5515 ELSE
; 5516 RETURN KER_EOF;
; 5517
; 5518 END; ! End of GET_STRING
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $OWN$, D
; STR.POINTER
U.117: .BLKW 1
; STR.LENGTH
U.118: .BLKW 1
; STR.ORG.LENGTH
U.119: .BLKW 1
; OLD.GET.CHR
U.120: .BLKW 1
; OLD.PUT.CHR
U.121: .BLKW 1
.SBTTL GET.STRING Buffer filling and emptying subroutines
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; GET.STRING
U.122: TST U.118 ; 5508
BLE 1$
DEC U.118 ; 5511
INC U.117 ; 5512
MOV U.117,R0
MOVB -1(R0),@2(SP) ; *,CHAR.ADDRESS
BIC #177400,@2(SP) ; *,CHAR.ADDRESS
MOV #1,R0 ; 5502
RTS PC
1$: MOV #101,R0
RTS PC ; 5501
; Routine Size: 21 words, Routine Base: $CODE$ + 21326
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5519 ROUTINE PUT_STRING (CHAR_VALUE) =
; 5520 BEGIN
; 5521 !
; 5522 ! If there is enough room to store another character, store the character
; 5523 ! and count it. Otherwise return a line too long indication.
; 5524 !
; 5525
; 5526 IF .STR_LENGTH GTR 0
; 5527 THEN
; 5528 BEGIN
; 5529 STR_LENGTH = .STR_LENGTH - 1;
; 5530 CH$WCHAR_A (.CHAR_VALUE, STR_POINTER);
; 5531 RETURN KER_NORMAL;
; 5532 END
; 5533 ELSE
; 5534 RETURN KER_LINTOOLNG;
; 5535
; 5536 END; ! End of PUT_STRING
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL PUT.STRING Buffer filling and emptying subroutines
.NLIST
.ENABL LSB
.LIST
; PUT.STRING
U.123: TST U.118 ; 5526
BLE 1$
DEC U.118 ; 5529
MOVB 2(SP),@U.117 ; CHAR.VALUE,* 5530
INC U.117
MOV #1,R0 ; 5520
RTS PC
1$: MOV #72,R0
RTS PC ; 5519
; Routine Size: 16 words, Routine Base: $CODE$ + 21400
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5537 !
; 5538 ! If we have a request to start a string (input or output), save the old
; 5539 ! routines and set up ours. Also save the string pointer and length for
; 5540 ! use by our get/put routines.
; 5541 ! Otherwise this is a request to stop using the string routines, so reset
; 5542 ! the old routines and return the actual number of characters read or
; 5543 ! written
; 5544 !
; 5545
; 5546 IF .START
; 5547 THEN
; 5548 BEGIN
; 5549 STR_POINTER = .POINTER;
; 5550 STR_ORG_LENGTH = .LENGTH;
; 5551 STR_LENGTH = .LENGTH;
; 5552 OLD_GET_CHR = .GET_CHR_ROUTINE;
; 5553 OLD_PUT_CHR = .PUT_CHR_ROUTINE;
; 5554 GET_CHR_ROUTINE = GET_STRING;
; 5555 PUT_CHR_ROUTINE = PUT_STRING;
; 5556 RETURN 0;
; 5557 END
; 5558 ELSE
; 5559 BEGIN
; 5560 GET_CHR_ROUTINE = .OLD_GET_CHR;
; 5561 PUT_CHR_ROUTINE = .OLD_PUT_CHR;
; 5562 RETURN .STR_ORG_LENGTH - .STR_LENGTH;
; 5563 END;
; 5564
; 5565 END; ! End of SET_STRING
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL SET.STRING Buffer filling and emptying subroutines
.NLIST
.ENABL LSB
.LIST
; SET.STRING
U.29: BIT #1,2(SP) ; *,START 5546
BEQ 1$
MOV 6(SP),U.117 ; POINTER,* 5549
MOV 4(SP),U.119 ; LENGTH,* 5550
MOV 4(SP),U.118 ; STR.ORG.LENGTH,* 5551
MOV U.91,U.120 ; 5552
MOV U.92,U.121 ; 5553
MOV #U.122,U.91 ; 5554
MOV #U.123,U.92 ; 5555
CLR R0 ; 5489
RTS PC
1$: MOV U.120,U.91 ; 5560
MOV U.121,U.92 ; 5561
MOV U.119,R0 ; 5562
SUB U.118,R0
RTS PC ; 5444
; Routine Size: 38 words, Routine Base: $CODE$ + 21440
; Maximum stack depth per invocation: 0 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5566 %SBTTL 'Add parity routine'
; 5567 ROUTINE DO_PARITY (MESSAGE, LENGTH) : NOVALUE =
; 5568
; 5569 !++
; 5570 ! FUNCTIONAL DESCRIPTION:
; 5571 !
; 5572 ! This routine will add parity for a complete message that is to be
; 5573 ! sent to the remote Kermit.
; 5574 !
; 5575 ! CALLING SEQUENCE:
; 5576 !
; 5577 ! DO_PARITY (Message_address, Message_length);
; 5578 !
; 5579 ! INPUT PARAMETERS:
; 5580 !
; 5581 ! Message_address - Address of the message to put parity on.
; 5582 ! Message_length - Lengtho of the message.
; 5583 !
; 5584 ! IMPLICIT INPUTS:
; 5585 !
; 5586 ! None.
; 5587 !
; 5588 ! OUTPUT PARAMETERS:
; 5589 !
; 5590 ! None.
; 5591 !
; 5592 ! IMPLICIT OUTPUTS:
; 5593 !
; 5594 ! None.
; 5595 !
; 5596 ! COMPLETION CODES:
; 5597 !
; 5598 ! None.
; 5599 !
; 5600 ! SIDE EFFECTS:
; 5601 !
; 5602 ! None.
; 5603 !
; 5604 !--
; 5605
; 5606 BEGIN
; 5607
; 5608 MAP
; 5609 MESSAGE : REF VECTOR [CH$ALLOCATION (MAX_MSG, CHR_SIZE)];
; 5610
; 5611 LOCAL
; 5612 POINTER; ! Point into the message
; 5613
; 5614 IF NOT .DEV_PARITY_FLAG
; 5615 THEN
; 5616 BEGIN
; 5617 POINTER = CH$PTR (.MESSAGE,, CHR_SIZE);
; 5618
; 5619 INCR I FROM 1 TO .LENGTH DO
; 5620 CH$WCHAR_A (GEN_PARITY (CH$RCHAR (.POINTER)), POINTER);
; 5621
; 5622 END;
; 5623
; 5624 END; ! End of DO_PARITY
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL DO.PARITY Add parity routine
.NLIST
.ENABL LSB
.LIST
; DO.PARITY
U.21: JSR R1,$SAVE2 ; 5567
BIT #1,DEV.PARITY.FLAG ; 5614
BNE 3$
MOV 12(SP),R2 ; MESSAGE,POINTER 5617
CLR R1 ; I 5619
BR 2$
1$: CLR -(SP) ; 5620
MOVB (R2),(SP) ; POINTER,*
JSR PC,U.22
MOVB R0,(R2)+ ; *,POINTER
TST (SP)+
2$: INC R1 ; I 5619
CMP R1,10(SP) ; I,LENGTH
BLE 1$
3$: RTS PC ; 5567
; Routine Size: 21 words, Routine Base: $CODE$ + 21554
; Maximum stack depth per invocation: 5 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5625 %SBTTL 'Parity routine'
; 5626
; 5627 GLOBAL ROUTINE GEN_PARITY (CHARACTER) =
; 5628
; 5629 !++
; 5630 ! FUNCTIONAL DESCRIPTION:
; 5631 !
; 5632 ! This routine will add parity to the character that is supplied.
; 5633 !
; 5634 ! CALLING SEQUENCE:
; 5635 !
; 5636 ! CHARACTER = GEN_PARITY(CHARACTER)
; 5637 !
; 5638 ! INPUT PARAMETERS:
; 5639 !
; 5640 ! CHARACTER - Produce the parity for this character depending on the
; 5641 ! setting of the SET PARITY switch.
; 5642 !
; 5643 ! IMPLICIT INPUTS:
; 5644 !
; 5645 ! None.
; 5646 !
; 5647 ! OUTPUT PARAMETERS:
; 5648 !
; 5649 ! None.
; 5650 !
; 5651 ! IMPLICIT OUTPUTS:
; 5652 !
; 5653 ! None.
; 5654 !
; 5655 ! COMPLETION CODES:
; 5656 !
; 5657 ! None.
; 5658 !
; 5659 ! SIDE EFFECTS:
; 5660 !
; 5661 ! None.
; 5662 !
; 5663 !--
; 5664
; 5665 BEGIN
; 5666
; 5667 LOCAL
; 5668 TEMP_CHAR;
; 5669
; 5670 IF .IBM_FLAG THEN RETURN .CHARACTER OR %O'200';
; 5671
; 5672 CASE .PARITY_TYPE FROM PR_MIN TO PR_MAX OF
; 5673 SET
; 5674
; 5675 [PR_NONE] :
; 5676 RETURN .CHARACTER;
; 5677
; 5678 [PR_SPACE] :
; 5679 RETURN .CHARACTER AND %O'177';
; 5680
; 5681 [PR_MARK] :
; 5682 RETURN .CHARACTER OR %O'200';
; 5683
; 5684 [PR_ODD] :
; 5685 TEMP_CHAR = .CHARACTER AND %O'177' OR %O'200';
; 5686
; 5687 [PR_EVEN] :
; 5688 TEMP_CHAR = .CHARACTER AND %O'177';
; 5689 TES;
; 5690
; 5691 TEMP_CHAR = .TEMP_CHAR XOR (.TEMP_CHAR^-4);
; 5692 TEMP_CHAR = .TEMP_CHAR XOR (.TEMP_CHAR^-2);
; 5693
; 5694 IF .TEMP_CHAR<0, 2> EQL %B'01' OR .TEMP_CHAR<0, 2> EQL %B'10'
; 5695 THEN
; 5696 RETURN .CHARACTER AND %O'177' OR %O'200'
; 5697 ELSE
; 5698 RETURN .CHARACTER AND %O'177';
; 5699
; 5700 END; ! End of GEN_PARITY
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL GEN.PARITY Parity routine
.NLIST
.ENABL LSB
.LIST
GEN.PARITY::
U.22: JSR R1,$SAVE2 ; 5627
BIT #1,IBM.FLAG ; 5670
BEQ 1$
MOV 10(SP),R0 ; CHARACTER,*
BR 9$
1$: MOV 10(SP),R2 ; CHARACTER,* 5676
MOV PARITY.TYPE,R0 ; 5672
ASL R0
ADD P.AAQ(R0),PC ; Case dispatch
3$: MOV R2,R0 ; 5676
RTS PC
4$: MOV R2,R0 ; 5682
BR 9$
5$: MOV R2,R1 ; *,TEMP.CHAR 5685
BIC #177600,R1 ; *,TEMP.CHAR
BIS #200,R1 ; *,TEMP.CHAR
BR 7$ ; 5672
6$: MOV R2,R1 ; *,TEMP.CHAR 5688
BIC #177600,R1 ; *,TEMP.CHAR
7$: MOV R1,R0 ; TEMP.CHAR,* 5691
ASH #-4,R0
XOR R0,R1 ; *,TEMP.CHAR
MOV R1,R0 ; TEMP.CHAR,* 5692
ASR R0
ASR R0
XOR R0,R1 ; *,TEMP.CHAR
MOV R1,R0 ; TEMP.CHAR,* 5694
BIC #177774,R0
CMP R0,#1
BEQ 8$
BIC #177774,R1
CMP R1,#2
BNE 10$
8$: MOV R2,R0 ; 5696
BIC #177600,R0
9$: BIS #200,R0
RTS PC ; 5665
10$: MOV R2,R0
BIC #177600,R0
RTS PC ; 5627
; Routine Size: 58 words, Routine Base: $CODE$ + 21626
; Maximum stack depth per invocation: 4 words
.PSECT $PLIT$, RO , D
P.AAQ: ; CASE Table for GEN.PARITY+0034 5672
2$: .WORD 0 ; [3$]
.WORD 4 ; [4$]
.WORD 24 ; [6$]
.WORD 10 ; [5$]
.WORD 114 ; [10$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5701
; 5702 %SBTTL 'Per transfer -- Initialization'
; 5703 ROUTINE INIT_XFR : NOVALUE =
; 5704
; 5705 !++
; 5706 ! FUNCTIONAL DESCRIPTION:
; 5707 !
; 5708 ! This routine will initialize the various locations that the
; 5709 ! send and receive statistics are kept.
; 5710 !
; 5711 ! CALLING SEQUENCE:
; 5712 !
; 5713 ! INIT_XFR();
; 5714 !
; 5715 ! INPUT PARAMETERS:
; 5716 !
; 5717 ! None.
; 5718 !
; 5719 ! IMPLICIT INPUTS:
; 5720 !
; 5721 ! None.
; 5722 !
; 5723 ! OUTPUT PARAMETERS:
; 5724 !
; 5725 ! None.
; 5726 !
; 5727 ! IMPLICIT OUTPUTS:
; 5728 !
; 5729 ! None.
; 5730 !
; 5731 ! COMPLETION CODES:
; 5732 !
; 5733 ! None.
; 5734 !
; 5735 ! SIDE EFFECTS:
; 5736 !
; 5737 ! None.
; 5738 !
; 5739 !--
; 5740
; 5741 BEGIN
; 5742 !
; 5743 ! Determine if we should do 8 bit quoting
; 5744 !
; 5745
; 5746 IF .PARITY_TYPE NEQ PR_NONE
; 5747 THEN
; 5748 BEGIN
; 5749 RECV_8QUOTE_CHR = .RCV_8QUOTE_CHR;
; 5750 END
; 5751 ELSE
; 5752 BEGIN
; 5753 RECV_8QUOTE_CHR = %C'Y';
; 5754 END;
; 5755
; 5756 NUM_RETRIES = 0;
; 5757 SEND_8QUOTE_CHR = .RECV_8QUOTE_CHR;
; 5758 !
; 5759 ! Send parameters that may not get set before we need them for the first
; 5760 ! time.
; 5761 !
; 5762 SEND_PKT_SIZE = ABS (.SND_PKT_SIZE);
; 5763 SEND_NPAD = ABS (.SND_NPAD);
; 5764 SEND_PADCHAR = ABS (.SND_PADCHAR);
; 5765 SEND_TIMEOUT = ABS (.SND_TIMEOUT);
; 5766 SEND_EOL = ABS (.SND_EOL);
; 5767 SEND_QUOTE_CHR = ABS (.SND_QUOTE_CHR);
; 5768 !
; 5769 ! For initialization messages, we must use single character checksum
; 5770 ! When the send-init/ack sequence has been done, we will switch to the
; 5771 ! desired form
; 5772 !
; 5773 BLK_CHK_TYPE = CHK_1CHAR;
; 5774 INI_CHK_TYPE = .CHKTYPE; ! Send desired type
; 5775 !
; 5776 ! Set desired repeat character for use in we are doing send-init
; 5777 ! Will be overwritten by other ends desired character if it sends
; 5778 ! the send-init.
; 5779 !
; 5780 REPT_CHR = .SET_REPT_CHR;
; 5781 !
; 5782 ! Assume packet assembly/disassembly uses characters from a file
; 5783 !
; 5784 GET_CHR_ROUTINE = GET_FILE; ! Initialize the get-a-char routine
; 5785 PUT_CHR_ROUTINE = PUT_FILE; ! And the put-a-char
; 5786 TEXT_HEAD_FLAG = FALSE; ! And assume we will get an File header
; 5787 NO_FILE_NEEDED = FALSE; ! Assume will do file ops
; 5788 INIT_PKT_SENT = FALSE; ! And no server-init sent
; 5789 !
; 5790 ! Always start with packet number 0
; 5791 !
; 5792 MSG_NUMBER = 0; ! Initial message number
; 5793 !
; 5794 ! Stats information
; 5795 !
; 5796 SMSG_TOTAL_CHARS = 0;
; 5797 RMSG_TOTAL_CHARS = 0;
; 5798 SMSG_DATA_CHARS = 0;
; 5799 RMSG_DATA_CHARS = 0;
; 5800 SMSG_COUNT = 0;
; 5801 RMSG_COUNT = 0;
; 5802 RMSG_NAKS = 0;
; 5803 SMSG_NAKS = 0;
; 5804 XFR_TIME = SY_TIME ();
; 5805 END; ! End of INIT_XFR
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL INIT.XFR Per transfer -- Initialization
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; INIT.XFR
U.31: TST PARITY.TYPE ; 5746
BEQ 1$
MOV RCV.8QUOTE.CHR,U.62 ; 5749
BR 2$ ; 5746
1$: MOV #131,U.62 ; 5753
2$: CLR U.77 ; 5756
MOV U.62,U.69 ; 5757
MOV SND.PKT.SIZE,-(SP) ; 5762
JSR PC,BL$ABS
MOV R0,U.64
MOV SND.NPAD,(SP) ; 5763
JSR PC,BL$ABS
MOV R0,U.65
MOV SND.PADCHAR,(SP) ; 5764
JSR PC,BL$ABS
MOV R0,U.66
MOV SND.TIMEOUT,(SP) ; 5765
JSR PC,BL$ABS
MOV R0,SEND.TIMEOUT
MOV SND.EOL,(SP) ; 5766
JSR PC,BL$ABS
MOV R0,U.67
MOV SND.QUOTE.CHR,(SP) ; 5767
JSR PC,BL$ABS
MOV R0,U.68
MOV #61,U.71 ; 5773
MOV CHKTYPE,U.70 ; 5774
MOV SET.REPT.CHR,U.63 ; 5780
MOV #GET.FILE,U.91 ; 5784
MOV #PUT.FILE,U.92 ; 5785
CLR U.86 ; 5786
CLR U.87 ; 5787
CLR U.88 ; 5788
CLR U.78 ; 5792
CLR SMSG.TOTAL.CHARS ; 5796
CLR RMSG.TOTAL.CHARS ; 5797
CLR SMSG.DATA.CHARS ; 5798
CLR RMSG.DATA.CHARS ; 5799
CLR SMSG.COUNT ; 5800
CLR RMSG.COUNT ; 5801
CLR RMSG.NAKS ; 5802
CLR SMSG.NAKS ; 5803
JSR PC,SY.TIME ; 5804
MOV R0,XFR.TIME
TST (SP)+ ; 5741
RTS PC ; 5703
; Routine Size: 96 words, Routine Base: $CODE$ + 22012
; Maximum stack depth per invocation: 2 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5806 %SBTTL 'Statistics -- Finish message transfer'
; 5807 ROUTINE END_STATS : NOVALUE =
; 5808
; 5809 !++
; 5810 ! FUNCTIONAL DESCRIPTION:
; 5811 !
; 5812 ! This routine will end the collection of the statistices. It will
; 5813 ! update the various overall statistic parameters.
; 5814 !
; 5815 ! CALLING SEQUENCE:
; 5816 !
; 5817 ! END_STATS ();
; 5818 !
; 5819 ! INPUT PARAMETERS:
; 5820 !
; 5821 ! None.
; 5822 !
; 5823 ! IMPLICIT INPUTS:
; 5824 !
; 5825 ! None.
; 5826 !
; 5827 ! OUTPUT PARAMETERS:
; 5828 !
; 5829 ! None.
; 5830 !
; 5831 ! IMPLICIT OUTPUTS:
; 5832 !
; 5833 ! None.
; 5834 !
; 5835 ! COMPLETION CODES:
; 5836 !
; 5837 ! None.
; 5838 !
; 5839 ! SIDE EFFECTS:
; 5840 !
; 5841 ! None.
; 5842 !
; 5843 !--
; 5844
; 5845 BEGIN
; 5846 SND_COUNT = .SND_COUNT + .SMSG_COUNT;
; 5847 RCV_COUNT = .RCV_COUNT + .RMSG_COUNT;
; 5848 SND_TOTAL_CHARS = .SND_TOTAL_CHARS + .SMSG_TOTAL_CHARS;
; 5849 SND_DATA_CHARS = .SND_DATA_CHARS + .SMSG_DATA_CHARS;
; 5850 RCV_TOTAL_CHARS = .RCV_TOTAL_CHARS + .RMSG_TOTAL_CHARS;
; 5851 RCV_DATA_CHARS = .RCV_DATA_CHARS + .RMSG_DATA_CHARS;
; 5852 SND_NAKS = .SND_NAKS + .SMSG_NAKS;
; 5853 RCV_NAKS = .RCV_NAKS + .RMSG_NAKS;
; 5854 XFR_TIME = SY_TIME () - .XFR_TIME;
; 5855 TOTAL_TIME = .TOTAL_TIME + .XFR_TIME;
; 5856 END; ! End of END_STATS
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL END.STATS Statistics -- Finish message transfer
.NLIST
.ENABL LSB
.LIST
; END.STATS
U.17: ADD SMSG.COUNT,SND.COUNT ; 5846
ADD RMSG.COUNT,RCV.COUNT ; 5847
ADD SMSG.TOTAL.CHARS,SND.TOTAL.CHARS; 5848
ADD SMSG.DATA.CHARS,SND.DATA.CHARS ; 5849
ADD RMSG.TOTAL.CHARS,RCV.TOTAL.CHARS; 5850
ADD RMSG.DATA.CHARS,RCV.DATA.CHARS ; 5851
ADD SMSG.NAKS,SND.NAKS ; 5852
ADD RMSG.NAKS,RCV.NAKS ; 5853
JSR PC,SY.TIME ; 5854
SUB XFR.TIME,R0
MOV R0,XFR.TIME
ADD R0,TOTAL.TIME ; XFR.TIME,* 5855
RTS PC ; 5807
; Routine Size: 33 words, Routine Base: $CODE$ + 22312
; Maximum stack depth per invocation: 1 word
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5857 %SBTTL 'Status type out -- STS_OUTPUT'
; 5858 ROUTINE STS_OUTPUT : NOVALUE =
; 5859
; 5860 !++
; 5861 ! FUNCTIONAL DESCRIPTION:
; 5862 !
; 5863 ! This routine will output the current status of a transfer.
; 5864 ! This is used when the user types a ^A during a transfer.
; 5865 !
; 5866 ! CALLING SEQUENCE:
; 5867 !
; 5868 ! STS_OUTPUT ()
; 5869 !
; 5870 ! INPUT PARAMETERS:
; 5871 !
; 5872 ! None.
; 5873 !
; 5874 ! IMPLICIT INPUTS:
; 5875 !
; 5876 ! Statistics blocks, file names, etc.
; 5877 !
; 5878 ! OUPTUT PARAMETERS:
; 5879 !
; 5880 ! None.
; 5881 !
; 5882 ! IMPLICIT OUTPUTS:
; 5883 !
; 5884 ! None.
; 5885 !
; 5886 ! COMPLETION CODES:
; 5887 !
; 5888 ! None.
; 5889 !
; 5890 ! SIDE EFFECTS:
; 5891 !
; 5892 ! None.
; 5893 !
; 5894 !--
; 5895
; 5896 BEGIN
; 5897 TT_CHAR (%C'['); ! Start the message
; 5898
; 5899 CASE .STATE FROM STATE_MIN TO STATE_MAX OF
; 5900 SET
; 5901
; 5902 [STATE_ID, STATE_II] :
; 5903 TT_TEXT (UPLIT (%ASCIZ'Idle in server mode'));
; 5904
; 5905 [STATE_S, STATE_SF] :
; 5906 BEGIN
; 5907 TT_TEXT (UPLIT (%ASCIZ'Initializing for sending file '));
; 5908 TT_TEXT (FILE_NAME);
; 5909 END;
; 5910
; 5911 [STATE_SI] :
; 5912 TT_TEXT (UPLIT (%ASCIZ'Initializing for remote command'));
; 5913
; 5914 [STATE_SG] :
; 5915 TT_TEXT (UPLIT (%ASCIZ'Waiting for response to remote command'));
; 5916
; 5917 [STATE_SD] :
; 5918 BEGIN
; 5919 TT_NUMBER (.FILE_CHARS);
; 5920 TT_TEXT (UPLIT (%ASCIZ' characters sent for file '));
; 5921 TT_TEXT (FILE_NAME);
; 5922 END;
; 5923
; 5924 [STATE_SZ] :
; 5925 BEGIN
; 5926 TT_TEXT (UPLIT (%ASCIZ'At end of file '));
; 5927 TT_TEXT (FILE_NAME);
; 5928 END;
; 5929
; 5930 [STATE_SB] :
; 5931 TT_TEXT (UPLIT (%ASCIZ'Finishing transfer session'));
; 5932
; 5933 [STATE_R] :
; 5934 TT_TEXT (UPLIT (%ASCIZ'Waiting for initialization'));
; 5935
; 5936 [STATE_RF] :
; 5937 TT_TEXT (UPLIT (%ASCIZ'Waiting for next file or end of session'));
; 5938
; 5939 [STATE_RD] :
; 5940 BEGIN
; 5941 TT_NUMBER (.FILE_CHARS);
; 5942 TT_TEXT (UPLIT (%ASCIZ' characters received for file '));
; 5943 TT_TEXT (FILE_NAME);
; 5944 END;
; 5945
; 5946 [STATE_C] :
; 5947 TT_TEXT (UPLIT (%ASCIZ' Session complete'));
; 5948
; 5949 [STATE_A] :
; 5950 TT_TEXT (UPLIT (%ASCIZ' Session aborted'));
; 5951
; 5952 [INRANGE, OUTRANGE] :
; 5953 TT_TEXT (UPLIT (%ASCIZ' Unknown state'));
; 5954 TES;
; 5955
; 5956 SELECTONE .STATE OF
; 5957 SET
; 5958
; 5959 [STATE_S, STATE_SF, STATE_SD, STATE_SZ, STATE_SB] :
; 5960 BEGIN
; 5961
; 5962 IF .RMSG_NAKS GTR 0
; 5963 THEN
; 5964 BEGIN
; 5965 TT_TEXT (UPLIT (%ASCIZ', '));
; 5966 TT_NUMBER (.RMSG_NAKS);
; 5967 TT_TEXT (UPLIT (%ASCIZ' NAKs received'));
; 5968 END;
; 5969
; 5970 END;
; 5971
; 5972 [STATE_R, STATE_RF, STATE_RD] :
; 5973 BEGIN
; 5974
; 5975 IF .SMSG_NAKS GTR 0
; 5976 THEN
; 5977 BEGIN
; 5978 TT_TEXT (UPLIT (%ASCIZ', '));
; 5979 TT_NUMBER (.SMSG_NAKS);
; 5980 TT_TEXT (UPLIT (%ASCIZ' NAKs sent'));
; 5981 END;
; 5982
; 5983 END;
; 5984 TES;
; 5985
; 5986 TT_CHAR (%C']'); ! End the line
; 5987 TT_CRLF (); ! with a CRLF
; 5988 END; ! End of STS_OUTPUT
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.AAS: .ASCII /Idl/
.ASCII /e i/
.ASCII /n s/
.ASCII /erv/
.ASCII /er /
.ASCII /mod/
.ASCII /e/<00>
P.AAT: .ASCII /Ini/
.ASCII /tia/
.ASCII /liz/
.ASCII /ing/
.ASCII / fo/
.ASCII /r s/
.ASCII /end/
.ASCII /ing/
.ASCII / fi/
.ASCII /le /
.ASCII <00><00>
P.AAU: .ASCII /Ini/
.ASCII /tia/
.ASCII /liz/
.ASCII /ing/
.ASCII / fo/
.ASCII /r r/
.ASCII /emo/
.ASCII /te /
.ASCII /com/
.ASCII /man/
.ASCII /d/<00>
P.AAV: .ASCII /Wai/
.ASCII /tin/
.ASCII /g f/
.ASCII /or /
.ASCII /res/
.ASCII /pon/
.ASCII /se /
.ASCII /to /
.ASCII /rem/
.ASCII /ote/
.ASCII / co/
.ASCII /mma/
.ASCII /nd/<00>
.ASCII <00>
P.AAW: .ASCII / ch/
.ASCII /ara/
.ASCII /cte/
.ASCII /rs /
.ASCII /sen/
.ASCII /t f/
.ASCII /or /
.ASCII /fil/
.ASCII /e /<00>
.ASCII <00>
P.AAX: .ASCII /At /
.ASCII /end/
.ASCII / of/
.ASCII / fi/
.ASCII /le /
.ASCII <00>
P.AAY: .ASCII /Fin/
.ASCII /ish/
.ASCII /ing/
.ASCII / tr/
.ASCII /ans/
.ASCII /fer/
.ASCII / se/
.ASCII /ssi/
.ASCII /on/<00>
.ASCII <00>
P.AAZ: .ASCII /Wai/
.ASCII /tin/
.ASCII /g f/
.ASCII /or /
.ASCII /ini/
.ASCII /tia/
.ASCII /liz/
.ASCII /ati/
.ASCII /on/<00>
.ASCII <00>
P.ABA: .ASCII /Wai/
.ASCII /tin/
.ASCII /g f/
.ASCII /or /
.ASCII /nex/
.ASCII /t f/
.ASCII /ile/
.ASCII / or/
.ASCII / en/
.ASCII /d o/
.ASCII /f s/
.ASCII /ess/
.ASCII /ion/
.ASCII <00>
P.ABB: .ASCII / ch/
.ASCII /ara/
.ASCII /cte/
.ASCII /rs /
.ASCII /rec/
.ASCII /eiv/
.ASCII /ed /
.ASCII /for/
.ASCII / fi/
.ASCII /le /
.ASCII <00><00>
P.ABC: .ASCII / Se/
.ASCII /ssi/
.ASCII /on /
.ASCII /com/
.ASCII /ple/
.ASCII /te/<00>
P.ABD: .ASCII / Se/
.ASCII /ssi/
.ASCII /on /
.ASCII /abo/
.ASCII /rte/
.ASCII /d/<00><00>
P.ABE: .ASCII / Un/
.ASCII /kno/
.ASCII /wn /
.ASCII /sta/
.ASCII /te/<00>
.ASCII <00>
P.ABF: .ASCII /, /<00>
.ASCII <00>
P.ABG: .ASCII / NA/
.ASCII /Ks /
.ASCII /rec/
.ASCII /eiv/
.ASCII /ed/<00>
.ASCII <00>
P.ABH: .ASCII /, /<00>
.ASCII <00>
P.ABI: .ASCII / NA/
.ASCII /Ks /
.ASCII /sen/
.ASCII /t/<00><00>
.SBTTL STS.OUTPUT Status type out -- STS_OUTPUT
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; STS.OUTPUT
U.32: MOV #133,-(SP) ; 5897
JSR PC,TT.CHAR
MOV U.74,R0 ; 5899
DEC R0
CMP R0,#22
BHI 2$
ASL R0
ADD P.AAR(R0),PC ; Case dispatch
2$: MOV #P.ABE,(SP) ; 5953
BR 16$
3$: MOV #P.AAS,(SP) ; 5903
BR 16$
4$: MOV #P.AAT,(SP) ; 5907
5$: JSR PC,TT.TEXT
MOV #FILE.NAME,(SP) ; 5908
BR 16$
6$: MOV #P.AAU,(SP) ; 5912
BR 16$
7$: MOV #P.AAV,(SP) ; 5915
BR 16$
8$: MOV U.85,(SP) ; 5919
JSR PC,TT.NUMBER
MOV #P.AAW,(SP) ; 5920
BR 5$
9$: MOV #P.AAX,(SP) ; 5926
BR 5$
10$: MOV #P.AAY,(SP) ; 5931
BR 16$
11$: MOV #P.AAZ,(SP) ; 5934
BR 16$
12$: MOV #P.ABA,(SP) ; 5937
BR 16$
13$: MOV U.85,(SP) ; 5941
JSR PC,TT.NUMBER
MOV #P.ABB,(SP) ; 5942
BR 5$
14$: MOV #P.ABC,(SP) ; 5947
BR 16$
15$: MOV #P.ABD,(SP) ; 5950
16$: JSR PC,TT.TEXT
MOV U.74,R0 ; 5956
BLE 17$
CMP R0,#5
BGT 17$
TST RMSG.NAKS ; 5962
BLE 19$
MOV #P.ABF,(SP) ; 5965
JSR PC,TT.TEXT
MOV RMSG.NAKS,(SP) ; 5966
JSR PC,TT.NUMBER
MOV #P.ABG,(SP) ; 5967
BR 18$
17$: CMP R0,#6 ; 5956
BLT 19$
CMP R0,#10
BGT 19$
TST SMSG.NAKS ; 5975
BLE 19$
MOV #P.ABH,(SP) ; 5978
JSR PC,TT.TEXT
MOV SMSG.NAKS,(SP) ; 5979
JSR PC,TT.NUMBER
MOV #P.ABI,(SP) ; 5980
18$: JSR PC,TT.TEXT
19$: MOV #135,(SP) ; 5986
JSR PC,TT.CHAR
JSR PC,TT.CRLF ; 5987
TST (SP)+ ; 5896
RTS PC ; 5858
; Routine Size: 114 words, Routine Base: $CODE$ + 22414
; Maximum stack depth per invocation: 2 words
.PSECT $PLIT$, RO , D
P.AAR: ; CASE Table for STS.OUTPUT+0026 5899
1$: .WORD 14 ; [4$]
.WORD 14 ; [4$]
.WORD 46 ; [8$]
.WORD 64 ; [9$]
.WORD 72 ; [10$]
.WORD 100 ; [11$]
.WORD 106 ; [12$]
.WORD 114 ; [13$]
.WORD 132 ; [14$]
.WORD 140 ; [15$]
.WORD 0 ; [2$]
.WORD 40 ; [7$]
.WORD 32 ; [6$]
.WORD 6 ; [3$]
.WORD 6 ; [3$]
.WORD 0 ; [2$]
.WORD 0 ; [2$]
.WORD 0 ; [2$]
.WORD 0 ; [2$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 5989 %SBTTL 'TYPE_CHAR - Type out a character'
; 5990 ROUTINE TYPE_CHAR (CHARACTER) =
; 5991
; 5992 !++
; 5993 ! FUNCTIONAL DESCRIPTION:
; 5994 !
; 5995 ! This routine is used as an alternate output routine for BFR_EMPTY.
; 5996 ! It will type the character on the terminal, and always return a
; 5997 ! true status.
; 5998 !
; 5999 ! CALLING SEQUENCE:
; 6000 !
; 6001 ! STATUS = TYPE_CHAR (.CHARACTER);
; 6002 !
; 6003 ! INPUT PARAMETERS:
; 6004 !
; 6005 ! CHARACTER - The character to type
; 6006 !
; 6007 ! IMPLICIT INPUTS:
; 6008 !
; 6009 ! None.
; 6010 !
; 6011 ! OUPTUT PARAMETERS:
; 6012 !
; 6013 ! None.
; 6014 !
; 6015 ! IMPLICIT OUTPUTS:
; 6016 !
; 6017 ! None.
; 6018 !
; 6019 ! COMPLETION CODES:
; 6020 !
; 6021 ! None.
; 6022 !
; 6023 ! SIDE EFFECTS:
; 6024 !
; 6025 ! None.
; 6026 !
; 6027 !--
; 6028
; 6029 BEGIN
; 6030 TT_CHAR (.CHARACTER); ! Type the character
; 6031 RETURN KER_NORMAL; ! And return OK
; 6032 END; ! End of TYPE_CHAR
.NLIST
.LIST BIN,LOC
.LIST
.SBTTL TYPE.CHAR TYPE_CHAR - Type out a character
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; TYPE.CHAR
U.30: MOV 2(SP),-(SP) ; CHARACTER,* 6030
JSR PC,TT.CHAR
TST (SP)+ ; 5990
MOV #1,R0 ; 6029
RTS PC ; 5990
; Routine Size: 8 words, Routine Base: $CODE$ + 22760
; Maximum stack depth per invocation: 2 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 6033 %SBTTL 'Debugging -- DBG_SEND'
; 6034 ROUTINE DBG_SEND (ADDRESS, LENGTH) : NOVALUE =
; 6035
; 6036 !++
; 6037 ! FUNCTIONAL DESCRIPTION:
; 6038 !
; 6039 ! This routine will output the message that is going to be sent
; 6040 ! as part of the debugging information that is turned on in the
; 6041 ! SET DEBUG command.
; 6042 !
; 6043 ! CALLING SEQUENCE:
; 6044 !
; 6045 ! DBG_SEND(MSG_ADDRESS, MSG_LENGTH);
; 6046 !
; 6047 ! INPUT PARAMETERS:
; 6048 !
; 6049 ! MSG_ADDRESS - Address of the message that is going to be sent
; 6050 ! to the remote KERMIT. The bytes are CHR_SIZE.
; 6051 ! MSG_LENGTH - Length of the message.
; 6052 !
; 6053 ! IMPLICIT INPUTS:
; 6054 !
; 6055 ! None.
; 6056 !
; 6057 ! OUTPUT PARAMETERS:
; 6058 !
; 6059 ! None.
; 6060 !
; 6061 ! IMPLICIT OUTPUTS:
; 6062 !
; 6063 ! None.
; 6064 !
; 6065 ! COMPLETION CODES:
; 6066 !
; 6067 ! None.
; 6068 !
; 6069 ! SIDE EFFECTS:
; 6070 !
; 6071 ! None.
; 6072 !
; 6073 !--
; 6074
; 6075 BEGIN
; 6076
; 6077 BIND
; 6078 SEND_TEXT = UPLIT (%ASCIZ'Sending...');
; 6079
; 6080 IF .DEBUG_FLAG
; 6081 THEN
; 6082 BEGIN
; 6083
; 6084 LOCAL
; 6085 OLD_RTN;
; 6086
; 6087 OLD_RTN = TT_SET_OUTPUT (DBG_DUMP);
; 6088 TT_TEXT (SEND_TEXT);
; 6089 DBG_MESSAGE (.ADDRESS, .LENGTH);
; 6090 TT_SET_OUTPUT (.OLD_RTN);
; 6091 END;
; 6092
; 6093 END; ! End of DBG_SEND
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.ABJ: .ASCII /Sen/
.ASCII /din/
.ASCII /g../
.ASCII /./<00><00>
; SEND.TEXT
U.125= P.ABJ
.SBTTL DBG.SEND Debugging -- DBG_SEND
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; DBG.SEND
U.34: MOV R1,-(SP) ; 6034
BIT #1,DEBUG.FLAG ; 6080
BEQ 1$
MOV #DBG.DUMP,-(SP) ; 6087
JSR PC,TT.SET.OUTPUT
MOV R0,R1 ; *,OLD.RTN
MOV #U.125,(SP) ; 6088
JSR PC,TT.TEXT
MOV 10(SP),(SP) ; ADDRESS,* 6089
MOV 6(SP),-(SP) ; LENGTH,*
JSR PC,U.33
MOV R1,(SP) ; OLD.RTN,* 6090
JSR PC,TT.SET.OUTPUT
CMP (SP)+,(SP)+ ; 6082
1$: MOV (SP)+,R1 ; 6034
RTS PC
; Routine Size: 26 words, Routine Base: $CODE$ + 23000
; Maximum stack depth per invocation: 4 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 6094 %SBTTL 'Debugging -- DBG_RECEIVE'
; 6095 ROUTINE DBG_RECEIVE (ADDRESS) : NOVALUE =
; 6096
; 6097 !++
; 6098 ! FUNCTIONAL DESCRIPTION:
; 6099 !
; 6100 ! This routine will output the message that was received from
; 6101 ! the remote KERMIT. This routine is called only if the DEBUG_FLAG
; 6102 ! is true.
; 6103 !
; 6104 ! CALLING SEQUENCE:
; 6105 !
; 6106 ! DBG_RECEIVE(MSG_ADDRESS);
; 6107 !
; 6108 ! INPUT PARAMETERS:
; 6109 !
; 6110 ! MSG_ADDRESS - Address of the message received by the remote KERMIT.
; 6111 !
; 6112 ! IMPLICIT INPUTS:
; 6113 !
; 6114 ! None.
; 6115 !
; 6116 ! OUTPUT PARAMETERS:
; 6117 !
; 6118 ! None.
; 6119 !
; 6120 ! IMPLICIT OUTPUTS:
; 6121 !
; 6122 ! None.
; 6123 !
; 6124 ! COMPLETION CODES:
; 6125 !
; 6126 ! None.
; 6127 !
; 6128 ! SIDE EFFECTS:
; 6129 !
; 6130 ! None.
; 6131 !
; 6132 !--
; 6133
; 6134 BEGIN
; 6135
; 6136 BIND
; 6137 RECEIVE_TEXT = UPLIT (%ASCIZ'Received...');
; 6138
; 6139 IF .DEBUG_FLAG
; 6140 THEN
; 6141 BEGIN
; 6142
; 6143 LOCAL
; 6144 OLD_RTN;
; 6145
; 6146 OLD_RTN = TT_SET_OUTPUT (DBG_DUMP);
; 6147 TT_TEXT (RECEIVE_TEXT);
; 6148 DBG_MESSAGE (.ADDRESS, .REC_LENGTH);
; 6149 TT_SET_OUTPUT (.OLD_RTN);
; 6150 END;
; 6151
; 6152 END; ! End of DBG_RECEIVE
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.ABK: .ASCII /Rec/
.ASCII /eiv/
.ASCII /ed./
.ASCII /../<00>
; RECEIVE.TEXT
U.126= P.ABK
.SBTTL DBG.RECEIVE Debugging -- DBG_RECEIVE
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; DBG.RECEIVE
U.35: MOV R1,-(SP) ; 6095
BIT #1,DEBUG.FLAG ; 6139
BEQ 1$
MOV #DBG.DUMP,-(SP) ; 6146
JSR PC,TT.SET.OUTPUT
MOV R0,R1 ; *,OLD.RTN
MOV #U.126,(SP) ; 6147
JSR PC,TT.TEXT
MOV 6(SP),(SP) ; ADDRESS,* 6148
MOV U.80,-(SP)
JSR PC,U.33
MOV R1,(SP) ; OLD.RTN,* 6149
JSR PC,TT.SET.OUTPUT
CMP (SP)+,(SP)+ ; 6141
1$: MOV (SP)+,R1 ; 6095
RTS PC
; Routine Size: 26 words, Routine Base: $CODE$ + 23064
; Maximum stack depth per invocation: 4 words
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 6153 %SBTTL 'Debugging -- DBG_MESSAGE'
; 6154 ROUTINE DBG_MESSAGE (MSG_ADDRESS, MSG_LENGTH) : NOVALUE =
; 6155
; 6156 !++
; 6157 ! FUNCTIONAL DESCRIPTION:
; 6158 !
; 6159 ! This routine will display a message that is either being sent
; 6160 ! or received on the user's terminal.
; 6161 !
; 6162 ! CALLING SEQUENCE:
; 6163 !
; 6164 ! DBG_MESSAGE(MSG_ADDRESS, MSG_LENGTH);
; 6165 !
; 6166 ! INPUT PARAMETERS:
; 6167 !
; 6168 ! MSG_ADDRESS - Address of the message to be output
; 6169 ! MSG_LENGTH - Length of the message to be output.
; 6170 !
; 6171 ! IMPLICIT INPUTS:
; 6172 !
; 6173 ! None.
; 6174 !
; 6175 ! OUTPUT PARAMETERS:
; 6176 !
; 6177 ! None.
; 6178 !
; 6179 ! IMPLICIT OUTPUTS:
; 6180 !
; 6181 ! None.
; 6182 !
; 6183 ! COMPLETION CODES:
; 6184 !
; 6185 ! None.
; 6186 !
; 6187 ! SIDE EFFECTS:
; 6188 !
; 6189 ! None.
; 6190 !
; 6191 !--
; 6192
; 6193 BEGIN
; 6194
; 6195 MAP
; 6196 MSG_ADDRESS : REF VECTOR [CH$ALLOCATION (MAX_MSG, CHR_SIZE)]; ! Point to the vector
; 6197
; 6198 LOCAL
; 6199 OLD_RTN, ! Old type out routine
; 6200 CHKSUM, ! Numeric value of block check
; 6201 TEMP_POINTER, ! Temporary character pointer
; 6202 MSG_LEN;
; 6203
; 6204 !
; 6205 ! Message type text
; 6206 !
; 6207
; 6208 BIND
; 6209 DATA_TEXT = UPLIT (%ASCIZ' (Data)'),
; 6210 ACK_TEXT = UPLIT (%ASCIZ' (ACK)'),
; 6211 NAK_TEXT = UPLIT (%ASCIZ' (NAK)'),
; 6212 SND_INIT_TEXT = UPLIT (%ASCIZ' (Send init)'),
; 6213 BREAK_TEXT = UPLIT (%ASCIZ' (Break)'),
; 6214 TEXT_TEXT = UPLIT (%ASCIZ' (Text header)'),
; 6215 FILE_TEXT = UPLIT (%ASCIZ' (File header)'),
; 6216 EOF_TEXT = UPLIT (%ASCIZ' (EOF)'),
; 6217 ERROR_TEXT = UPLIT (%ASCIZ' (Error)'),
; 6218 RCV_INIT_TEXT = UPLIT (%ASCIZ' (Receive initiate)'),
; 6219 COMMAND_TEXT = UPLIT (%ASCIZ' (Command)'),
; 6220 KERMIT_TEXT = UPLIT (%ASCIZ' (Generic KERMIT command)');
; 6221
; 6222 !
; 6223 ! Header information
; 6224 !
; 6225
; 6226 BIND
; 6227 MN_TEXT = UPLIT (%ASCIZ'Message number: '),
; 6228 LENGTH_TEXT = UPLIT (%ASCIZ' Length: '),
; 6229 DEC_TEXT = UPLIT (%ASCIZ' (dec)'),
; 6230 MSG_TYP_TEXT = UPLIT (%ASCIZ'Message type: '),
; 6231 CHKSUM_TEXT = UPLIT (%ASCIZ'Checksum: '),
; 6232 CHKSUM_NUM_TEXT = UPLIT (%ASCIZ' = '),
; 6233 OPT_DATA_TEXT = UPLIT (%ASCIZ'Optional data: '),
; 6234 PRE_CHAR_TEXT = UPLIT (%ASCIZ' "');
; 6235
; 6236 !
; 6237 ! Ensure that the type out will go to the debugging location
; 6238 !
; 6239 OLD_RTN = TT_SET_OUTPUT (DBG_DUMP);
; 6240 !
; 6241 ! Preliminary calculations
; 6242 !
; 6243 MSG_LEN = UNCHAR (CH$RCHAR (CH$PTR (.MSG_ADDRESS, PKT_COUNT, CHR_SIZE)));
; 6244 !
; 6245 ! First output some header information for the packet.
; 6246 !
; 6247 TT_CRLF ();
; 6248 TT_TEXT (MN_TEXT);
; 6249 TT_NUMBER (UNCHAR (CH$RCHAR (CH$PTR (.MSG_ADDRESS, PKT_SEQ, CHR_SIZE))));
; 6250 TT_TEXT (DEC_TEXT);
; 6251 TT_TEXT (LENGTH_TEXT);
; 6252 TT_NUMBER (.MSG_LEN);
; 6253 TT_TEXT (DEC_TEXT);
; 6254 TT_CRLF ();
; 6255 !
; 6256 ! Now output the message type and dependent information
; 6257 !
; 6258 TT_TEXT (MSG_TYP_TEXT);
; 6259 TT_CHAR (CH$RCHAR (CH$PTR (.MSG_ADDRESS, PKT_TYPE, CHR_SIZE)));
; 6260
; 6261 SELECTONE CH$RCHAR (CH$PTR (.MSG_ADDRESS, PKT_TYPE, CHR_SIZE)) OF
; 6262 SET
; 6263
; 6264 [MSG_DATA] :
; 6265 TT_TEXT (DATA_TEXT);
; 6266
; 6267 [MSG_ACK] :
; 6268 TT_TEXT (ACK_TEXT);
; 6269
; 6270 [MSG_NAK] :
; 6271 TT_TEXT (NAK_TEXT);
; 6272
; 6273 [MSG_SND_INIT] :
; 6274 TT_TEXT (SND_INIT_TEXT);
; 6275
; 6276 [MSG_BREAK] :
; 6277 TT_TEXT (BREAK_TEXT);
; 6278
; 6279 [MSG_FILE] :
; 6280 TT_TEXT (FILE_TEXT);
; 6281
; 6282 [MSG_TEXT] :
; 6283 TT_TEXT (TEXT_TEXT);
; 6284
; 6285 [MSG_EOF] :
; 6286 TT_TEXT (EOF_TEXT);
; 6287
; 6288 [MSG_ERROR] :
; 6289 TT_TEXT (ERROR_TEXT);
; 6290
; 6291 [MSG_KERMIT] :
; 6292 TT_TEXT (KERMIT_TEXT);
; 6293
; 6294 [MSG_COMMAND] :
; 6295 TT_TEXT (COMMAND_TEXT);
; 6296 TES;
; 6297
; 6298 TT_CRLF ();
; 6299 !
; 6300 ! Now output any of the optional data.
; 6301 !
; 6302
; 6303 IF .MSG_LEN - PKT_OVR_HEAD - (.BLK_CHK_TYPE - CHK_1CHAR) NEQ 0
; 6304 THEN
; 6305 BEGIN
; 6306 TT_TEXT (OPT_DATA_TEXT);
; 6307 TT_CRLF ();
; 6308 TEMP_POINTER = CH$PTR (.MSG_ADDRESS, PKT_MSG, CHR_SIZE);
; 6309
; 6310 INCR I FROM 1 TO .MSG_LEN - PKT_OVR_HEAD - (.BLK_CHK_TYPE - CHK_1CHAR) DO
; 6311 BEGIN
; 6312
; 6313 IF (.I MOD 10) EQL 1
; 6314 THEN
; 6315 BEGIN
; 6316 TT_CRLF ();
; 6317 TT_CHAR (CHR_TAB);
; 6318 END;
; 6319
; 6320 TT_TEXT (PRE_CHAR_TEXT);
; 6321 TT_CHAR (CH$RCHAR_A (TEMP_POINTER));
; 6322 TT_CHAR (%C'"');
; 6323 END;
; 6324
; 6325 IF ((.MSG_LEN - PKT_OVR_HEAD - (.BLK_CHK_TYPE - CHK_1CHAR)) MOD 10) EQL 1 THEN TT_CRLF ();
; 6326
; 6327 TT_CRLF ();
; 6328 END;
; 6329
; 6330 !
; 6331 ! Now output the checksum for the message that we received
; 6332 !
; 6333 ! This could be either 1 two or three characters.
; 6334 TT_TEXT (CHKSUM_TEXT);
; 6335 TEMP_POINTER = CH$PTR (.MSG_ADDRESS,
; 6336 PKT_MSG + .MSG_LEN + PKT_CHKSUM - PKT_OVR_HEAD - (.BLK_CHK_TYPE - CHK_1CHAR), CHR_SIZE);
; 6337
; 6338 CASE .BLK_CHK_TYPE FROM CHK_1CHAR TO CHK_CRC OF
; 6339 SET
; 6340
; 6341 [CHK_1CHAR] :
; 6342 BEGIN
; 6343 TT_TEXT (PRE_CHAR_TEXT);
; 6344 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6345 TT_CHAR (%C'"');
; 6346 CHKSUM = UNCHAR (CH$RCHAR (.TEMP_POINTER));
; 6347 END;
; 6348
; 6349 [CHK_2CHAR] :
; 6350 BEGIN
; 6351 CHKSUM = 0;
; 6352 TT_TEXT (PRE_CHAR_TEXT);
; 6353 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6354 TT_CHAR (%C'"');
; 6355 CHKSUM<6, 6> = UNCHAR (CH$RCHAR_A (TEMP_POINTER));
; 6356 TT_TEXT (PRE_CHAR_TEXT);
; 6357 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6358 TT_CHAR (%C'"');
; 6359 CHKSUM<0, 6> = UNCHAR (CH$RCHAR (.TEMP_POINTER));
; 6360 END;
; 6361
; 6362 [CHK_CRC] :
; 6363 BEGIN
; 6364 CHKSUM = 0;
; 6365 TT_TEXT (PRE_CHAR_TEXT);
; 6366 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6367 TT_CHAR (%C'"');
; 6368 CHKSUM<12, 4> = UNCHAR (CH$RCHAR_A (TEMP_POINTER));
; 6369 TT_TEXT (PRE_CHAR_TEXT);
; 6370 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6371 TT_CHAR (%C'"');
; 6372 CHKSUM<6, 6> = UNCHAR (CH$RCHAR_A (TEMP_POINTER));
; 6373 TT_TEXT (PRE_CHAR_TEXT);
; 6374 TT_CHAR (CH$RCHAR (.TEMP_POINTER));
; 6375 TT_CHAR (%C'"');
; 6376 CHKSUM<0, 6> = UNCHAR (CH$RCHAR (.TEMP_POINTER));
; 6377 END;
; 6378 TES;
; 6379
; 6380 TT_TEXT (CHKSUM_NUM_TEXT);
; 6381 TT_NUMBER (.CHKSUM);
; 6382 TT_TEXT (DEC_TEXT);
; 6383 TT_CRLF ();
; 6384 TT_SET_OUTPUT (.OLD_RTN); ! Reset output destination
; 6385 END; ! End of DBG_MESSAGE
.NLIST
.LIST BIN,LOC
.LIST
.PSECT $PLIT$, RO , D
P.ABL: .ASCII / (D/
.ASCII /ata/
.ASCII /)/<00>
P.ABM: .ASCII / (A/
.ASCII /CK)/
.ASCII <00><00>
P.ABN: .ASCII / (N/
.ASCII /AK)/
.ASCII <00><00>
P.ABO: .ASCII / (S/
.ASCII /end/
.ASCII / in/
.ASCII /it)/
.ASCII <00><00>
P.ABP: .ASCII / (B/
.ASCII /rea/
.ASCII /k)/<00>
.ASCII <00>
P.ABQ: .ASCII / (T/
.ASCII /ext/
.ASCII / he/
.ASCII /ade/
.ASCII /r)/<00>
.ASCII <00>
P.ABR: .ASCII / (F/
.ASCII /ile/
.ASCII / he/
.ASCII /ade/
.ASCII /r)/<00>
.ASCII <00>
P.ABS: .ASCII / (E/
.ASCII /OF)/
.ASCII <00><00>
P.ABT: .ASCII / (E/
.ASCII /rro/
.ASCII /r)/<00>
.ASCII <00>
P.ABU: .ASCII / (R/
.ASCII /ece/
.ASCII /ive/
.ASCII / in/
.ASCII /iti/
.ASCII /ate/
.ASCII /)/<00>
P.ABV: .ASCII / (C/
.ASCII /omm/
.ASCII /and/
.ASCII /)/<00><00>
P.ABW: .ASCII / (G/
.ASCII /ene/
.ASCII /ric/
.ASCII / KE/
.ASCII /RMI/
.ASCII /T c/
.ASCII /omm/
.ASCII /and/
.ASCII /)/<00>
P.ABX: .ASCII /Mes/
.ASCII /sag/
.ASCII /e n/
.ASCII /umb/
.ASCII /er:/
.ASCII / /<00><00>
P.ABY: .ASCII <11>/Le/
.ASCII /ngt/
.ASCII /h: /
.ASCII <00>
P.ABZ: .ASCII / (d/
.ASCII /ec)/
.ASCII <00><00>
P.ACA: .ASCII /Mes/
.ASCII /sag/
.ASCII /e t/
.ASCII /ype/
.ASCII /: /<00>
.ASCII <00>
P.ACB: .ASCII /Che/
.ASCII /cks/
.ASCII /um:/
.ASCII / /<00><00>
P.ACC: .ASCII / = /
.ASCII <00>
P.ACD: .ASCII /Opt/
.ASCII /ion/
.ASCII /al /
.ASCII /dat/
.ASCII /a: /
.ASCII <00>
P.ACE: .ASCII / "/<00>
.ASCII <00>
; DATA.TEXT
U.128= P.ABL
; ACK.TEXT
U.129= P.ABM
; NAK.TEXT
U.130= P.ABN
; SND.INIT.TEXT
U.131= P.ABO
; BREAK.TEXT
U.132= P.ABP
; TEXT.TEXT
U.133= P.ABQ
; FILE.TEXT
U.134= P.ABR
; EOF.TEXT
U.135= P.ABS
; ERROR.TEXT
U.136= P.ABT
; RCV.INIT.TEXT
U.137= P.ABU
; COMMAND.TEXT
U.138= P.ABV
; KERMIT.TEXT
U.139= P.ABW
; MN.TEXT
U.140= P.ABX
; LENGTH.TEXT
U.141= P.ABY
; DEC.TEXT
U.142= P.ABZ
; MSG.TYP.TEXT
U.143= P.ACA
; CHKSUM.TEXT
U.144= P.ACB
; CHKSUM.NUM.TEXT
U.145= P.ACC
; OPT.DATA.TEXT
U.146= P.ACD
; PRE.CHAR.TEXT
U.147= P.ACE
.SBTTL DBG.MESSAGE Debugging -- DBG_MESSAGE
.PSECT $CODE$, RO
.NLIST
.ENABL LSB
.LIST
; DBG.MESSAGE
U.33: JSR R1,$SAVE5 ; 6154
SUB #6,SP
MOV #DBG.DUMP,-(SP) ; 6239
JSR PC,TT.SET.OUTPUT
MOV R0,4(SP) ; *,OLD.RTN
MOV 30(SP),R2 ; MSG.ADDRESS,* 6243
MOVB 1(R2),2(SP) ; *,MSG.LEN
CLRB 3(SP) ; MSG.LEN
SUB #40,2(SP) ; *,MSG.LEN
JSR PC,TT.CRLF ; 6247
MOV #U.140,(SP) ; 6248
JSR PC,TT.TEXT
CLR (SP) ; 6249
MOVB 2(R2),(SP)
SUB #40,(SP)
JSR PC,TT.NUMBER
MOV #U.142,(SP) ; 6250
JSR PC,TT.TEXT
MOV #U.141,(SP) ; 6251
JSR PC,TT.TEXT
MOV 2(SP),(SP) ; MSG.LEN,* 6252
JSR PC,TT.NUMBER
MOV #U.142,(SP) ; 6253
JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 6254
MOV #U.143,(SP) ; 6258
JSR PC,TT.TEXT
CLR R1 ; 6259
BISB 3(R2),R1
MOV R1,(SP)
JSR PC,TT.CHAR
CMP R1,#104 ; 6261
BNE 1$
MOV #U.128,(SP) ; 6265
BR 11$
1$: CMP R1,#131 ; 6261
BNE 2$
MOV #U.129,(SP) ; 6268
BR 11$
2$: CMP R1,#116 ; 6261
BNE 3$
MOV #U.130,(SP) ; 6271
BR 11$
3$: CMP R1,#123 ; 6261
BNE 4$
MOV #U.131,(SP) ; 6274
BR 11$
4$: CMP R1,#102 ; 6261
BNE 5$
MOV #U.132,(SP) ; 6277
BR 11$
5$: CMP R1,#106 ; 6261
BNE 6$
MOV #U.134,(SP) ; 6280
BR 11$
6$: CMP R1,#130 ; 6261
BNE 7$
MOV #U.133,(SP) ; 6283
BR 11$
7$: CMP R1,#132 ; 6261
BNE 8$
MOV #U.135,(SP) ; 6286
BR 11$
8$: CMP R1,#105 ; 6261
BNE 9$
MOV #U.136,(SP) ; 6289
BR 11$
9$: CMP R1,#107 ; 6261
BNE 10$
MOV #U.139,(SP) ; 6292
BR 11$
10$: CMP R1,#103 ; 6261
BNE 12$
MOV #U.138,(SP) ; 6295
11$: JSR PC,TT.TEXT
12$: JSR PC,TT.CRLF ; 6298
MOV 2(SP),R4 ; MSG.LEN,* 6303
SUB #3,R4
MOV U.71,R0
SUB #61,R0
CMP R4,R0
BEQ 17$
MOV #U.146,(SP) ; 6306
JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 6307
MOV #4,R5 ; *,TEMP.POINTER 6308
ADD R2,R5 ; *,TEMP.POINTER
MOV R4,R1 ; 6310
SUB U.71,R1
MOV R1,6(SP)
ADD #61,6(SP)
CLR R3 ; I
BR 15$
13$: MOV R3,R1 ; I,* 6313
SXT R0
DIV #12,R0
CMP R1,#1
BNE 14$
JSR PC,TT.CRLF ; 6316
MOV #11,(SP) ; 6317
JSR PC,TT.CHAR
14$: MOV #U.147,(SP) ; 6320
JSR PC,TT.TEXT
CLR (SP) ; 6321
MOVB (R5)+,(SP) ; TEMP.POINTER,*
JSR PC,TT.CHAR
MOV #42,(SP) ; 6322
JSR PC,TT.CHAR
15$: INC R3 ; I 6310
CMP R3,6(SP) ; I,*
BLE 13$
MOV R4,R1 ; 6325
SUB U.71,R1
ADD #61,R1
SXT R0
DIV #12,R0
CMP R1,#1
BNE 16$
JSR PC,TT.CRLF
16$: JSR PC,TT.CRLF ; 6327
17$: MOV #U.144,(SP) ; 6334
JSR PC,TT.TEXT
MOV 2(SP),R1 ; MSG.LEN,* 6336
SUB U.71,R1
ADD R2,R1
MOV R1,R5 ; *,TEMP.POINTER
ADD #62,R5 ; *,TEMP.POINTER
MOV U.71,R0 ; 6338
SUB #61,R0
ASL R0
ADD P.ACF(R0),PC ; Case dispatch
19$: MOV #U.147,(SP) ; 6343
JSR PC,TT.TEXT
CLR (SP) ; 6344
MOVB (R5),(SP) ; TEMP.POINTER,*
JSR PC,TT.CHAR
MOV #42,(SP) ; 6345
JSR PC,TT.CHAR
CLR R1 ; CHKSUM 6346
BISB (R5),R1 ; TEMP.POINTER,CHKSUM
SUB #40,R1 ; *,CHKSUM
BR 23$ ; 6338
20$: CLR R1 ; CHKSUM 6351
BR 22$ ; 6352
21$: CLR R1 ; CHKSUM 6364
MOV #U.147,(SP) ; 6365
JSR PC,TT.TEXT
CLR (SP) ; 6366
MOVB (R5),(SP) ; TEMP.POINTER,*
JSR PC,TT.CHAR
MOV #42,(SP) ; 6367
JSR PC,TT.CHAR
CLR R0 ; 6368
BISB (R5)+,R0 ; TEMP.POINTER,*
SUB #40,R0
ASH #14,R0
BIC #170000,R1 ; *,CHKSUM
BIS R0,R1 ; *,CHKSUM
22$: MOV #U.147,(SP) ; 6369
JSR PC,TT.TEXT
CLR (SP) ; 6370
MOVB (R5),(SP) ; TEMP.POINTER,*
JSR PC,TT.CHAR
MOV #42,(SP) ; 6371
JSR PC,TT.CHAR
CLR R0 ; 6372
BISB (R5)+,R0 ; TEMP.POINTER,*
SUB #40,R0
ASH #6,R0
BIC #170077,R0
BIC #7700,R1 ; *,CHKSUM
BIS R0,R1 ; *,CHKSUM
MOV #U.147,(SP) ; 6373
JSR PC,TT.TEXT
CLR (SP) ; 6374
MOVB (R5),(SP) ; TEMP.POINTER,*
JSR PC,TT.CHAR
MOV #42,(SP) ; 6375
JSR PC,TT.CHAR
CLR R0 ; 6376
BISB (R5),R0 ; TEMP.POINTER,*
SUB #40,R0
BIC #177700,R0
BICB #77,R1 ; *,CHKSUM
BIS R0,R1 ; *,CHKSUM
23$: MOV #U.145,(SP) ; 6380
JSR PC,TT.TEXT
MOV R1,(SP) ; CHKSUM,* 6381
JSR PC,TT.NUMBER
MOV #U.142,(SP) ; 6382
JSR PC,TT.TEXT
JSR PC,TT.CRLF ; 6383
MOV 4(SP),(SP) ; OLD.RTN,* 6384
JSR PC,TT.SET.OUTPUT
ADD #10,SP ; 6154
RTS PC
; Routine Size: 327 words, Routine Base: $CODE$ + 23150
; Maximum stack depth per invocation: 11 words
.PSECT $PLIT$, RO , D
P.ACF: ; CASE Table for DBG.MESSAGE+0670 6338
18$: .WORD 0 ; [19$]
.WORD 42 ; [20$]
.WORD 46 ; [21$]
.NLIST
.DSABL LSB
.NLIST BIN,LOC
.LIST
; 6386 %SBTTL 'End of KERMSG'
; 6387 END
; 6388
; 6389 ELUDOM
.NLIST
.LIST BIN,LOC
.LIST
; OTS external references
.GLOBL $SAVE5, $SAVE4, $SAVE3, $SAVE2
.GLOBL BL$ABS, BL$FIL, BL$CPY, BL$MOV
; PSECT SUMMARY
;
; Psect Name Words ; Attributes
; $OWN$ 147 ; RW , D , LCL, REL, CON
; $CODE$ 5243 ; RO , I , LCL, REL, CON
; $PLIT$ 480 ; RO , D , LCL, REL, CON
; Compilation Complete
.END