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