home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
k10mit-135.tar.gz
/
k10mit-135.tar
/
k10mit-135
/
k10msg.mac
< prev
next >
Wrap
Text File
|
2001-06-19
|
342KB
|
11,400 lines
; 0001 0 %TITLE 'KERMSG - Kermit message processing'
; 0002 0 MODULE KERMSG (IDENT = '3.3.108'
; 0003 0 ) =
; 0004 1 BEGIN
; 0005 1
; 0006 1 SWITCHES LANGUAGE (COMMON);
; 0007 1
; 0008 1 !<BLF/WIDTH:100>
; 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 ! 3.1.045 BY: David Stevens On: 15-July-1985
; 0278 1 ! Fix terminal message for multiple file sendings. Type out
; 0279 1 ! "Sending: " in the system dependent NEXT%FILE routine.
; 0280 1 !
; 0281 1 ! Start of version 3.2
; 0282 1 !
; 0283 1 ! 3.2.070 By: Robert McQueen On: 17-Dec-1985
; 0284 1 ! Fix CRC calculations when sending 8 bit data and not
; 0285 1 ! using 8 bit quoting.
; 0286 1 !
; 0287 1 ! 3.2.071 By: Robert McQueen On: 11-March-186
; 0288 1 ! Include space in the message buffer for the line termination
; 0289 1 ! character.
; 0290 1 !
; 0291 1 ! 3.3.100 By: Gregory P. Welsh On: 1-June-1986
; 0292 1 ! Made FILE%OPEN%FLAG GLOBAL so it could be updated properly for
; 0293 1 ! Transmit function from module KERTRM. Also renamed it to
; 0294 1 ! FFILE%OPEN%FLAG so it could be distinguished externally from
; 0295 1 ! routine FILE%OPEN.
; 0296 1 !
; 0297 1 ! 3.3.104 By: Robert McQueen On: 5-July-1986
; 0298 1 ! Add changes/fixes suggested by Art Guion and David Deley for
; 0299 1 ! KERMSG.BLI.
; 0300 1 ! - Always attempt a handshake in IBM mode. Failing to handshake
; 0301 1 ! may cause 3704/5 style controller to hang a VM system.
; 0302 1 ! - Don't lose the last character in a buffer. BFR%FILL logic
; 0303 1 ! forgets to send the last cahracters of a file when it doesn't
; 0304 1 ! fit into the current packet.
; 0305 1 !
; 0306 1 ! 3.3.107 By: Antonino N. Mione On: 8-Sep-1986
; 0307 1 ! Do not abort on ERROR packet while in SERVER mode. Instead,
; 0308 1 ! return to SERVER IDLE mode.
; 0309 1 !
; 0310 1 ! 3.3.108 By: Dan Norstedt On: 17-June-1989
; 0311 1 ! Added sketchy support for Extended Length packets;
; 0312 1 ! Header parity is computed, but not used.
; 0313 1 ! Undone 3.3.107, to allow for Ctrl-Cs to work properly
; 0314 1 !--
; 0315 1
; 0316 1 %SBTTL 'Interface requirements'
; 0317 1
; 0318 1 !++
; 0319 1 ! Interface requirements
; 0320 1 !
; 0321 1 ! The following routines and data locations are rquired for a correct
; 0322 1 ! implementation of KERMIT.
; 0323 1 !
; 0324 1 ! File routines:
; 0325 1 !
; 0326 1 ! FILE%OPEN (Function)
; 0327 1 ! This routine will open a file for reading or writting. It
; 0328 1 ! will assume that FILE%SIZE contains the number of bytes
; 0329 1 ! and FILE%NAME contains the file name of length FILE%SIZE.
; 0330 1 ! The function that is passed is either FNC%READ or FNC%WRITE.
; 0331 1 !
; 0332 1 ! FILE%CLOSE ()
; 0333 1 ! This routine will close the currently open file. This
; 0334 1 ! routine will return the status of the operation.
; 0335 1 !
; 0336 1 ! GET%FILE (Character)
; 0337 1 ! This routine will get a character from the currently open file
; 0338 1 ! and store it in the location specified by "Character". There
; 0339 1 ! will be a true/false value returned by the routine to determine
; 0340 1 ! if there was an error.
; 0341 1 !
; 0342 1 ! PUT%FILE (Character)
; 0343 1 ! This routine will output a character to the currently open
; 0344 1 ! file. It will return a true/false value to determine if the
; 0345 1 ! routine was successful.
; 0346 1 !
; 0347 1 ! NEXT%FILE ()
; 0348 1 ! This routine will advance to the next file. This routine
; 0349 1 ! will return false if there are no more files to process.
; 0350 1 !
; 0351 1 ! Communications line routines:
; 0352 1 !
; 0353 1 ! RECEIVE (Buffer address, Address of var to store length into)
; 0354 1 ! This routine will receive a message from the remote Kermit.
; 0355 1 !
; 0356 1 ! SEND (Buffer address, Length in characters)
; 0357 1 ! This routine will send a message to the remote Kermit.
; 0358 1 !
; 0359 1 ! GEN%CRC (Buffer address, length in characters)
; 0360 1 ! This routine will calculate the CRC-CCITT for the characters
; 0361 1 ! in the buffer.
; 0362 1 !
; 0363 1 ! Operating system routines:
; 0364 1 !
; 0365 1 ! SY%DISMISS (Seconds)
; 0366 1 ! This routine will cause Kermit to sleep for the specified
; 0367 1 ! number of seconds. It is used to handle the DELAY parameter.
; 0368 1 !
; 0369 1 ! SY%LOGOUT ()
; 0370 1 ! Log the job off of the system. (Kill the process).
; 0371 1 !
; 0372 1 ! SY%TIME ()
; 0373 1 ! This routine will return the starting time milliseconds.
; 0374 1 ! It can be the start of Kermit, the system, etc, so long
; 0375 1 ! as it always is incrementing.
; 0376 1 !
; 0377 1 ! Status routines:
; 0378 1 !
; 0379 1 ! XFR%STATUS (Type, Subtype);
; 0380 1 ! This routine is called to indicate the occurance of
; 0381 1 ! a significant event that the user interface may wish
; 0382 1 ! to inform the user about. The arguments indicate the
; 0383 1 ! type of event.
; 0384 1 ! Type: "S" - Send, "R" - Receive
; 0385 1 ! Subtype: "P" - Packet
; 0386 1 ! "N" - NAK
; 0387 1 ! "T" - timeout
; 0388 1 ! For type = "I" (initiate), "T" (terminate):
; 0389 1 ! Subtype: "S" - a file send
; 0390 1 ! "R" - a file receive
; 0391 1 ! "G" - a generic command
; 0392 1 ! "I" - for "T" only, returning to server idle
; 0393 1 ! For type = "F" (file operation):
; 0394 1 ! Subtype: "S" - open for sending
; 0395 1 ! "R" - open for receiving
; 0396 1 ! "C" - closing file OK
; 0397 1 ! "X" - aborting file by user request
; 0398 1 ! "Z" - aborting group by user request
; 0399 1 ! "D" - aborting file, but saving due to disposition
; 0400 1 ! "A" - aborting file due to protocol error
; 0401 1 !
; 0402 1 ! Error processing:
; 0403 1 !
; 0404 1 ! KRM%ERROR (Error parameter)
; 0405 1 ! This routine will cause an error message to be issued.
; 0406 1 ! The error parameter is defined by KERERR. This may cause
; 0407 1 ! SND%ERROR to be called to send an "E" message to the remote.
; 0408 1 !
; 0409 1 ! Terminal I/O routines:
; 0410 1 !
; 0411 1 ! TERM%DUMP (Buffer, Count)
; 0412 1 ! DBG%DUMP (Buffer, Count)
; 0413 1 ! This routine will dump the buffer onto the user's terminal.
; 0414 1 ! The routine is supplied with the count of the characters
; 0415 1 ! and the address of the buffer.
; 0416 1 ! These may be the same routine or different. DBG%DUMP
; 0417 1 ! is only called for debugging output.
; 0418 1 !
; 0419 1 !
; 0420 1 ! ENTRY POINTS
; 0421 1 !
; 0422 1 ! KERMSG contains the following entry points for the KERMIT.
; 0423 1 !
; 0424 1 ! SERVER ()
; 0425 1 ! This routine will cause KERMIT go enter server mode.
; 0426 1 !
; 0427 1 ! SEND%SWITCH ()
; 0428 1 ! This routine will send a file. It expects that the user
; 0429 1 ! has stored the text of the file name into FILE%NAME and
; 0430 1 ! the length of the text into FILE%SIZE.
; 0431 1 !
; 0432 1 ! REC%SWITCH ()
; 0433 1 ! This routine will receive a file. It expects that the default
; 0434 1 ! file name is set up in FILE%NAME and the length is in
; 0435 1 ! FILE%SIZE.
; 0436 1 !
; 0437 1 ! GEN%PARITY (Character)
; 0438 1 ! This routine will return the character with the proper parity
; 0439 1 ! on the character.
; 0440 1 !
; 0441 1 ! SND%ERROR (COUNT, ADDRESS)
; 0442 1 ! This routine will send the text of an error to the remote
; 0443 1 ! Kermit.
; 0444 1 !
; 0445 1 ! DO%GENERIC (TYPE)
; 0446 1 ! This routine will cause a generic function to be sent to
; 0447 1 ! the remote Kermit. This routine will then do all of the
; 0448 1 ! necessary hand shaking to handle the local end of the generic
; 0449 1 ! Kermit command.
; 0450 1 !
; 0451 1 !
; 0452 1 ! GLOBAL Storage
; 0453 1 !
; 0454 1 ! The following are the global storage locations that are used to interface
; 0455 1 ! to KERMSG. These locations contains the various send and receive parameters.
; 0456 1 !
; 0457 1 ! Receive parameters:
; 0458 1 !
; 0459 1 ! RCV%PKT%SIZE
; 0460 1 ! Receive packet size.
; 0461 1 ! RCV%NPAD
; 0462 1 ! Padding length
; 0463 1 ! RCV%PADCHAR
; 0464 1 ! Padding character
; 0465 1 ! RCV%TIMEOUT
; 0466 1 ! Time out
; 0467 1 ! RCV%EOL
; 0468 1 ! End of line character
; 0469 1 ! RCV%QUOTE%CHR
; 0470 1 ! Quote character
; 0471 1 ! RCV%8QUOTE%CHR
; 0472 1 ! 8-bit quoting character
; 0473 1 ! RCV%SOH
; 0474 1 ! Start of header character
; 0475 1 !
; 0476 1 ! Send parameters (Negative values denote the default, positive user supplied):
; 0477 1 !
; 0478 1 ! SND%PKT%SIZE
; 0479 1 ! Send packet size
; 0480 1 ! SND%NPAD
; 0481 1 ! Padding length
; 0482 1 ! SND%PADCHAR
; 0483 1 ! Padding character
; 0484 1 ! SND%TIMEOUT
; 0485 1 ! Time out
; 0486 1 ! SND%EOL
; 0487 1 ! End of line character
; 0488 1 ! SND%QUOTE%CHR
; 0489 1 ! Quote character
; 0490 1 ! SND%SOH
; 0491 1 ! Start of header character (normally 001)
; 0492 1 !
; 0493 1 ! Statistics:
; 0494 1 !
; 0495 1 ! SND%TOTAL%CHARS
; 0496 1 ! Total characters sent for this Kermit session
; 0497 1 ! RCV%TOTAL%CHARS
; 0498 1 ! Total characters received for this Kermit session
; 0499 1 ! SND%DATA%CHARS
; 0500 1 ! Total number of data characters sent for this Kermit session
; 0501 1 ! RCV%DATA%CHARS
; 0502 1 ! Total number of data characters received for this Kermit session
; 0503 1 ! SND%COUNT
; 0504 1 ! Total number of packets that have been sent
; 0505 1 ! RCV%COUNT
; 0506 1 ! Total number of packets that have been received.
; 0507 1 ! SMSG%TOTAL%CHARS
; 0508 1 ! Total characters sent for this file transfer
; 0509 1 ! RMSG%TOTAL%CHARS
; 0510 1 ! Total characters received for this file transfer
; 0511 1 ! SMSG%DATA%CHARS
; 0512 1 ! Total data characters sent for this file transfer
; 0513 1 ! RMSG%DATA%CHARS
; 0514 1 ! Total data characters received for this file transfer
; 0515 1 ! SMSG%NAKS
; 0516 1 ! Total number of NAKs sent for this file transfer
; 0517 1 ! RMSG%NAKS
; 0518 1 ! Total number of NAKs received for this file transfer
; 0519 1 ! XFR%TIME
; 0520 1 ! Amount of time the last transfer took in milliseconds.
; 0521 1 ! TOTAL%TIME
; 0522 1 ! Total amount of time spend transfering data.
; 0523 1 !
; 0524 1 ! Misc constants:
; 0525 1 !
; 0526 1 ! LAST%ERROR
; 0527 1 ! ASCIZ of the last error message issued.
; 0528 1 ! FILE%NAME
; 0529 1 ! Vector containing the ASCII characters of the file name.
; 0530 1 ! FILE%SIZE
; 0531 1 ! Number of characters in the FILE%NAME vector.
; 0532 1 ! DELAY
; 0533 1 ! Amount of time to delay
; 0534 1 ! DUPLEX
; 0535 1 ! DP%HALF or DP%FULL to denote either half duplex or full duplex.
; 0536 1 ! [Currently only DP%FULL is supported]
; 0537 1 ! PKT%RETRIES
; 0538 1 ! Number of retries to attempt to read a message.
; 0539 1 ! SI%RETRIES
; 0540 1 ! Number of retries to attempt on send inits
; 0541 1 ! DEBUG%FLAG
; 0542 1 ! Debugging mode on/off
; 0543 1 ! WARN%FLAG
; 0544 1 ! File warning flag
; 0545 1 ! IBM%FLAG
; 0546 1 ! True if talking to an IBM system, else false.
; 0547 1 ! ECHO%FLAG
; 0548 1 ! Local echo flag
; 0549 1 ! CONNECT%FLAG
; 0550 1 ! Connected flag; True if terminal and SET LINE are the same
; 0551 1 ! PARITY%TYPE
; 0552 1 ! Type of parity to use on sends.
; 0553 1 ! DEV%PARITY%FLAG
; 0554 1 ! Device will add parity to message. True if device adds
; 0555 1 ! parity and false if we must do it.
; 0556 1 ! FLAG%FILE%OPEN
; 0557 1 ! File is opened.
; 0558 1 !
; 0559 1 !--
; 0560 1
; 0561 1 %SBTTL 'Declarations -- Forward definitions'
; 0562 1 !<BLF/NOFORMAT>
; 0563 1 !
; 0564 1 ! Forward definitions
; 0565 1 !
; 0566 1
; 0567 1 FORWARD ROUTINE
; 0568 1
; 0569 1 ! Main loop for a complete transaction
; 0570 1 DO%TRANSACTION, ! Perform a complete transaction
; 0571 1
; 0572 1 ! Send processing routines
; 0573 1
; 0574 1 SEND%SERVER%INIT, ![026] Send a server init packet
; 0575 1 SEND%DATA, ! Send data to the micro
; 0576 1 SEND%FILE, ! Send file name
; 0577 1 SEND%OPEN%FILE, ! Open file for sending
; 0578 1 SEND%GENCMD, ! Send generic command
; 0579 1 SEND%EOF, ! Send EOF
; 0580 1 SEND%INIT, ! Send initialization msg
; 0581 1 SEND%BREAK, ! Send break end of transmission
; 0582 1
; 0583 1 ! Receive processing routines
; 0584 1
; 0585 1 REC%SERVER%IDLE, ! Wait for message while server is idle
; 0586 1 REC%INIT, ! Receive initialization
; 0587 1 REC%FILE, ! Receive file information
; 0588 1 REC%DATA, ! Receive data
; 0589 1 !
; 0590 1 ! Server processing routines
; 0591 1 !
; 0592 1 SERVER%GENERIC, ! Process generic KERMIT commands
; 0593 1 HOST%COMMAND, ! Process host command
; 0594 1 KERMIT%COMMAND, ! Process Kermit command
; 0595 1 CALL%SY%RTN, ! Handle calling system routine and returning result
; 0596 1 !
; 0597 1 ! Statistic gathering routines
; 0598 1 !
; 0599 1 END%STATS : NOVALUE, ! End of a message processing stats routine
; 0600 1
; 0601 1 ! Low level send/receive routines
; 0602 1
; 0603 1 CALC%BLOCK%CHECK, ! Routine to calculate the block check value
; 0604 1 SET%SEND%INIT : NOVALUE, ! Set up the MSG%SND%INIT parameters.
; 0605 1 PRS%SEND%INIT, ! Parse MSG%SND%INIT parameters.
; 0606 1 DO%PARITY : NOVALUE, ! Routine to generate parity for a message
; 0607 1 GEN%PARITY, ! Routine to add parity to a character
; 0608 1 SEND%PACKET, ! Send a packet to the remote
; 0609 1 REC%MESSAGE, ! Receive a message with retry processing
; 0610 1 REC%PACKET, ! Receive a packet from the remote
; 0611 1
; 0612 1 ! Utility routines
; 0613 1
; 0614 1 NORMALIZE%FILE : NOVALUE, ! Force file name into normal form
; 0615 1 BFR%EMPTY, ! Empty the data buffer
; 0616 1 BFR%FILL, ! Fill the data buffer from a file
; 0617 1 SET%STRING, ![025] Routine to set alternate get/put routines
; 0618 1 ! for use with in memory strings
; 0619 1 TYPE%CHAR, ! Type a character from a packet
; 0620 1 INIT%XFR : NOVALUE, ! Initialize the per transfer processing
; 0621 1 STS%OUTPUT : NOVALUE, ! Output current transfer status
; 0622 1 !
; 0623 1 ! Debugging routines
; 0624 1 !
; 0625 1 DBG%MESSAGE : NOVALUE, ! Type out a formatted message
; 0626 1 DBG%SEND : NOVALUE, ! Send message debugging routine
; 0627 1 DBG%RECEIVE : NOVALUE; ! Receive message debugging routine
; 0628 1 %SBTTL 'Require files'
; 0629 1
; 0630 1 !
; 0631 1 !<BLF/FORMAT>
; 0632 1 !
; 0633 1 ! REQUIRE FILES:
; 0634 1 !
; 0635 1
; L 0636 1 %IF %BLISS (BLISS32)
; U 0637 1 %THEN
; U 0638 1
; U 0639 1 LIBRARY 'SYS$LIBRARY:STARLET';
; U 0640 1
; 0641 1 %FI
; 0642 1
; 0643 1 REQUIRE 'KERCOM';
; 0850 1
; 0851 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 ! <Mark><CHAR(Count)><CHAR(Seq)><Message-dependent information><Check><EOL>
; 0899 1 !
; 0900 1 ! <MARK>
; 0901 1 ! Normally SOH (Control-A, octal 001).
; 0902 1 !
; 0903 1 ! <CHAR(Count)>
; 0904 1 ! Count of the number of characters following this position.
; 0905 1 ! Character counts of ONLY 0 to 94 are valid.
; 0906 1 ! [108] Charavcter count = 0 means extended length type packet.
; 0907 1 !
; 0908 1 ! <CHAR(Seq)>
; 0909 1 ! Packet sequence number, modulo 100 (octal).
; 0910 1 !
; 0911 1 ! [108] <CHAR(Type)>
; 0912 1 ! [108] Packet type, usually a mnemonic ASCII character.
; 0913 1 ! [108]
; 0914 1 ! [108] For Extended Length packets only:
; 0915 1 ! [108] <CHAR(Count/95)>
; 0916 1 ! [108] Count of the number of characters / 95, from (HeaderCheck)
; 0917 1 ! [108]
; 0918 1 ! [108] <CHAR(Count MOD 95)>
; 0919 1 ! [108] Count of the number of characters MOD 95, from (HeaderCheck)
; 0920 1 ! [108]
; 0921 1 ! [108] <CHAR(HeaderCheck)>
; 0922 1 ! [108] Kermit type-1 checksum of the 5 preceding ASCII characters.
; 0923 1 !
; 0924 1 ! <MESSAGE-DEPENDENT INFORMATION>
; 0925 1 ! This field contains the message dependent information. There can
; 0926 1 ! be multiple fields in this section. See the KERMIT Protocol document
; 0927 1 ! for a complete description of this.
; 0928 1 !
; 0929 1 ! <Check>
; 0930 1 ! A block check on the characters in the packet between, but not
; 0931 1 ! including, the mark and the checksum itself. It may be one to three
; 0932 1 ! characters, depending upon the type agreed upon.
; 0933 1 !
; 0934 1 ! 1. Single character arithmetic sum equal to:
; 0935 1 ! chksum = (s + ((s AND 300)/100)) AND 77
; 0936 1 ! Character sent is CHAR(chksum).
; 0937 1 !
; 0938 1 ! 2. Two character arithmetic sum. CHAR of bits 6-11 are the first
; 0939 1 ! character, CHAR of bits 0-5 are the second character.
; 0940 1 !
; 0941 1 ! 3. Three character CRC-CCITT. First character is CHAR of bits 12-15,
; 0942 1 ! second is CHAR of bits 6-11, third is CHAR of bits 0-5.
; 0943 1 !
; 0944 1 !
; 0945 1 ! <EOL>
; 0946 1 ! End of line. Any line terminator that may be required by the host.
; 0947 1 !--
; 0948 1
; 0949 1 %SBTTL 'KERMIT Protocol Definitions -- Packet offsets'
; 0950 1
; 0951 1 !++
; 0952 1 ! The following define the various offsets of the standard KERMIT
; 0953 1 ! packets.
; 0954 1 !--
; 0955 1
; 0956 1 LITERAL
; 0957 1 PKT%MARK = 0, ! <MARK>
; 0958 1 PKT%COUNT = 1, ! <CHAR(Count)>
; 0959 1 PKT%SEQ = 2, ! <CHAR(Seq)>
; 0960 1 PKT%TYPE = 3, ! <Message type>
; 0961 1 PKT%MSG = 4, ! <MESSAGE-DEPENDENT INFORMATION>
; 0962 1 PKT%COUNTX1 = 4, ! [108] ! Ext. pkt: <CHAR(MSB(Count))>
; 0963 1 PKT%COUNTX2 = 5, ! [108] ! Ext. pkt: <CHAR(LSB(Count))>
; 0964 1 PKT%HCHECK = 6, ! [108] ! Ext. pkt: Header parity
; 0965 1 PKT%MSGX = 7, ! [108] ! <MESSAGE-DEPENDENT INFORMATION>
; 0966 1 PKT%MAX%MSG = 94 - 5, ! Maximum size of the message dependent
; 0967 1 ! information
; 0968 1 PKT%CHKSUM = 0, ! <CHAR(Chksum)> offset from end of
; 0969 1 ! Message dependent information
; 0970 1 PKT%EOL = 1, ! <Eol> offset from end of data
; 0971 1 ! [108] PKT%OVR%HEAD%B = 2, ! Header overhead
; 0972 1 ! [108] PKT%OVR%HEAD%E = 1, ! Overhead at the end
; 0973 1 PKT%OVR%HEAD = 3, ! Overhead added to data length
; 0974 1 PKT%TOT%OVR%HEAD = 6; ! Total overhead of the message
; 0975 1
; 0976 1 %SBTTL 'KERMIT Protocol Definitions -- Message dependent field'
; 0977 1
; 0978 1 !++
; 0979 1 ! The MESSAGE-DEPENDENT information field of the message contains at
; 0980 1 ! least one part. That is the type of message. The remainder of the message
; 0981 1 ! MESSAGE-DEPENDENT field is different depending on the message.
; 0982 1 !
; 0983 1 ! <TYPE><TYPE-DEPENDENT-INFORMATION>
; 0984 1 !
; 0985 1 ! <TYPE>
; 0986 1 ! The type defines the type of message that is being processed.
; 0987 1 !
; 0988 1 !--
; 0989 1
; 0990 1 ! Protocol version 1.0 message types
; 0991 1
; 0992 1 LITERAL
; 0993 1 MSG%DATA = %C'D', ! Data packet
; 0994 1 MSG%ACK = %C'Y', ! Acknowledgement
; 0995 1 MSG%NAK = %C'N', ! Negative acknowledgement
; 0996 1 MSG%SND%INIT = %C'S', ! Send initiate
; 0997 1 MSG%BREAK = %C'B', ! Break transmission
; 0998 1 MSG%FILE = %C'F', ! File header
; 0999 1 MSG%EOF = %C'Z', ! End of file (EOF)
; 1000 1 MSG%ERROR = %C'E'; ! Error
; 1001 1
; 1002 1 ! Protocol version 2.0 message types
; 1003 1
; 1004 1 LITERAL
; 1005 1 MSG%RCV%INIT = %C'R', ! Receive initiate
; 1006 1 MSG%COMMAND = %C'C', ! Host command
; 1007 1 MSG%GENERIC = %C'G', ! Generic KERMIT command.
; 1008 1 MSG%KERMIT = %C'K'; ! Perform KERMIT command (text)
; 1009 1
; 1010 1 ! Protocol version 4.0 message types
; 1011 1
; 1012 1 LITERAL
; 1013 1 MSG%SER%INIT = %C'I', ! Server initialization
; 1014 1 MSG%TEXT = %C'X'; ! Text header message
; 1015 1
; 1016 1 !++
; 1017 1 ! Generic KERMIT commands
; 1018 1 !--
; 1019 1
; 1020 1 LITERAL
; 1021 1 MSG%GEN%LOGIN = %C'I', ! Login
; 1022 1 MSG%GEN%EXIT = %C'F', ! Finish (exit to OS)
; 1023 1 MSG%GEN%CONNECT = %C'C', ! Connect to a directory
; 1024 1 MSG%GEN%LOGOUT = %C'L', ! Logout
; 1025 1 MSG%GEN%DIRECTORY = %C'D', ! Directory
; 1026 1 MSG%GEN%DISK%USAGE = %C'U', ! Disk usage
; 1027 1 MSG%GEN%DELETE = %C'E', ! Delete a file
; 1028 1 MSG%GEN%TYPE = %C'T', ! Type a file specification
; 1029 1 ! MSG%GEN%SUBMIT = %C'S', ! Submit
; 1030 1 ! MSG%GEN%PRINT = %C'P', ! Print
; 1031 1 MSG%GEN%WHO = %C'W', ! Who's logged in
; 1032 1 MSG%GEN%SEND = %C'M', ! Send a message to a user
; 1033 1 MSG%GEN%HELP = %C'H', ! Help
; 1034 1 MSG%GEN%QUERY = %C'Q', ! Query status
; 1035 1 MSG%GEN%RENAME = %C'R', ! Rename file
; 1036 1 MSG%GEN%COPY = %C'K', ! Copy file
; 1037 1 MSG%GEN%PROGRAM = %C'P', ! Run program and pass data
; 1038 1 MSG%GEN%JOURNAL = %C'J', ! Perform journal functions
; 1039 1 MSG%GEN%VARIABLE = %C'V'; ! Return/set variable state
; 1040 1
; 1041 1 !
; 1042 1 ! Acknowledgement modifiers (protocol 4.0)
; 1043 1 !
; 1044 1
; 1045 1 LITERAL
; 1046 1 MSG%ACK%ABT%CUR = %C'X', ! Abort current file
; 1047 1 MSG%ACK%ABT%ALL = %C'Z'; ! Abort entire stream of files
; 1048 1
; 1049 1 !
; 1050 1 ! End of file packet modifier
; 1051 1 !
; 1052 1
; 1053 1 LITERAL
; 1054 1 MSG%EOF%DISCARD = %C'D'; ! Discard data from previous file
; 1055 1
; 1056 1 %SBTTL 'KERMIT Protocol Definitions -- SEND initiate packet'
; 1057 1
; 1058 1 !++
; 1059 1 !
; 1060 1 ! The following describes the send initiate packet. All fields in the message
; 1061 1 ! data area are optional.
; 1062 1 !
; 1063 1 ! <"S"><CHAR(Bufsiz)><CHAR(Timeout)><CHAR(npad)><CTL(pad)><CHAR(Eol)><Quote>
; 1064 1 ! <8-bit-quote><Check-type><Repeat-count-processing><Reserved><Reserved>
; 1065 1 !
; 1066 1 ! BUFSIZ
; 1067 1 ! Sending Kermit's maximum buffer size.
; 1068 1 !
; 1069 1 ! Timeout
; 1070 1 ! Number of seconds after which the sending Kermit wishes to be timed out
; 1071 1 !
; 1072 1 ! Npad
; 1073 1 ! Number of padding caracters the sending Kermit needs preceding each
; 1074 1 ! packet.
; 1075 1 !
; 1076 1 ! PAD
; 1077 1 ! Padding character.
; 1078 1 !
; 1079 1 ! EOL
; 1080 1 ! A line terminator required on all packets set by the receiving
; 1081 1 ! Kermit.
; 1082 1 !
; 1083 1 ! Quote
; 1084 1 ! The printable ASCII characer the sending Kermit will use when quoting
; 1085 1 ! the control cahracters. Default is "#".
; 1086 1 !
; 1087 1 ! 8-bit-quote
; 1088 1 ! Specify quoting mecanism for 8-bit quantities. A quoting mecanism is
; 1089 1 ! mecessary when sending to hosts which prevent the use of the 8th bit
; 1090 1 ! for data. When elected, the quoting mechanism will be used by both
; 1091 1 ! hosts, and the quote character must be in the range of 41-76 or 140-176
; 1092 1 ! octal, but different from the control-quoting character. This field is
; 1093 1 ! interpreted as follows:
; 1094 1 !
; 1095 1 ! "Y" - I agree to 8-bit quoting if you request it.
; 1096 1 ! "N" - I will not do 8-bit quoting.
; 1097 1 ! "&" - (or any other character in the range of 41-76 or 140-176) I want
; 1098 1 ! to do 8-bit quoting using this character (it will be done if the
; 1099 1 ! other Kermit puts a "Y" in this field.
; 1100 1 ! Anything else: Quoting will not be done.
; 1101 1 !
; 1102 1 ! Check-type
; 1103 1 ! Type of block check. The only values presently allowed in this
; 1104 1 ! field are "1", "2" or "3". Future implementations may allow other
; 1105 1 ! values. Interpretation of the values is:
; 1106 1 !
; 1107 1 ! "1" - Single character checksum. Default value if none specified.
; 1108 1 ! "2" - Double character checksum.
; 1109 1 ! "3" - Three character CRC.
; 1110 1 !
; 1111 1 ! Repeat-count-processing
; 1112 1 ! The prefix character to be used to indicate a repeated character.
; 1113 1 ! This can be any printable cahracter other than blank (which denotes
; 1114 1 ! no repeat count).
; 1115 1 !
; 1116 1 ! [108] Capability byte(s)
; 1117 1 ! [108] Bit mask containing extra capabilities, currently we only use
; 1118 1 ! [108] bit 1 (extended-length packets) and bit 0 (more capability
; 1119 1 ! [108] bytes follows).
; 1120 1 ! [108]
; 1121 1 ! [108] Window length (not used)
; 1122 1 ! [108]
; 1123 1 ! [108] Extended packet length
; 1124 1 ! [108] Maximum length for extended-length packets
; 1125 1 !
; 1126 1 !--
; 1127 1
; 1128 1 LITERAL
; 1129 1 P%SI%BUFSIZ = 0, ! Buffersize
; 1130 1 MY%PKT%SIZE = 80, ! My packet size
; 1131 1 P%SI%TIMOUT = 1, ! Time out
; 1132 1 MY%TIME%OUT = 60, ! [046] Increased ! My time out
; 1133 1 P%SI%NPAD = 2, ! Number of padding characters
; 1134 1 MY%NPAD = 0, ! Amount of padding I require
; 1135 1 P%SI%PAD = 3, ! Padding character
; 1136 1 MY%PAD%CHAR = 0, ! My pad character
; 1137 1 P%SI%EOL = 4, ! End of line character
; 1138 1 MY%EOL%CHAR = %O'015', ! My EOL cahracter
; 1139 1 P%SI%QUOTE = 5, ! Quote character
; 1140 1 MY%QUOTE%CHAR = %C'#', ! My quoting character
; 1141 1 P%SI%8QUOTE = 6, ! 8-bit quote
; 1142 1 MY%8BIT%QUOTE = %C'&', ! Don't do it
; 1143 1 P%SI%CHKTYPE = 7, ! Checktype used
; 1144 1 MY%CHKTYPE = CHK%1CHAR, ! Use single character checksum
; 1145 1 P%SI%REPEAT = 8, ! Repeat character
; 1146 1 MY%REPEAT = %C'~', ! My repeat character
; 1147 1 P%SI%LENGTH = 9, ! Length of the std message
; 1148 1 ! [108]
; 1149 1 P%SI%CAPAS = 9, ! [108] ! Capability field (if used)
; 1150 1 EXTLEN%CAPAS = 2, ! [108] ! Extended length packets
; 1151 1 P%SI%WINDO = 10, ! [108] ! (Send only) Not used, filler
; 1152 1 P%SI%MAXLX1 = 11, ! [108] ! (Send only) Ext. len / 95
; 1153 1 MY%MAXLX1 = 0, ! [108]
; 1154 1 P%SI%MAXLX2 = 12, ! [108] ! (Send only) Ext. len MOD 95
; 1155 1 MY%MAXLX2 = 80, ! [108]
; 1156 1 ! [108]
; 1157 1 P%SI%XLENGTH = 13; ! [108] ! (Send only) Len of ext. msg
; 1158 1
; 1159 1 %SBTTL 'KERMIT Protocol States'
; 1160 1
; 1161 1 !++
; 1162 1 ! The following are the various states that KERMIT can be in.
; 1163 1 ! The state transitions are defined in the KERMIT Protocol manual.
; 1164 1 !--
; 1165 1
; 1166 1 LITERAL
; 1167 1 STATE%MIN = 1, ! Min state number
; 1168 1 STATE%S = 1, ! Send init state
; 1169 1 STATE%SF = 2, ! Send file header
; 1170 1 STATE%SD = 3, ! Send file data packet
; 1171 1 STATE%SZ = 4, ! Send EOF packet
; 1172 1 STATE%SB = 5, ! Send break
; 1173 1 STATE%R = 6, ! Receive state (wait for send-init)
; 1174 1 STATE%RF = 7, ! Receive file header packet
; 1175 1 STATE%RD = 8, ! Receive file data packet
; 1176 1 STATE%C = 9, ! Send complete
; 1177 1 STATE%A = 10, ! Abort
; 1178 1 STATE%SX = 11, ! Send text header
; 1179 1 STATE%SG = 12, ! Send generic command
; 1180 1 STATE%SI = 13, ! Send server init
; 1181 1 STATE%ID = 14, ! Server idle loop
; 1182 1 STATE%II = 15, ! Server idle after server init
; 1183 1 STATE%FI = 16, ! Server should exit
; 1184 1 STATE%LG = 17, ! Server should logout
; 1185 1 STATE%OF = 18, ! Send - open first input file
; 1186 1 STATE%EX = 19, ! Exit back to command parser
; 1187 1 STATE%ER = 20, ! Retries exceeded error
; 1188 1 STATE%MAX = 20; ! Max state number
; 1189 1
; 1190 1 %SBTTL 'Internal constants'
; 1191 1
; 1192 1 !++
; 1193 1 ! The following represent various internal KERMSG constants.
; 1194 1 !--
; 1195 1
; 1196 1 LITERAL
; 1197 1 MAX%PKT%RETRIES = 16, ! Maximum packet retries
; 1198 1 MAX%SI%RETRIES = 5; ! Maximum send init retries
; 1199 1
; 1200 1 %SBTTL 'Storage - External'
; 1201 1 !
; 1202 1 ! OWN STORAGE:
; 1203 1 !
; 1204 1
; 1205 1 EXTERNAL
; 1206 1 !
; 1207 1 ! Receive parameters
; 1208 1 !
; 1209 1 RCV%PKT%SIZE, ! Receive packet size
; 1210 1 RCV%NPAD, ! Padding length
; 1211 1 RCV%PADCHAR, ! Padding character
; 1212 1 RCV%TIMEOUT, ! Time out
; 1213 1 RCV%EOL, ! EOL character
; 1214 1 RCV%QUOTE%CHR, ! Quote character
; 1215 1 RCV%SOH, ! Start of header character
; 1216 1 RCV%8QUOTE%CHR, ! 8-bit quoting character
; 1217 1 !
; 1218 1 ! Miscellaneous parameters
; 1219 1 !
; 1220 1 SET%REPT%CHR, ! Repeat character
; 1221 1 !
; 1222 1 ! Send parameters
; 1223 1 !
; 1224 1 SND%PKT%SIZE, ! Send packet size
; 1225 1 SND%NPAD, ! Padding length
; 1226 1 SND%PADCHAR, ! Padding character
; 1227 1 SND%TIMEOUT, ! Time out
; 1228 1 SND%EOL, ! EOL character
; 1229 1 SND%QUOTE%CHR, ! Quote character
; 1230 1 SND%SOH, ! Start of header character
; 1231 1 SEND%TIMEOUT, ! Time to wait for receiving message
; 1232 1 !
; 1233 1 ! Server parameters
; 1234 1 !
; 1235 1 SRV%TIMEOUT, ! Time between NAK's when server is idle
; 1236 1 !
; 1237 1 ! Statistics
; 1238 1 !
; 1239 1 SND%TOTAL%CHARS, ! Total characters sent
; 1240 1 RCV%TOTAL%CHARS, ! Total characters received
; 1241 1 SND%DATA%CHARS, ! Total number of data characters sent
; 1242 1 RCV%DATA%CHARS, ! Total number of data characters received
; 1243 1 SND%NAKS, ! Total NAKs sent
; 1244 1 RCV%NAKS, ! Total NAKs received
; 1245 1 SND%COUNT, ! Count of total number of packets
; 1246 1 RCV%COUNT, ! Count of total number packets received
; 1247 1 SMSG%COUNT, ! Total number of packets sent
; 1248 1 RMSG%COUNT, ! Total number of packets received
; 1249 1 SMSG%TOTAL%CHARS, ! Total chars sent this file xfer
; 1250 1 RMSG%TOTAL%CHARS, ! Total chars rcvd this file xfer
; 1251 1 SMSG%DATA%CHARS, ! Total data chars this file xfer
; 1252 1 RMSG%DATA%CHARS, ! Total data chars this file xfer
; 1253 1 SMSG%NAKS, ! Total number of NAKs this file xfer
; 1254 1 RMSG%NAKS, ! Total number of NAKs received
; 1255 1 XFR%TIME, ! Amount of time last xfr took
; 1256 1 TOTAL%TIME, ! Total time of all xfrs
; 1257 1 ! this file xfer
; 1258 1 LAST%ERROR : VECTOR [CH$ALLOCATION (MAX%MSG + 1)], ! Last error message
; 1259 1 !
; 1260 1 ! Misc constants.
; 1261 1 !
; 1262 1 FILE%NAME : VECTOR [CH$ALLOCATION (MAX%FILE%NAME)],
; 1263 1 FILE%SIZE,
; 1264 1 SI%RETRIES, ! Send init retries to attempt
; 1265 1 PKT%RETRIES, ! Number of retries to try for a message
; 1266 1 DELAY, ! Amount of time to delay
; 1267 1 DUPLEX, ! Type of connection (half or full)
; 1268 1 PARITY%TYPE, ! Type of parity to use
; 1269 1 DEV%PARITY%FLAG, ! True if output device does
; 1270 1 ! parity, false if we do it
; 1271 1 CHKTYPE, ! Type of block check desired
; 1272 1 ABT%FLAG, ! True if aborted file should be discarded
; 1273 1 DEBUG%FLAG, ! Debugging mode on/off
; 1274 1 WARN%FLAG, ! File warning flag
; 1275 1 IBM%CHAR, ! Turnaround character for IBM mode
; 1276 1 ECHO%FLAG, ! Local echo flag
; 1277 1 CONNECT%FLAG, ! Connected flag; True if
; 1278 1 ! terminal and SET LINE are
; 1279 1 ! the same
; 1280 1 ABT%CUR%FILE, ! Abort current file
; 1281 1 ABT%ALL%FILE, ! Abort all files in stream
; 1282 1 TYP%STS%FLAG, ! Type status next message
; 1283 1 TY%FIL, ! Type file specs
; 1284 1 TY%PKT, ! Type packet info
; 1285 1 FIL%NORMAL%FORM, ! If true, file names should be normalized
; 1286 1 GEN%1DATA : VECTOR [CH$ALLOCATION (MAX%MSG)], ! Data for generic command
; 1287 1 GEN%1SIZE, ! Size of data in GEN%1DATA
; 1288 1 GEN%2DATA : VECTOR [CH$ALLOCATION (MAX%MSG)], ! Second argument for generic command
; 1289 1 GEN%2SIZE, ! Size of data in GEN%2DATA
; 1290 1 GEN%3DATA : VECTOR [CH$ALLOCATION (MAX%MSG)], ! Third arg for generic command
; 1291 1 GEN%3SIZE; ! Size of data in GEN%3DATA
; 1292 1
; 1293 1 %SBTTL 'Storage - Local'
; 1294 1 !
; 1295 1 ! LOCAL OWN STORAGE:
; 1296 1 !
; 1297 1
; 1298 1 OWN
; 1299 1 !
; 1300 1 ! Receive parameters
; 1301 1 !
; 1302 1 RECV%8QUOTE%CHR, ! 8th-bit quoting character
; 1303 1 REPT%CHR, ! Repeat prefix character
; 1304 1 RECV%PKT%MSG, ! [108] ! Msg offset (4 std, 7 ext.)
; 1305 1 !
; 1306 1 ! Send parameters
; 1307 1 !
; 1308 1 SEND%PKT%SIZE, ! Send packet size
; 1309 1 SEND%NPAD, ! Padding length
; 1310 1 SEND%PADCHAR, ! Padding character
; 1311 1 SEND%EOL, ! EOL character
; 1312 1 SEND%QUOTE%CHR, ! Quote character
; 1313 1 SEND%8QUOTE%CHR, ! 8-bit quoting character
; 1314 1 SEND%INIT%SIZE, ! Size of INIT message
; 1315 1 !
; 1316 1 ! Misc parameters
; 1317 1 !
; 1318 1 INI%CHK%TYPE, ! Type of block checking from init message
; 1319 1 BLK%CHK%TYPE, ! Type of block check to use
; 1320 1 FLAG%8QUOTE, ! Flag to determine if doing 8bit quoting
; 1321 1 FLAG%REPEAT, ! True if doing repeated character compression
; 1322 1 STATE, ! Current state
; 1323 1 SIZE, ! Size of the current message
; 1324 1 ! [108] Negative len for ext msgs
; 1325 1 OLD%RETRIES, ! Saved number of retries done.
; 1326 1 NUM%RETRIES, ! Number of retries
; 1327 1 MSG%NUMBER, ! Current message number
; 1328 1 REC%SEQ, ! Sequence number of msg in REC%MSG
; 1329 1 REC%LENGTH, ! Length of the message recv'd
; 1330 1 REC%TYPE, ! Type of the message received.
; 1331 1 REC%MSG : VECTOR [CH$ALLOCATION (MAX%MSG + 1, CHR%SIZE)], ! Message received
; 1332 1 SND%MSG : VECTOR [CH$ALLOCATION (MAX%MSG + 1, CHR%SIZE)], ! Message sent
; 1333 1 FILE%CHARS, ! Number of characters sent or received
; 1334 1 TEXT%HEAD%FLAG, ! Text header received, not file header
; 1335 1 NO%FILE%NEEDED, ! Don't open a file
; 1336 1 INIT%PKT%SENT, ! Server-init sent and ACKed
; 1337 1 GEN%TYPE, ! Command message type
; 1338 1 GEN%SUBTYPE, ! Generic command subtype
; 1339 1 GET%CHR%ROUTINE, ! Address of routine to get a character for BFR%FILL
; 1340 1 PUT%CHR%ROUTINE; ! Address of routine to put a character for BFR%EMPTY
; 1341 1 !
; 1342 1 ! KERMSG Global storage
; 1343 1 !
; 1344 1 GLOBAL
; 1345 1 FLAG%FILE%OPEN; ! File is opened.
; 1346 1
; 1347 1 %SBTTL 'External references'
; 1348 1 !
; 1349 1 ! EXTERNAL REFERENCES:
; 1350 1 !
; 1351 1 ! Packet I/O routines
; 1352 1
; 1353 1 EXTERNAL ROUTINE
; 1354 1 SEND, ! Send a packet to the remote
; 1355 1 IBM%WAIT, ! Wait for IBM turnaround
; 1356 1 RECEIVE; ! Receive a packet from the remote
; 1357 1
; 1358 1 !
; 1359 1 ! Terminal I/O routines
; 1360 1 !
; 1361 1
; 1362 1 EXTERNAL ROUTINE
; 1363 1 TERM%DUMP : NOVALUE, ! Normal terminal output
; 1364 1 DBG%DUMP : NOVALUE, ! Debugging output
; 1365 1 TT%SET%OUTPUT, ! Set output routine
; 1366 1 TT%CHAR : NOVALUE, ! Output a single character
; 1367 1 TT%CRLF : NOVALUE, ! Output a CRLF
; 1368 1 TT%NUMBER : NOVALUE, ! Output a three digit number to the
; 1369 1 ! terminal
; 1370 1 TT%TEXT : NOVALUE, ! Output a string to the user's
; 1371 1 TT%OUTPUT : NOVALUE; ! Force buffered output to terminal
; 1372 1
; 1373 1 ! Operating system routines and misc routines
; 1374 1
; 1375 1 EXTERNAL ROUTINE
; 1376 1 CRCCLC, ! Calculate a CRC-CCITT
; 1377 1 XFR%STATUS : NOVALUE, ! Routine to tell the user the
; 1378 1 ! status of a transfer
; 1379 1 KRM%ERROR : NOVALUE, ! Issue an error message
; 1380 1 SY%LOGOUT : NOVALUE, ! Log the job off
; 1381 1 SY%GENERIC, ! Perform a generic command
; 1382 1 SY%TIME, ! Return elapsed time in milliseconds
; 1383 1 SY%DISMISS : NOVALUE; ! Routine to dismiss for n seconds.
; 1384 1
; 1385 1 !
; 1386 1 ! External file processing routines
; 1387 1 !
; 1388 1
; 1389 1 EXTERNAL ROUTINE
; 1390 1 FILE%OPEN, ! Open a file for reading/writing
; 1391 1 FILE%CLOSE, ! Close an open file
; 1392 1 NEXT%FILE, ! Determine if there is a next file
; 1393 1 ! and open it for reading.
; 1394 1 GET%FILE, ! Get a byte from the file
; 1395 1 PUT%FILE; ! Put a byte in the file.
; 1396 1
; 1397 1 %SBTTL 'MSG%INIT'
; 1398 1
; 1399 1 GLOBAL ROUTINE MSG%INIT : NOVALUE =
; 1400 1
; 1401 1 !++
; 1402 1 ! FUNCTIONAL DESCRIPTION:
; 1403 1 !
; 1404 1 ! This routine will initialize the message processing for
; 1405 1 ! KERMIT-32/36.
; 1406 1 !
; 1407 1 ! CALLING SEQUENCE:
; 1408 1 !
; 1409 1 ! MSG%INIT();
; 1410 1 !
; 1411 1 ! INPUT PARAMETERS:
; 1412 1 !
; 1413 1 ! None.
; 1414 1 !
; 1415 1 ! IMPLICIT INPUTS:
; 1416 1 !
; 1417 1 ! None.
; 1418 1 !
; 1419 1 ! OUTPUT PARAMETERS:
; 1420 1 !
; 1421 1 ! None.
; 1422 1 !
; 1423 1 ! IMPLICIT OUTPUTS:
; 1424 1 !
; 1425 1 ! None.
; 1426 1 !
; 1427 1 ! COMPLETION CODES:
; 1428 1 !
; 1429 1 ! None.
; 1430 1 !
; 1431 1 ! SIDE EFFECTS:
; 1432 1 !
; 1433 1 ! None.
; 1434 1 !
; 1435 1 !--
; 1436 1
; 1437 2 BEGIN
; 1438 2 !
; 1439 2 ! Initialize some variables
; 1440 2 !
; 1441 2 ! Receive parameters first
; 1442 2 !
; 1443 2 RCV%PKT%SIZE = MY%PKT%SIZE;
; 1444 2 RCV%NPAD = MY%NPAD;
; 1445 2 RCV%PADCHAR = MY%PAD%CHAR;
; 1446 2 RCV%TIMEOUT = MY%TIME%OUT;
; 1447 2 RCV%EOL = MY%EOL%CHAR;
; 1448 2 RCV%QUOTE%CHR = MY%QUOTE%CHAR;
; 1449 2 RCV%SOH = CHR%SOH;
; 1450 2 RCV%8QUOTE%CHR = MY%8BIT%QUOTE;
; 1451 2 SET%REPT%CHR = MY%REPEAT;
; 1452 2 !
; 1453 2 ! Send parameters.
; 1454 2 !
; 1455 2 SND%PKT%SIZE = -MY%PKT%SIZE;
; 1456 2 SND%NPAD = -MY%NPAD;
; 1457 2 SND%PADCHAR = -MY%PAD%CHAR;
; 1458 2 SND%TIMEOUT = -MY%TIME%OUT;
; 1459 2 SND%EOL = -MY%EOL%CHAR;
; 1460 2 SND%QUOTE%CHR = -MY%QUOTE%CHAR;
; 1461 2 SND%SOH = CHR%SOH;
; 1462 2 !
; 1463 2 ! Server parameters
; 1464 2 !
; 1465 2 SRV%TIMEOUT = 5*MY%TIME%OUT;
; 1466 2 !
; 1467 2 ! Other random parameters
; 1468 2 !
; 1469 2 PKT%RETRIES = MAX%PKT%RETRIES; ! Number of retries per message
; 1470 2 SI%RETRIES = MAX%SI%RETRIES; ! Number of retries on send inits
; 1471 2 DELAY = INIT%DELAY;
; 1472 2 DUPLEX = DP%FULL; ! Use full duplex
; 1473 2 DEBUG%FLAG = FALSE;
; 1474 2 WARN%FLAG = FALSE;
; 1475 2 ECHO%FLAG = FALSE;
; 1476 2 BLK%CHK%TYPE = CHK%1CHAR; ! Start using single char checksum
; 1477 2 CHKTYPE = MY%CHKTYPE; ! Desired block check type
; 1478 2 INI%CHK%TYPE = .CHKTYPE; ! Same as default for now
; 1479 2 DEV%PARITY%FLAG = FALSE; ! We generate parity
; 1480 2 PARITY%TYPE = PR%NONE; ! No parity
; 1481 2 ABT%FLAG = TRUE; ! Discard incomplete files
; 1482 2 FLAG%FILE%OPEN = FALSE;
; 1483 2 IBM%CHAR = -1; ![044] No handsake by default
; 1484 2 TY%FIL = TRUE; ! Default to typing files
; 1485 2 TY%PKT = FALSE; ! But not packet numbers
; 1486 2 FIL%NORMAL%FORM = FNM%NORMAL; ! Default to normal form names
; 1487 2 GET%CHR%ROUTINE = GET%FILE; ![025] Initialize the get-a-char routine
; 1488 2 PUT%CHR%ROUTINE = PUT%FILE; ![025] And the put-a-char
; 1489 1 END; ! End of MSG%INIT
TITLE KERMSG
TWOSEG
.REQUEST REL:B361LB.REL
RELOC 0
; RECV%8QUOTE%CHR
U.37: BLOCK 1
; REPT%CHR
U.38: BLOCK 1
; RECV%PKT%MSG
U.39: BLOCK 1
; SEND%PKT%SIZE
U.40: BLOCK 1
; SEND%NPAD
U.41: BLOCK 1
; SEND%PADCHAR
U.42: BLOCK 1
; SEND%EOL
U.43: BLOCK 1
; SEND%QUOTE%CHR
U.44: BLOCK 1
; SEND%8QUOTE%CHR
U.45: BLOCK 1
; SEND%INIT%SIZE
U.46: BLOCK 1
; INI%CHK%TYPE
U.47: BLOCK 1
; BLK%CHK%TYPE
U.48: BLOCK 1
; FLAG%8QUOTE
U.49: BLOCK 1
; FLAG%REPEAT
U.50: BLOCK 1
; STATE
U.51: BLOCK 1
; SIZE
U.52: BLOCK 1
; OLD%RETRIES
U.53: BLOCK 1
; NUM%RETRIES
U.54: BLOCK 1
; MSG%NUMBER
U.55: BLOCK 1
; REC%SEQ
U.56: BLOCK 1
; REC%LENGTH
U.57: BLOCK 1
; REC%TYPE
U.58: BLOCK 1
; REC%MSG
U.59: BLOCK 373
; SND%MSG
U.60: BLOCK 373
; FILE%CHARS
U.61: BLOCK 1
; TEXT%HEAD%FLAG
U.62: BLOCK 1
; NO%FILE%NEEDED
U.63: BLOCK 1
; INIT%PKT%SENT
U.64: BLOCK 1
; GEN%TYPE
U.65: BLOCK 1
; GEN%SUBTYPE
U.66: BLOCK 1
; GET%CHR%ROUTINE
U.67: BLOCK 1
; PUT%CHR%ROUTINE
U.68: BLOCK 1
FLAG%FILE%OPEN::
BLOCK 1
EXTERN RCV%PKT%SIZE, RCV%NPAD, RCV%PADCHAR, RCV%TIMEOUT, RCV%EOL, RCV%QUOTE%CHR, RCV%SOH
EXTERN RCV%8QUOTE%CHR, SET%REPT%CHR, SND%PKT%SIZE, SND%NPAD, SND%PADCHAR, SND%TIMEOUT, SND%EOL
EXTERN SND%QUOTE%CHR, SND%SOH, SEND%TIMEOUT, SRV%TIMEOUT, SND%TOTAL%CHARS, RCV%TOTAL%CHARS
EXTERN SND%DATA%CHARS, RCV%DATA%CHARS, SND%NAKS, RCV%NAKS, SND%COUNT, RCV%COUNT, SMSG%COUNT
EXTERN RMSG%COUNT, SMSG%TOTAL%CHARS, RMSG%TOTAL%CHARS, SMSG%DATA%CHARS, RMSG%DATA%CHARS, SMSG%NAKS
EXTERN RMSG%NAKS, XFR%TIME, TOTAL%TIME, LAST%ERROR, FILE%NAME, FILE%SIZE, SI%RETRIES, PKT%RETRIES
EXTERN DELAY, DUPLEX, PARITY%TYPE, DEV%PARITY%FLAG, CHKTYPE, ABT%FLAG, DEBUG%FLAG, WARN%FLAG
EXTERN IBM%CHAR, ECHO%FLAG, CONNECT%FLAG, ABT%CUR%FILE, ABT%ALL%FILE, TYP%STS%FLAG, TY%FIL
EXTERN TY%PKT, FIL%NORMAL%FORM, GEN%1DATA, GEN%1SIZE, GEN%2DATA, GEN%2SIZE, GEN%3DATA, GEN%3SIZE
EXTERN SEND, IBM%WAIT, RECEIVE, TERM%DUMP, DBG%DUMP, TT%SET%OUTPUT, TT%CHAR, TT%CRLF, TT%NUMBER
EXTERN TT%TEXT, TT%OUTPUT, CRCCLC, XFR%STATUS, KRM%ERROR, SY%LOGOUT, SY%GENERIC, SY%TIME
EXTERN SY%DISMISS, FILE%OPEN, FILE%CLOSE, NEXT%FILE, GET%FILE, PUT%FILE
FNM%NORMAL==: 1
FNM%FULL==: 2
FNM%UNTRAN==: 4
PR%MIN==: 0
PR%NONE==: 0
PR%MARK==: 1
PR%EVEN==: 2
PR%ODD==: 3
PR%SPACE==: 4
PR%MAX==: 4
GC%MIN==: 1
GC%EXIT==: 1
GC%DIRECTORY==: 2
GC%DISK%USAGE==: 3
GC%DELETE==: 4
GC%TYPE==: 5
GC%HELP==: 6
GC%LOGOUT==: 7
GC%LGN==: 10
GC%CONNECT==: 11
GC%RENAME==: 12
GC%COPY==: 13
GC%WHO==: 14
GC%SEND%MSG==: 15
GC%STATUS==: 16
GC%COMMAND==: 17
GC%KERMIT==: 20
GC%JOURNAL==: 21
GC%VARIABLE==: 22
GC%PROGRAM==: 23
GC%MAX==: 23
DP%FULL==: 0
DP%HALF==: 1
CHK%1CHAR==: 61
CHK%2CHAR==: 62
CHK%CRC==: 63
MAX%MSG==: 1752
AC0= 0
AC1= 1
AC2= 2
AC3= 3
AC4= 4
AC5= 5
AC6= 6
AC7= 7
AC10= 10
AC11= 11
AC12= 12
AC13= 13
AC14= 14
FP= 15
AC16= 16
SP= 17
RELOC 400000
MSG%INIT::
MOVEI AC1,120 ; 1443
MOVEM AC1,RCV%PKT%SIZE
SETZM RCV%NPAD ; 1444
SETZM RCV%PADCHAR ; 1445
MOVEI AC1,74 ; 1446
MOVEM AC1,RCV%TIMEOUT
MOVEI AC1,15 ; 1447
MOVEM AC1,RCV%EOL
MOVEI AC1,43 ; 1448
MOVEM AC1,RCV%QUOTE%CHR
MOVEI AC1,1 ; 1449
MOVEM AC1,RCV%SOH
MOVEI AC1,46 ; 1450
MOVEM AC1,RCV%8QUOTE%CHR
MOVEI AC1,176 ; 1451
MOVEM AC1,SET%REPT%CHR
HRROI AC1,-120 ; 1455
MOVEM AC1,SND%PKT%SIZE
SETZM SND%NPAD ; 1456
SETZM SND%PADCHAR ; 1457
HRROI AC1,-74 ; 1458
MOVEM AC1,SND%TIMEOUT
HRROI AC1,-15 ; 1459
MOVEM AC1,SND%EOL
HRROI AC1,-43 ; 1460
MOVEM AC1,SND%QUOTE%CHR
MOVEI AC1,1 ; 1461
MOVEM AC1,SND%SOH
MOVEI AC1,454 ; 1465
MOVEM AC1,SRV%TIMEOUT
MOVEI AC1,20 ; 1469
MOVEM AC1,PKT%RETRIES
MOVEI AC1,5 ; 1470
MOVEM AC1,SI%RETRIES
MOVEI AC1,5 ; 1471
MOVEM AC1,DELAY
SETZM DUPLEX ; 1472
SETZM DEBUG%FLAG ; 1473
SETZM WARN%FLAG ; 1474
SETZM ECHO%FLAG ; 1475
MOVEI AC1,61 ; 1476
MOVEM AC1,U.48
MOVEI AC1,61 ; 1477
MOVEM AC1,CHKTYPE
MOVEM AC1,U.47 ; 1478
SETZM DEV%PARITY%FLAG ; 1479
SETZM PARITY%TYPE ; 1480
MOVEI AC1,1 ; 1481
MOVEM AC1,ABT%FLAG
SETZM FLAG%FILE%OPEN ; 1482
SETOM IBM%CHAR ; 1483
MOVEI AC1,1 ; 1484
MOVEM AC1,TY%FIL
SETZM TY%PKT ; 1485
MOVEI AC1,1 ; 1486
MOVEM AC1,FIL%NORMAL%FORM
MOVEI AC1,GET%FILE ; 1487
MOVEM AC1,U.67
MOVEI AC1,PUT%FILE ; 1488
MOVEM AC1,U.68
POPJ SP, ; 1399
; Routine Size: 61 words
; 1490 1
; 1491 1 %SBTTL 'SND%ERROR'
; 1492 1
; 1493 1 GLOBAL ROUTINE SND%ERROR (COUNT, ADDRESS) : NOVALUE =
; 1494 1
; 1495 1 !++
; 1496 1 ! FUNCTIONAL DESCRIPTION:
; 1497 1 !
; 1498 1 ! This routine will send an error packet to the remote KERMIT. It
; 1499 1 ! is called with the count of characters and the address of the text.
; 1500 1 !
; 1501 1 ! CALLING SEQUENCE:
; 1502 1 !
; 1503 1 ! SND%ERROR(COUNT, %ASCII 'Error text');
; 1504 1 !
; 1505 1 ! INPUT PARAMETERS:
; 1506 1 !
; 1507 1 ! None.
; 1508 1 !
; 1509 1 ! IMPLICIT INPUTS:
; 1510 1 !
; 1511 1 ! None.
; 1512 1 !
; 1513 1 ! OUTPUT PARAMETERS:
; 1514 1 !
; 1515 1 ! None.
; 1516 1 !
; 1517 1 ! IMPLICIT OUTPUTS:
; 1518 1 !
; 1519 1 ! None.
; 1520 1 !
; 1521 1 ! COMPLETION CODES:
; 1522 1 !
; 1523 1 ! None.
; 1524 1 !
; 1525 1 ! SIDE EFFECTS:
; 1526 1 !
; 1527 1 !
; 1528 1 !--
; 1529 1
; 1530 2 BEGIN
; 1531 2 !
; 1532 2 ! Pack the message into the buffer
; 1533 2 !
; 1534 2 SET%STRING (CH$PTR (.ADDRESS), .COUNT, TRUE);
; 1535 2 BFR%FILL (TRUE);
; 1536 2 SET%STRING (0, 0, FALSE);
; 1537 2 !
; 1538 2 ! Save the last error message also
; 1539 2 !
; 1540 2
; 1541 2 IF .COUNT GTR MAX%MSG THEN COUNT = MAX%MSG;
; 1542 2
; 1543 2 CH$COPY (.COUNT, CH$PTR (.ADDRESS), 0, MAX%MSG + 1, CH$PTR(LAST%ERROR));
; 1544 2
; 1545 2 IF NOT SEND%PACKET (MSG%ERROR, .SIZE, .MSG%NUMBER) THEN RETURN KER%ABORTED;
; 1546 2
; 1547 1 END; ! End of SND%ERROR
SND%ERROR::
PUSH SP,AC14 ; 1493
PUSH SP,AC16
MOVE AC16,-3(SP) ; 1534
MOVEI AC1,-1(AC16)
HRLI AC1,10700
PUSH SP,AC1
MOVE AC14,-5(SP)
PUSH SP,AC14
PUSH SP,C.2
PUSHJ SP,U.30
PUSH SP,C.2 ; 1535
PUSHJ SP,U.29
SETZM -2(SP) ; 1536
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
CAIG AC14,1752 ; 1541
JRST L.1
MOVEI AC1,1752
MOVEM AC1,-10(SP)
L.1: MOVEI AC2,-1(AC16) ; 1543
HRLI AC2,10700
MOVE AC1,-10(SP)
MOVEI AC4,1753
MOVE AC5,C.3
EXTEND AC1,C.1
JFCL
PUSH SP,C.4 ; 1545
PUSH SP,U.52
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-7
POP SP,AC16 ; 1493
POP SP,AC14
POPJ SP,
C.1: MOVSLJ
EXP 0
C.2: EXP 1
C.3: POINT 7,LAST%ERROR-1,34
C.4: EXP 105
; Routine Size: 40 words
; 1548 1
; 1549 1 %SBTTL 'SERVER - Server mode'
; 1550 1
; 1551 1 GLOBAL ROUTINE SERVER =
; 1552 1
; 1553 1 !++
; 1554 1 ! FUNCTIONAL DESCRIPTION:
; 1555 1 !
; 1556 1 ! This routine will handle the server function in the v2.0 protocol
; 1557 1 ! for KERMIT. This routine by it's nature will call various operating
; 1558 1 ! system routines to do things like logging off the system.
; 1559 1 !
; 1560 1 ! CALLING SEQUENCE:
; 1561 1 !
; 1562 1 ! EXIT%FLAG = SERVER();
; 1563 1 !
; 1564 1 ! INPUT PARAMETERS:
; 1565 1 !
; 1566 1 ! None.
; 1567 1 !
; 1568 1 ! IMPLICIT INPUTS:
; 1569 1 !
; 1570 1 ! None.
; 1571 1 !
; 1572 1 ! OUTPUT PARAMETERS:
; 1573 1 !
; 1574 1 ! None.
; 1575 1 !
; 1576 1 ! IMPLICIT OUTPUTS:
; 1577 1 !
; 1578 1 ! None.
; 1579 1 !
; 1580 1 ! COMPLETION CODES:
; 1581 1 !
; 1582 1 ! None.
; 1583 1 !
; 1584 1 ! SIDE EFFECTS:
; 1585 1 !
; 1586 1 ! None.
; 1587 1 !
; 1588 1 !--
; 1589 1
; 1590 2 BEGIN
; 1591 2
; 1592 2 LOCAL
; 1593 2 STATUS; ! Status returned by various routines
; 1594 2
; 1595 2 DO
; 1596 3 BEGIN
; 1597 3 INIT%XFR ();
; 1598 3 XFR%STATUS (%C'T', %C'I'); ! Now idle
; 1599 3 STATUS = DO%TRANSACTION (STATE%ID);
; 1600 3 END
; 1601 2 UNTIL .STATUS EQL KER%EXIT OR .STATUS EQL KER%ABORTED;
; 1602 2
; 1603 2 RETURN .STATUS;
; 1604 1 END; ! End of GLOBAL ROUTINE SERVER
SERVER::PUSH SP,AC16 ; 1551
L.2: PUSHJ SP,U.32 ; 1597
PUSH SP,C.5 ; 1598
PUSH SP,C.6
PUSHJ SP,XFR%STATUS
PUSH SP,C.7 ; 1599
PUSHJ SP,U.1
MOVE AC16,AC1
ADJSP SP,-3 ; 1596
CAIN AC16,223 ; 1601
JRST L.3
CAIE AC16,312
JRST L.2 ; 1595
L.3: MOVE AC1,AC16 ; 1590
POP SP,AC16 ; 1551
POPJ SP,
C.5: EXP 124
C.6: EXP 111
C.7: EXP 16
; Routine Size: 19 words
; 1605 1
; 1606 1 %SBTTL 'SEND%SWITCH'
; 1607 1
; 1608 1 GLOBAL ROUTINE SEND%SWITCH =
; 1609 1
; 1610 1 !++
; 1611 1 ! FUNCTIONAL DESCRIPTION:
; 1612 1 !
; 1613 1 ! This routine is the state table switcher for sending files. It
; 1614 1 ! loops until either it is finished or an error is encountered. The
; 1615 1 ! routines called by SEND%SWITCH are responsible for changing the state.
; 1616 1 !
; 1617 1 ! CALLING SEQUENCE:
; 1618 1 !
; 1619 1 ! SEND%SWITCH();
; 1620 1 !
; 1621 1 ! INPUT PARAMETERS:
; 1622 1 !
; 1623 1 ! None.
; 1624 1 !
; 1625 1 ! IMPLICIT INPUTS:
; 1626 1 !
; 1627 1 ! None.
; 1628 1 !
; 1629 1 ! OUTPUT PARAMETERS:
; 1630 1 !
; 1631 1 ! Returns:
; 1632 1 ! TRUE - File sent correctly.
; 1633 1 ! FALSE - Aborted sending the file.
; 1634 1 !
; 1635 1 ! IMPLICIT OUTPUTS:
; 1636 1 !
; 1637 1 ! None.
; 1638 1 !
; 1639 1 ! COMPLETION CODES:
; 1640 1 !
; 1641 1 ! None.
; 1642 1 !
; 1643 1 ! SIDE EFFECTS:
; 1644 1 !
; 1645 1 ! None.
; 1646 1 !
; 1647 1 !--
; 1648 1
; 1649 2 BEGIN
; 1650 2
; 1651 2 LOCAL
; 1652 2 STATUS; ! Status result
; 1653 2
; 1654 2 IF .CONNECT%FLAG THEN SY%DISMISS (.DELAY); ! Sleep if the user wanted us to
; 1655 2
; 1656 2 INIT%XFR (); ! Initialize for this transfer
; 1657 2 TEXT%HEAD%FLAG = FALSE; ! Set text flag correctly
; 1658 2 XFR%STATUS (%C'I', %C'S'); ! Start of file send
; 1659 2 STATUS = DO%TRANSACTION (STATE%S); ! Call routine to do real work
; 1660 2 XFR%STATUS (%C'T', %C'S'); ! Done with send
; 1661 2 RETURN .STATUS; ! Return the result
; 1662 1 END;
SEND%SWITCH::
PUSH SP,AC16 ; 1608
MOVEI AC1,1 ; 1654
TDNN AC1,CONNECT%FLAG
JRST L.4
PUSH SP,DELAY
PUSHJ SP,SY%DISMISS
ADJSP SP,-1
L.4: PUSHJ SP,U.32 ; 1656
SETZM U.62 ; 1657
PUSH SP,C.6 ; 1658
PUSH SP,C.8
PUSHJ SP,XFR%STATUS
PUSH SP,C.2 ; 1659
PUSHJ SP,U.1
MOVE AC16,AC1
PUSH SP,C.5 ; 1660
PUSH SP,C.8
PUSHJ SP,XFR%STATUS
ADJSP SP,-5 ; 1661
MOVE AC1,AC16 ; 1649
POP SP,AC16 ; 1608
POPJ SP,
C.8: EXP 123
; Routine Size: 23 words
; 1663 1
; 1664 1 %SBTTL 'REC%SWITCH'
; 1665 1
; 1666 1 GLOBAL ROUTINE REC%SWITCH =
; 1667 1
; 1668 1 !++
; 1669 1 ! FUNCTIONAL DESCRIPTION:
; 1670 1 !
; 1671 1 ! This routine will cause file(s) to be received by the remote
; 1672 1 ! KERMIT. This routine contains the main loop for the sending of the
; 1673 1 ! data.
; 1674 1 !
; 1675 1 ! CALLING SEQUENCE:
; 1676 1 !
; 1677 1 ! REC%SWITCH();
; 1678 1 !
; 1679 1 ! INPUT PARAMETERS:
; 1680 1 !
; 1681 1 ! None.
; 1682 1 !
; 1683 1 ! IMPLICIT INPUTS:
; 1684 1 !
; 1685 1 ! FILE%DESC - Descriptor describing the file to be received by
; 1686 1 ! the remote KERMIT.
; 1687 1 !
; 1688 1 ! OUTPUT PARAMETERS:
; 1689 1 !
; 1690 1 ! None.
; 1691 1 !
; 1692 1 ! IMPLICIT OUTPUTS:
; 1693 1 !
; 1694 1 ! None.
; 1695 1 !
; 1696 1 ! COMPLETION CODES:
; 1697 1 !
; 1698 1 ! True - File received correctly.
; 1699 1 ! FALSE - File transfer aborted.
; 1700 1 !
; 1701 1 ! SIDE EFFECTS:
; 1702 1 !
; 1703 1 ! None.
; 1704 1 !
; 1705 1 !--
; 1706 1
; 1707 2 BEGIN
; 1708 2
; 1709 2 LOCAL
; 1710 2 INIT%STATE, ! State to start up DO%TRANSACTION in
; 1711 2 STATUS; ! Status returned by various routines
; 1712 2
; 1713 2 INIT%STATE = STATE%R; ! Initialize the state
; 1714 2 MSG%NUMBER = 0;
; 1715 2 INIT%XFR (); ! Initialize the per transfer info
; 1716 2 !
; 1717 2 ! Determine if they said REC <file-spec>
; 1718 2 ! Send MSG%RCV%INIT and then receive the file
; 1719 2 !
; 1720 2
; 1721 2 IF .FILE%SIZE GTR 0
; 1722 2 THEN
; 1723 3 BEGIN
; 1724 3 GEN%TYPE = MSG%RCV%INIT; ! Use receive-init message
; 1725 3 CH$MOVE (.FILE%SIZE, CH$PTR (FILE%NAME), CH$PTR (GEN%1DATA));
; 1726 3 GEN%1SIZE = .FILE%SIZE; ! Save the length
; 1727 3 INIT%STATE = STATE%SI; ! Start out with server init
; 1728 2 END;
; 1729 2
; 1730 2 !
; 1731 2 ! Now receive the file normally
; 1732 2 !
; 1733 2 XFR%STATUS (%C'I', %C'R'); ! Start of a file receive
; 1734 2 STATUS = DO%TRANSACTION (.INIT%STATE);
; 1735 2 XFR%STATUS (%C'T', %C'R'); ! End of file receive
; 1736 2 RETURN .STATUS; ! Return the result
; 1737 1 END; ! End of REC%SWITCH
REC%SWITCH::
PUSH SP,AC16 ; 1666
MOVEI AC16,6 ; 1713
SETZM U.55 ; 1714
PUSHJ SP,U.32 ; 1715
MOVE AC3,FILE%SIZE ; 1721
JUMPLE AC3,L.5
MOVEI AC1,122 ; 1724
MOVEM AC1,U.65
MOVE AC1,AC3 ; 1725
MOVE AC2,C.10
MOVE AC4,AC3
MOVE AC5,C.11
EXTEND AC1,C.9
JFCL
MOVEM AC3,GEN%1SIZE ; 1726
MOVEI AC16,15 ; 1727
L.5: PUSH SP,C.6 ; 1733
PUSH SP,C.12
PUSHJ SP,XFR%STATUS
MOVEM AC16,0(SP) ; 1734
PUSHJ SP,U.1
MOVE AC16,AC1
PUSH SP,C.5 ; 1735
PUSH SP,C.12
PUSHJ SP,XFR%STATUS
ADJSP SP,-4 ; 1736
MOVE AC1,AC16 ; 1707
POP SP,AC16 ; 1666
POPJ SP,
C.9: MOVSLJ
C.10: POINT 7,FILE%NAME-1,34
C.11: POINT 7,GEN%1DATA-1,34
C.12: EXP 122
; Routine Size: 33 words
; 1738 1
; 1739 1 %SBTTL 'Server -- DO%GENERIC - Execute a generic command'
; 1740 1
; 1741 1 GLOBAL ROUTINE DO%GENERIC (TYPE) =
; 1742 1
; 1743 1 !++
; 1744 1 ! FUNCTIONAL DESCRIPTION:
; 1745 1 !
; 1746 1 ! This routine will send a generic command to the remote Kermit.
; 1747 1 ! it will do all the processing required for the generic command
; 1748 1 ! that was executed. It will return to the caller after the
; 1749 1 ! command has be executed.
; 1750 1 !
; 1751 1 ! CALLING SEQUENCE:
; 1752 1 !
; 1753 1 ! STATUS = DO%GENERIC (Command-type);
; 1754 1 !
; 1755 1 ! INPUT PARAMETERS:
; 1756 1 !
; 1757 1 ! Command-type -- Command type to be executed.
; 1758 1 !
; 1759 1 ! IMPLICIT INPUTS:
; 1760 1 !
; 1761 1 ! None.
; 1762 1 !
; 1763 1 ! OUTPUT PARAMETERS:
; 1764 1 !
; 1765 1 ! None.
; 1766 1 !
; 1767 1 ! IMPLICIT OUTPUTS:
; 1768 1 !
; 1769 1 ! None.
; 1770 1 !
; 1771 1 ! COMPLETION CODES:
; 1772 1 !
; 1773 1 ! None.
; 1774 1 !
; 1775 1 ! SIDE EFFECTS:
; 1776 1 !
; 1777 1 ! None.
; 1778 1 !
; 1779 1 !--
; 1780 1
; 1781 2 BEGIN
; 1782 2
; 1783 2 LOCAL
; 1784 2 INIT%STATE; ! Initial state for FSM
; 1785 2
; 1786 2 !
; 1787 2 ! Set up the per transfer items
; 1788 2 !
; 1789 2 INIT%XFR ();
; 1790 2 NUM%RETRIES = 0;
; 1791 2 MSG%NUMBER = 0;
; 1792 2 !
; 1793 2 ! These are all generic commands
; 1794 2 !
; 1795 2 GEN%TYPE = MSG%GENERIC;
; 1796 2 !
; 1797 2 ! Assume we will not need server init
; 1798 2 !
; 1799 2 INIT%STATE = STATE%SG;
; 1800 2
; 1801 2 CASE .TYPE FROM GC%MIN TO GC%MAX OF
; 1802 2 SET
; 1803 2
; 1804 2 [GC%EXIT] :
; 1805 2 GEN%SUBTYPE = MSG%GEN%EXIT;
; 1806 2
; 1807 2 [GC%LOGOUT] :
; 1808 2 GEN%SUBTYPE = MSG%GEN%LOGOUT;
; 1809 2
; 1810 2 [GC%DIRECTORY] :
; 1811 3 BEGIN
; 1812 3 INIT%STATE = STATE%SI; ! We will need server-init
; 1813 3 GEN%SUBTYPE = MSG%GEN%DIRECTORY;
; 1814 2 END;
; 1815 2
; 1816 2 [GC%DISK%USAGE] :
; 1817 3 BEGIN
; 1818 3 INIT%STATE = STATE%SI; ! We will need server-init
; 1819 3 GEN%SUBTYPE = MSG%GEN%DISK%USAGE;
; 1820 2 END;
; 1821 2
; 1822 2 [GC%DELETE] :
; 1823 2 GEN%SUBTYPE = MSG%GEN%DELETE;
; 1824 2
; 1825 2 [GC%TYPE] :
; 1826 3 BEGIN
; 1827 3 INIT%STATE = STATE%SI; ! We will need server-init
; 1828 3 GEN%SUBTYPE = MSG%GEN%TYPE;
; 1829 2 END;
; 1830 2
; 1831 2 [GC%HELP] :
; 1832 3 BEGIN
; 1833 3 INIT%STATE = STATE%SI; ! We will need server-init
; 1834 3 GEN%SUBTYPE = MSG%GEN%HELP;
; 1835 2 END;
; 1836 2
; 1837 2 [GC%LGN] :
; 1838 2 GEN%SUBTYPE = MSG%GEN%LOGIN; ! Login just gets ACK
; 1839 2
; 1840 2 [GC%CONNECT] :
; 1841 2 GEN%SUBTYPE = MSG%GEN%CONNECT; ! CWD just gets ACK
; 1842 2
; 1843 2 [GC%RENAME] :
; 1844 2 GEN%SUBTYPE = MSG%GEN%RENAME; ! Rename file just needs ACK
; 1845 2
; 1846 2 [GC%COPY] :
; 1847 2 GEN%SUBTYPE = MSG%GEN%COPY; ! Copy file just needs ACK
; 1848 2
; 1849 2 [GC%WHO] :
; 1850 3 BEGIN
; 1851 3 INIT%STATE = STATE%SI; ! May get large response
; 1852 3 GEN%SUBTYPE = MSG%GEN%WHO;
; 1853 2 END;
; 1854 2
; 1855 2 [GC%SEND%MSG] :
; 1856 2 GEN%SUBTYPE = MSG%GEN%SEND; ! Just need an ACK
; 1857 2
; 1858 2 [GC%STATUS] :
; 1859 3 BEGIN
; 1860 3 INIT%STATE = STATE%SI; ! May get large response
; 1861 3 GEN%SUBTYPE = MSG%GEN%QUERY;
; 1862 2 END;
; 1863 2
; 1864 2 [GC%COMMAND] :
; 1865 3 BEGIN
; 1866 3 INIT%STATE = STATE%SI; ! Large response likely
; 1867 3 GEN%TYPE = MSG%COMMAND; ! This is host command
; 1868 2 END;
; 1869 2
; 1870 2 [GC%KERMIT] :
; 1871 2 GEN%TYPE = MSG%KERMIT; ! Perform Kermit command (short response)
; 1872 2
; 1873 2 [GC%PROGRAM] :
; 1874 3 BEGIN
; 1875 3 INIT%STATE = STATE%SI; ! Assume large response
; 1876 3 GEN%SUBTYPE = MSG%GEN%PROGRAM; ! Generic program command
; 1877 2 END;
; 1878 2
; 1879 2 [GC%JOURNAL] :
; 1880 2 GEN%SUBTYPE = MSG%GEN%JOURNAL; ! Do journal function (short reply)
; 1881 2
; 1882 2 [GC%VARIABLE] :
; 1883 2 GEN%SUBTYPE = MSG%GEN%VARIABLE; ! Set or get a variable value
; 1884 2
; 1885 2 [INRANGE, OUTRANGE] :
; 1886 3 BEGIN
; 1887 3 KRM%ERROR (KER%UNIMPLGEN);
; 1888 3 RETURN STATE%A;
; 1889 2 END;
; 1890 2 TES;
; 1891 2
; 1892 2 RETURN DO%TRANSACTION (.INIT%STATE); ! Go do the command
; 1893 1 END; ! End of DO%GENERIC
DO%GENERIC::
PUSH SP,AC16 ; 1741
PUSHJ SP,U.32 ; 1789
SETZM U.54 ; 1790
SETZM U.55 ; 1791
MOVEI AC1,107 ; 1795
MOVEM AC1,U.65
MOVEI AC16,14 ; 1799
MOVE AC1,-2(SP) ; 1801
SOJL AC1,L.7
CAIGE AC1,23
JRST L.6(AC1)
JRST L.7
L.6: JRST L.8
JRST L.10
JRST L.11
JRST L.12
JRST L.13
JRST L.14
JRST L.9
JRST L.15
JRST L.16
JRST L.17
JRST L.18
JRST L.19
JRST L.20
JRST L.21
JRST L.22
JRST L.23
JRST L.26
JRST L.27
JRST L.25
L.7: PUSH SP,C.13 ; 1887
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 1888
MOVEI AC1,12 ; 1886
JRST L.30
L.8: MOVEI AC1,106 ; 1805
JRST L.28
L.9: MOVEI AC1,114 ; 1808
JRST L.28
L.10: MOVEI AC16,15 ; 1812
MOVEI AC1,104 ; 1813
JRST L.28
L.11: MOVEI AC16,15 ; 1818
MOVEI AC1,125 ; 1819
JRST L.28
L.12: MOVEI AC1,105 ; 1823
JRST L.28
L.13: MOVEI AC16,15 ; 1827
MOVEI AC1,124 ; 1828
JRST L.28
L.14: MOVEI AC16,15 ; 1833
MOVEI AC1,110 ; 1834
JRST L.28
L.15: MOVEI AC1,111 ; 1838
JRST L.28
L.16: MOVEI AC1,103 ; 1841
JRST L.28
L.17: MOVEI AC1,122 ; 1844
JRST L.28
L.18: MOVEI AC1,113 ; 1847
JRST L.28
L.19: MOVEI AC16,15 ; 1851
MOVEI AC1,127 ; 1852
JRST L.28
L.20: MOVEI AC1,115 ; 1856
JRST L.28
L.21: MOVEI AC16,15 ; 1860
MOVEI AC1,121 ; 1861
JRST L.28
L.22: MOVEI AC16,15 ; 1866
MOVEI AC1,103 ; 1867
JRST L.24
L.23: MOVEI AC1,113 ; 1871
L.24: MOVEM AC1,U.65
JRST L.29 ; 1801
L.25: MOVEI AC16,15 ; 1875
MOVEI AC1,120 ; 1876
JRST L.28
L.26: MOVEI AC1,112 ; 1880
JRST L.28
L.27: MOVEI AC1,126 ; 1883
L.28: MOVEM AC1,U.66
L.29: PUSH SP,AC16 ; 1892
PUSHJ SP,U.1
ADJSP SP,-1
L.30: POP SP,AC16 ; 1741
POPJ SP,
C.13: EXP 232
; Routine Size: 89 words
; 1894 1
; 1895 1 %SBTTL 'DO%TRANSACTION - Main loop for FSM'
; 1896 1 ROUTINE DO%TRANSACTION (INIT%STATE) =
; 1897 1
; 1898 1 !++
; 1899 1 ! FUNCTIONAL DESCRIPTION:
; 1900 1 !
; 1901 1 ! This is the main routine for performing a Kermit transaction.
; 1902 1 ! It is structured as a finite state machine with each state
; 1903 1 ! determining the next based upon the packet which is received.
; 1904 1 ! It is supplied with the initial state by the caller.
; 1905 1 !
; 1906 1 ! CALLING SEQUENCE:
; 1907 1 !
; 1908 1 ! Status = DO%TRANSACTION(.INIT%STATE);
; 1909 1 !
; 1910 1 ! INPUT PARAMETERS:
; 1911 1 !
; 1912 1 ! INIT%STATE - Initial state.
; 1913 1 !
; 1914 1 ! IMPLICIT INPUTS:
; 1915 1 !
; 1916 1 ! None.
; 1917 1 !
; 1918 1 ! OUTPUT PARAMETERS:
; 1919 1 !
; 1920 1 ! None.
; 1921 1 !
; 1922 1 ! IMPLICIT OUTPUTS:
; 1923 1 !
; 1924 1 ! None.
; 1925 1 !
; 1926 1 ! COMPLETION CODES:
; 1927 1 !
; 1928 1 ! None.
; 1929 1 !
; 1930 1 ! SIDE EFFECTS:
; 1931 1 !
; 1932 1 ! None.
; 1933 1 !
; 1934 1 !--
; 1935 1
; 1936 2 BEGIN
; 1937 2
; 1938 2 LOCAL
; 1939 2 RETURN%VALUE;
; 1940 2
; 1941 2 NUM%RETRIES = 0; ! Initialize the number of retries
; 1942 2 STATE = .INIT%STATE; ! Initialize the state
; 1943 2
; 1944 2 WHILE TRUE DO
; 1945 2
; 1946 2 CASE .STATE FROM STATE%MIN TO STATE%MAX OF
; 1947 2 SET
; 1948 2 !
; 1949 2 ! Send states
; 1950 2 !
; 1951 2
; 1952 2 [STATE%ID] :
; 1953 2 !
; 1954 2 ! Server while idle. Set the timeout to twice the normal wait
; 1955 2 ! and wait for something to show up
; 1956 2 !
; 1957 3 BEGIN
; 1958 3
; 1959 3 LOCAL
; 1960 3 SAVED%TIMEOUT;
; 1961 3
; 1962 3 SAVED%TIMEOUT = .SEND%TIMEOUT;
; 1963 3
; 1964 3 IF .SEND%TIMEOUT NEQ 0 THEN SEND%TIMEOUT = .SRV%TIMEOUT;
; 1965 3
; 1966 3 STATE = REC%SERVER%IDLE ();
; 1967 3 SEND%TIMEOUT = .SAVED%TIMEOUT;
; 1968 2 END;
; 1969 2
; 1970 2 [STATE%II] :
; 1971 2 !
; 1972 2 ! Here while server idle after having received a server-init packet
; 1973 2 !
; 1974 2 STATE = REC%SERVER%IDLE ();
; 1975 2
; 1976 2 [STATE%FI, STATE%LG] :
; 1977 2 !
; 1978 2 ! Here when we are supposed to exit
; 1979 2 !
; 1980 2 RETURN KER%EXIT;
; 1981 2
; 1982 2 [STATE%SD] :
; 1983 2 STATE = SEND%DATA ();
; 1984 2
; 1985 2 [STATE%SF] :
; 1986 2 STATE = SEND%FILE ();
; 1987 2
; 1988 2 [STATE%SZ] :
; 1989 2 STATE = SEND%EOF ();
; 1990 2
; 1991 2 [STATE%S] :
; 1992 2 STATE = SEND%INIT ();
; 1993 2
; 1994 2 [STATE%OF] :
; 1995 2 STATE = SEND%OPEN%FILE ();
; 1996 2
; 1997 2 [STATE%SI] :
; 1998 2 STATE = SEND%SERVER%INIT ();
; 1999 2
; 2000 2 [STATE%SG] :
; 2001 2 STATE = SEND%GENCMD ();
; 2002 2
; 2003 2 [STATE%SB] :
; 2004 2 STATE = SEND%BREAK ();
; 2005 2 !
; 2006 2 ! Receiving of the data and the end of file message.
; 2007 2 !
; 2008 2
; 2009 2 [STATE%RD] :
; 2010 2 STATE = REC%DATA ();
; 2011 2 !
; 2012 2 ! Receiving the FILE information of the break to end the transfer of
; 2013 2 ! one or more files
; 2014 2 !
; 2015 2
; 2016 2 [STATE%RF] :
; 2017 2 STATE = REC%FILE ();
; 2018 2 !
; 2019 2 ! Initialization for the receiving of a file
; 2020 2 !
; 2021 2
; 2022 2 [STATE%R] :
; 2023 2 STATE = REC%INIT ();
; 2024 2 !
; 2025 2 ! Here if we have completed the receiving of the file
; 2026 2 !
; 2027 2
; 2028 2 [STATE%C] :
; 2029 3 BEGIN
; 2030 3 RETURN%VALUE = TRUE;
; 2031 3 EXITLOOP;
; 2032 2 END;
; 2033 2 !
; 2034 2 ! Here if we aborted the transfer or we have gotten into some random
; 2035 2 ! state (internal KERMSG problem).
; 2036 2 !
; 2037 2
; 2038 2 [STATE%A, STATE%EX, STATE%ER, INRANGE, OUTRANGE] :
; 2039 3 BEGIN
; 2040 3 RETURN%VALUE = FALSE;
; 2041 3
; 2042 3 IF .STATE EQL STATE%EX THEN RETURN%VALUE = KER%ABORTED;
; 2043 3
; 2044 3 !
; 2045 3 ! Determine if the file is still open and if so close it
; 2046 3 !
; 2047 3
; 2048 3 IF .FLAG%FILE%OPEN
; 2049 3 THEN
; 2050 4 BEGIN
; 2051 4 FLAG%FILE%OPEN = FALSE;
; 2052 4
; 2053 4 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 2054 4 THEN
; 2055 5 BEGIN
; 2056 5 TT%TEXT (UPLIT (%ASCIZ' [Aborted]'));
; 2057 5 TT%CRLF ();
; 2058 4 END;
; 2059 4
; 2060 5 FILE%CLOSE (.ABT%FLAG AND (.STATE EQL STATE%A OR .STATE EQL STATE%EX OR .STATE
; 2061 4 EQL STATE%ER));
; 2062 4 XFR%STATUS (%C'F', %C'A');
; 2063 3 END;
; 2064 3
; 2065 3 !
; 2066 3 ! Give error if aborted due to too many retries
; 2067 3 !
; 2068 3
; 2069 3 IF .STATE EQL STATE%ER THEN KRM%ERROR (KER%RETRIES);
; 2070 3
; 2071 3 EXITLOOP;
; 2072 2 END;
; 2073 2 TES;
; 2074 2
; 2075 2 !
; 2076 2 ! End the stats and return to the caller
; 2077 2 !
; 2078 2 END%STATS ();
; 2079 2 !
; 2080 2 RETURN .RETURN%VALUE;
; 2081 1 END; ! End of DO%TRANSACTION
P.AAA: BYTE (7)" ","[","A","b","o"
BYTE (7)"r","t","e","d","]"
BYTE (7)000,000,000,000,000
; DO%TRANSACTION
U.1: PUSH SP,AC14 ; 1896
PUSH SP,AC16
SETZM U.54 ; 1941
MOVE AC1,-3(SP) ; 1942
L.31: MOVEM AC1,U.51
L.32: MOVE AC1,U.51 ; 1946
MOVE AC2,AC1
SOJL AC2,L.34
CAIGE AC2,24
JRST L.33(AC2)
JRST L.34
L.33: JRST L.44
JRST L.42
JRST L.41
JRST L.43
JRST L.48
JRST L.51
JRST L.50
JRST L.49
JRST L.52
JRST L.34
JRST L.34
JRST L.47
JRST L.46
JRST L.37
JRST L.39
JRST L.40
JRST L.40
JRST L.45
JRST L.34
JRST L.34
L.34: SETZ AC14, ; 2040
CAIN AC1,23 ; 2042
MOVEI AC14,312
MOVEI AC1,1 ; 2048
TDNN AC1,FLAG%FILE%OPEN
JRST L.36
SETZM FLAG%FILE%OPEN ; 2051
MOVEI AC1,1 ; 2053
TDNE AC1,CONNECT%FLAG
JRST L.35
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.35
PUSH SP,C.14 ; 2056
PUSHJ SP,TT%TEXT
ADJSP SP,-1
PUSHJ SP,TT%CRLF ; 2057
L.35: MOVE AC3,U.51 ; 2060
SETZ AC1,
CAIN AC3,12
MOVEI AC1,1
SETZ AC2,
CAIN AC3,23
MOVEI AC2,1
IOR AC2,AC1
SETZ AC1, ; 2061
CAIN AC3,24
MOVEI AC1,1
IOR AC1,AC2 ; 2060
AND AC1,ABT%FLAG
PUSH SP,AC1
PUSHJ SP,FILE%CLOSE
ADJSP SP,-1
PUSH SP,C.15 ; 2062
PUSH SP,C.16
PUSHJ SP,XFR%STATUS
ADJSP SP,-2
L.36: MOVEI AC1,24 ; 2069
CAME AC1,U.51
JRST L.53
PUSH SP,C.17
PUSHJ SP,KRM%ERROR
ADJSP SP,-1
JRST L.53
L.37: MOVE AC1,SEND%TIMEOUT ; 1962
MOVE AC16,AC1
JUMPE AC1,L.38 ; 1964
MOVE AC1,SRV%TIMEOUT
MOVEM AC1,SEND%TIMEOUT
L.38: PUSHJ SP,U.10 ; 1966
MOVEM AC1,U.51
MOVEM AC16,SEND%TIMEOUT ; 1967
JRST L.32 ; 1946
L.39: PUSHJ SP,U.10 ; 1974
JRST L.31
L.40: MOVEI AC1,223 ; 1980
JRST L.54
L.41: PUSHJ SP,U.3 ; 1983
JRST L.31
L.42: PUSHJ SP,U.4 ; 1986
JRST L.31
L.43: PUSHJ SP,U.7 ; 1989
JRST L.31
L.44: PUSHJ SP,U.8 ; 1992
JRST L.31
L.45: PUSHJ SP,U.5 ; 1995
JRST L.31
L.46: PUSHJ SP,U.2 ; 1998
JRST L.31
L.47: PUSHJ SP,U.6 ; 2001
JRST L.31
L.48: PUSHJ SP,U.9 ; 2004
JRST L.31
L.49: PUSHJ SP,U.13 ; 2010
JRST L.31
L.50: PUSHJ SP,U.12 ; 2017
JRST L.31
L.51: PUSHJ SP,U.11 ; 2023
JRST L.31
L.52: MOVEI AC14,1 ; 2030
L.53: PUSHJ SP,U.18 ; 2078
MOVE AC1,AC14 ; 1936
L.54: POP SP,AC16 ; 1896
POP SP,AC14
POPJ SP,
C.14: XWD 0,P.AAA
C.15: EXP 106
C.16: EXP 101
C.17: EXP 212
; Routine Size: 120 words
; 2082 1 %SBTTL 'REC%SERVER%IDLE - Idle server state'
; 2083 1 ROUTINE REC%SERVER%IDLE =
; 2084 1
; 2085 1 !++
; 2086 1 ! FUNCTIONAL DESCRIPTION:
; 2087 1 !
; 2088 1 ! This routine is called from DO%TRANSACTION when is the server idle
; 2089 1 ! state. It will receive a message and properly dispatch to the new
; 2090 1 ! state.
; 2091 1 !
; 2092 1 ! CALLING SEQUENCE:
; 2093 1 !
; 2094 1 ! STATE = REC%SERVER%IDLE ();
; 2095 1 !
; 2096 1 ! INPUT PARAMETERS:
; 2097 1 !
; 2098 1 ! None.
; 2099 1 !
; 2100 1 ! IMPLICIT INPUTS:
; 2101 1 !
; 2102 1 ! Almost everything.
; 2103 1 !
; 2104 1 ! OUPTUT PARAMETERS:
; 2105 1 !
; 2106 1 ! Routine value is new state for FSM
; 2107 1 !
; 2108 1 ! IMPLICIT OUTPUTS:
; 2109 1 !
; 2110 1 ! None.
; 2111 1 !
; 2112 1 ! COMPLETION CODES:
; 2113 1 !
; 2114 1 ! None.
; 2115 1 !
; 2116 1 ! SIDE EFFECTS:
; 2117 1 !
; 2118 1 ! None.
; 2119 1 !
; 2120 1 !--
; 2121 1
; 2122 2 BEGIN
; 2123 2
; 2124 2 LOCAL
; 2125 2 STATUS;
; 2126 2
; 2127 2 STATUS = REC%PACKET ();
; 2128 2 !
; 2129 2 ! Now determine what to do by the type of message we have receive.
; 2130 2 !
; 2131 2
; 2132 2 IF .STATUS EQL KER%ABORTED THEN RETURN STATE%EX;
; 2133 2
; 2134 2 IF .STATUS
; 2135 2 THEN
; 2136 3 BEGIN
; 2137 3
; 2138 3 SELECTONE .REC%TYPE OF
; 2139 3 SET
; 2140 3 !
; 2141 3 ! Server initialization message received. ACK the
; 2142 3 ! message and continue.
; 2143 3 !
; 2144 3
; 2145 3 [MSG%SER%INIT] :
; 2146 4 BEGIN
; 2147 4
; 2148 5 IF (STATUS = PRS%SEND%INIT ())
; 2149 4 THEN
; 2150 5 BEGIN
; 2151 5 SET%SEND%INIT ();
; 2152 5
; 2153 6 IF (STATUS = SEND%PACKET (MSG%ACK, .SEND%INIT%SIZE, .REC%SEQ)) ! [108]
; 2154 5 THEN
; 2155 6 BEGIN
; 2156 6 SND%PKT%SIZE = -.SEND%PKT%SIZE;
; 2157 6 SND%TIMEOUT = -.SEND%TIMEOUT;
; 2158 6 SND%NPAD = -.SEND%NPAD;
; 2159 6 SND%PADCHAR = -.SEND%PADCHAR;
; 2160 6 SND%EOL = -.SEND%EOL;
; 2161 6 SND%QUOTE%CHR = -.SEND%QUOTE%CHR;
; 2162 6 RCV%8QUOTE%CHR = .SEND%8QUOTE%CHR;
; 2163 6 CHKTYPE = .INI%CHK%TYPE;
; 2164 6 SET%REPT%CHR = .REPT%CHR;
; 2165 6 RETURN STATE%II; ! Now idle after INIT
; 2166 5 END;
; 2167 5
; 2168 4 END;
; 2169 4
; 2170 4 KRM%ERROR (KER%PROTOERR);
; 2171 4 RETURN STATE%A;
; 2172 3 END;
; 2173 3 !
; 2174 3 ! Send init message received. We must ACK the message and
; 2175 3 ! then attempt to receive a file from the remote.
; 2176 3 !
; 2177 3
; 2178 3 [MSG%SND%INIT] :
; 2179 4 BEGIN
; 2180 4 MSG%NUMBER = (.REC%SEQ + 1) AND %O'77';
; 2181 4
; 2182 5 IF (STATUS = PRS%SEND%INIT ())
; 2183 4 THEN
; 2184 5 BEGIN
; 2185 5 SET%SEND%INIT ();
; 2186 5 !
; 2187 5 ! ACK the message then receive everything.
; 2188 5 !
; 2189 5
; 2190 5 IF SEND%PACKET (MSG%ACK, .SEND%INIT%SIZE, .REC%SEQ) ! [108]
; 2191 5 THEN
; 2192 6 BEGIN
; 2193 6 BLK%CHK%TYPE = .INI%CHK%TYPE; ! Switch to desired form of block check
; 2194 6 XFR%STATUS (%C'I', %C'R'); ! Start of file receive
; 2195 6 RETURN STATE%RF;
; 2196 5 END;
; 2197 5
; 2198 4 END;
; 2199 4
; 2200 4 KRM%ERROR (KER%PROTOERR);
; 2201 4 RETURN STATE%A;
; 2202 3 END;
; 2203 3 !
; 2204 3 ! Here if we receive a receive init message.
; 2205 3 ! We will be sending a file to the other end.
; 2206 3 !
; 2207 3
; 2208 3 [MSG%RCV%INIT] :
; 2209 4 BEGIN
; 2210 4 !
; 2211 4 ! Move the file specification if we received one
; 2212 4 !
; 2213 4 SET%STRING (CH$PTR (FILE%NAME), MAX%FILE%NAME, TRUE);
; 2214 4 BFR%EMPTY ();
; 2215 4 FILE%SIZE = SET%STRING (0, 0, FALSE);
; 2216 4 CH$WCHAR (CHR%NUL, CH$PTR (FILE%NAME, .FILE%SIZE));
; 2217 4
; 2218 4 IF .FILE%SIZE GTR 0
; 2219 4 THEN
; 2220 5 BEGIN
; 2221 5 XFR%STATUS (%C'I', %C'S'); ! Start of a file send
; 2222 5 RETURN STATE%S;
; 2223 4 END;
; 2224 4
; 2225 4 KRM%ERROR (KER%PROTOERR);
; 2226 4 RETURN STATE%A;
; 2227 3 END;
; 2228 3 !
; 2229 3 ! Generic KERMIT commands
; 2230 3 !
; 2231 3
; 2232 3 [MSG%GENERIC] :
; 2233 3 RETURN SERVER%GENERIC ();
; 2234 3 !
; 2235 3 ! Host command
; 2236 3 !
; 2237 3
; 2238 3 [MSG%COMMAND] :
; 2239 3 RETURN HOST%COMMAND ();
; 2240 3 !
; 2241 3 ! Kermit command
; 2242 3 !
; 2243 3
; 2244 3 [MSG%KERMIT] :
; 2245 3 RETURN KERMIT%COMMAND ();
; 2246 3 !
; 2247 3 ! Unimplimented server routines
; 2248 3 !
; 2249 3
; 2250 3 [OTHERWISE] :
; 2251 4 BEGIN
; 2252 4 KRM%ERROR (KER%UNISRV);
; 2253 4 RETURN STATE%A;
; 2254 3 END;
; 2255 3 TES;
; 2256 3
; 2257 2 END;
; 2258 2
; 2259 2 !
; 2260 2 ! If we get here, we must have gotten something random. Therefore,
; 2261 2 ! just send a NAK and remain in the current state (unless we have done this
; 2262 2 ! too many times).
; 2263 2 !
; 2264 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 2265 2
; 2266 2 IF .NUM%RETRIES GTR .SI%RETRIES THEN RETURN STATE%A;
; 2267 2
; 2268 2 IF SEND%PACKET (MSG%NAK, 0, 0) THEN RETURN .STATE ELSE RETURN STATE%EX;
; 2269 2
; 2270 1 END; ! End of REC%SERVER%IDLE
; REC%SERVER%IDLE
U.10: PUSH SP,AC14 ; 2083
PUSH SP,AC16
PUSHJ SP,U.26 ; 2127
MOVE AC14,AC1
CAIN AC14,312 ; 2132
JRST L.67
TRNN AC14,1 ; 2134
JRST L.64
MOVE AC16,U.58 ; 2138
CAIE AC16,111 ; 2145
JRST L.55
PUSHJ SP,U.21 ; 2148
MOVE AC14,AC1
TRNN AC14,1
JRST L.56
PUSHJ SP,U.20 ; 2151
PUSH SP,C.20 ; 2153
PUSH SP,U.46
PUSH SP,U.56
PUSHJ SP,U.24
MOVE AC14,AC1
ADJSP SP,-3
TRNN AC14,1
JRST L.56
MOVE AC1,U.40 ; 2156
MOVNM AC1,SND%PKT%SIZE
MOVE AC1,SEND%TIMEOUT ; 2157
MOVNM AC1,SND%TIMEOUT
MOVE AC1,U.41 ; 2158
MOVNM AC1,SND%NPAD
MOVE AC1,U.42 ; 2159
MOVNM AC1,SND%PADCHAR
MOVE AC1,U.43 ; 2160
MOVNM AC1,SND%EOL
MOVE AC1,U.44 ; 2161
MOVNM AC1,SND%QUOTE%CHR
MOVE AC1,U.45 ; 2162
MOVEM AC1,RCV%8QUOTE%CHR
MOVE AC1,U.47 ; 2163
MOVEM AC1,CHKTYPE
MOVE AC1,U.38 ; 2164
MOVEM AC1,SET%REPT%CHR
MOVEI AC1,17 ; 2155
JRST L.68
L.55: CAIE AC16,123 ; 2178
JRST L.57
MOVE AC1,U.56 ; 2180
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
PUSHJ SP,U.21 ; 2182
MOVE AC14,AC1
TRNN AC14,1
JRST L.56
PUSHJ SP,U.20 ; 2185
PUSH SP,C.20 ; 2190
PUSH SP,U.46
PUSH SP,U.56
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.56
MOVE AC1,U.47 ; 2193
MOVEM AC1,U.48
PUSH SP,C.6 ; 2194
PUSH SP,C.12
PUSHJ SP,XFR%STATUS
ADJSP SP,-2 ; 2195
MOVEI AC1,7 ; 2192
JRST L.68
L.56: PUSH SP,C.21 ; 2200
JRST L.63
L.57: CAIE AC16,122 ; 2208
JRST L.59
PUSH SP,C.10 ; 2213
PUSH SP,C.22
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 2214
SETZM -2(SP) ; 2215
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
MOVEM AC1,FILE%SIZE
SETZ AC3, ; 2216
MOVE AC2,FILE%SIZE
MOVE AC4,C.19
MOVE AC1,AC2
ADJBP AC1,AC4
IDPB AC3,AC1
JUMPLE AC2,L.58 ; 2218
PUSH SP,C.6 ; 2221
PUSH SP,C.8
PUSHJ SP,XFR%STATUS
ADJSP SP,-5 ; 2222
MOVEI AC1,1 ; 2220
JRST L.68
L.58: PUSH SP,C.21 ; 2225
PUSHJ SP,KRM%ERROR
ADJSP SP,-4 ; 2209
JRST L.65
L.59: CAIE AC16,107 ; 2232
JRST L.60
PUSHJ SP,U.14 ; 2233
JRST L.68 ; 2138
L.60: CAIE AC16,103 ; 2238
JRST L.61
PUSHJ SP,U.15 ; 2239
JRST L.68 ; 2138
L.61: CAIE AC16,113 ; 2244
JRST L.62
PUSHJ SP,U.16 ; 2245
JRST L.68 ; 2138
L.62: PUSH SP,C.23 ; 2252
L.63: PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 2251
JRST L.65
L.64: AOS AC1,U.54 ; 2266
CAMG AC1,SI%RETRIES
JRST L.66
L.65: MOVEI AC1,12
JRST L.68
L.66: PUSH SP,C.24 ; 2268
PUSH SP,C.25
PUSH SP,C.25
PUSHJ SP,U.24
ADJSP SP,-3
TRNE AC1,1
SKIPA AC1,U.51
L.67: MOVEI AC1,23
L.68: POP SP,AC16 ; 2083
POP SP,AC14
POPJ SP,
C.18: POINT 6,AC1,35
C.19: POINT 7,FILE%NAME,-1
C.20: EXP 131
C.21: EXP 252
C.22: EXP 204
C.23: EXP 242
C.24: EXP 116
C.25: EXP 0
; Routine Size: 141 words
; 2271 1 %SBTTL 'SEND%SERVER%INIT'
; 2272 1 ROUTINE SEND%SERVER%INIT =
; 2273 1
; 2274 1 !++
; 2275 1 ! FUNCTIONAL DESCRIPTION:
; 2276 1 !
; 2277 1 ! This routine will send a server initialization message to the
; 2278 1 ! remote KERMIT.
; 2279 1 !
; 2280 1 ! CALLING SEQUENCE:
; 2281 1 !
; 2282 1 ! STATE = SEND%SERVER%INIT();
; 2283 1 !
; 2284 1 ! INPUT PARAMETERS:
; 2285 1 !
; 2286 1 ! None.
; 2287 1 !
; 2288 1 ! IMPLICIT INPUTS:
; 2289 1 !
; 2290 1 ! RECV%xxx - desired receive parameters
; 2291 1 !
; 2292 1 ! OUTPUT PARAMETERS:
; 2293 1 !
; 2294 1 ! New state to change the finite state machine to.
; 2295 1 !
; 2296 1 ! IMPLICIT OUTPUTS:
; 2297 1 !
; 2298 1 ! SEND%xxx - Other Kermit's desired parameters
; 2299 1 !
; 2300 1 ! COMPLETION CODES:
; 2301 1 !
; 2302 1 ! None.
; 2303 1 !
; 2304 1 ! SIDE EFFECTS:
; 2305 1 !
; 2306 1 ! None.
; 2307 1 !
; 2308 1 !--
; 2309 1
; 2310 2 BEGIN
; 2311 2
; 2312 2 LOCAL
; 2313 2 OLD%OUTPUT, ! Saved terminal output routine
; 2314 2 STATUS; ! Status returned by various routines
; 2315 2
; 2316 2 ![026] Local routine to ignore error message output
; 2317 2 ROUTINE IGNORE%ERROR (ADDRESS, LENGTH) =
; 2318 3 BEGIN
; 2319 3 RETURN TRUE;
; 2320 2 END;
; IGNORE%ERROR
U.76: MOVEI AC1,1 ; 2318
POPJ SP, ; 2317
; Routine Size: 2 words
; 2321 2 SET%SEND%INIT ();
; 2322 2 ![026] If too many tries, just give up. Maybe the other Kermit doesn't
; 2323 2 ![026] know what to do with this packet.
; 2324 2
; 2325 2 IF .NUM%RETRIES GTR .SI%RETRIES THEN RETURN STATE%SG;
; 2326 2
; 2327 2 ![026]
; 2328 2 ![026] Count the number of times we try this
; 2329 2 ![026]
; 2330 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 2331 2
; 2332 2 IF NOT SEND%PACKET (MSG%SER%INIT, .SEND%INIT%SIZE, .MSG%NUMBER) THEN RETURN STATE%A; ! [108]
; 2333 2
; 2334 2 ![026]
; 2335 2 ![026] Determine if we received a packet it good condition. If we timed out
; 2336 2 ![026] just try again. If we get an error packet back, ignore it and
; 2337 2 ![026] just continue. The other Kermit must not support this packet.
; 2338 2 ![026]
; 2339 2 OLD%OUTPUT = TT%SET%OUTPUT (IGNORE%ERROR);
; 2340 2 STATUS = REC%PACKET ();
; 2341 2 TT%OUTPUT ();
; 2342 2 TT%SET%OUTPUT (.OLD%OUTPUT);
; 2343 2
; 2344 2 IF .STATUS EQL KER%ERRMSG THEN RETURN STATE%SG;
; 2345 2
; 2346 2 IF NOT .STATUS
; 2347 2 THEN
; 2348 2
; 2349 4 IF NOT ((.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR (.STATUS EQL
; 2350 3 KER%CHKSUMERR))
; 2351 2 THEN
; 2352 2 RETURN STATE%EX
; 2353 2 ELSE
; 2354 2 RETURN .STATE;
; 2355 2
; 2356 2 !
; 2357 2 ! Determine if the packet is good.
; 2358 2 !
; 2359 2
; 2360 2 IF .REC%TYPE EQL MSG%ACK AND .REC%SEQ EQL .MSG%NUMBER
; 2361 2 THEN
; 2362 3 BEGIN
; 2363 3 !
; 2364 3 ! Here if we have an ACK for the initialization message that was just sent
; 2365 3 ! to the remote KERMIT.
; 2366 3 !
; 2367 3
; 2368 3 IF NOT (STATUS = PRS%SEND%INIT ()) THEN RETURN STATE%A;
; 2369 3
; 2370 3 NUM%RETRIES = 0;
; 2371 3 INIT%PKT%SENT = TRUE; ! We have exchanged init's
; 2372 3 RETURN STATE%SG;
; 2373 2 END;
; 2374 2
; 2375 2 !
; 2376 2 ! If we haven't returned yet, we must have gotten an invalid response.
; 2377 2 ! Just stay in the same state so we try again
; 2378 2 !
; 2379 2 RETURN .STATE;
; 2380 1 END;
; SEND%SERVER%INIT
U.2: PUSH SP,AC14 ; 2272
PUSH SP,AC16
PUSHJ SP,U.20 ; 2321
MOVE AC1,U.54 ; 2325
CAMLE AC1,SI%RETRIES
JRST L.75
AOS U.54 ; 2330
PUSH SP,C.6 ; 2332
PUSH SP,U.46
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.72
PUSH SP,C.26 ; 2339
PUSHJ SP,TT%SET%OUTPUT
MOVE AC14,AC1
PUSHJ SP,U.26 ; 2340
MOVE AC16,AC1
PUSHJ SP,TT%OUTPUT ; 2341
MOVEM AC14,0(SP) ; 2342
PUSHJ SP,TT%SET%OUTPUT
CAIN AC16,162 ; 2344
JRST L.74
TRNE AC16,1 ; 2346
JRST L.71
CAIE AC16,262 ; 2349
CAIN AC16,300
JRST L.69
CAIN AC16,172
JRST L.69
MOVEI AC1,23 ; 2354
JRST L.70
L.69: MOVE AC1,U.51
L.70: ADJSP SP,-1
JRST L.77 ; 2349
L.71: MOVEI AC1,131 ; 2360
CAME AC1,U.58
JRST L.76
MOVE AC1,U.56
CAME AC1,U.55
JRST L.76
PUSHJ SP,U.21 ; 2368
MOVE AC16,AC1
TRNE AC16,1
JRST L.73
ADJSP SP,-1
L.72: MOVEI AC1,12
JRST L.77
L.73: SETZM U.54 ; 2370
MOVEI AC1,1 ; 2371
MOVEM AC1,U.64
L.74: ADJSP SP,-1 ; 2372
L.75: MOVEI AC1,14 ; 2362
JRST L.77
L.76: ADJSP SP,-1 ; 2379
MOVE AC1,U.51 ; 2310
L.77: POP SP,AC16 ; 2272
POP SP,AC14
POPJ SP,
C.26: XWD 0,U.76
; Routine Size: 61 words
; 2381 1 %SBTTL 'SEND%DATA'
; 2382 1 ROUTINE SEND%DATA =
; 2383 1
; 2384 1 !++
; 2385 1 ! FUNCTIONAL DESCRIPTION:
; 2386 1 !
; 2387 1 ! This routine will send a data message to the remote KERMIT.
; 2388 1 !
; 2389 1 ! CALLING SEQUENCE:
; 2390 1 !
; 2391 1 ! STATE = SEND%DATA();
; 2392 1 !
; 2393 1 ! INPUT PARAMETERS:
; 2394 1 !
; 2395 1 ! None.
; 2396 1 !
; 2397 1 ! IMPLICIT INPUTS:
; 2398 1 !
; 2399 1 ! None.
; 2400 1 !
; 2401 1 ! OUTPUT PARAMETERS:
; 2402 1 !
; 2403 1 ! New state to change the finite state machine to.
; 2404 1 !
; 2405 1 ! IMPLICIT OUTPUTS:
; 2406 1 !
; 2407 1 ! None.
; 2408 1 !
; 2409 1 ! COMPLETION CODES:
; 2410 1 !
; 2411 1 ! None.
; 2412 1 !
; 2413 1 ! SIDE EFFECTS:
; 2414 1 !
; 2415 1 ! None.
; 2416 1 !
; 2417 1 !--
; 2418 1
; 2419 2 BEGIN
; 2420 2
; 2421 2 LOCAL
; 2422 2 SUB%TYPE, ! Subtype for XFR%STATUS call
; 2423 2 STATUS; ! Status returned by various routines
; 2424 2
; 2425 2 !
; 2426 2 ! If there is nothing in the data packet, we should not bother to send it.
; 2427 2 ! Instead, we will just call BFR%FILL again to get some more data
; 2428 2 !
; 2429 2
; 2430 2 IF .SIZE NEQ 0 ! [108]
; 2431 2 THEN
; 2432 3 BEGIN
; 2433 3 !
; 2434 3 ! Check to see if the number of retries have been exceeded.
; 2435 3 !
; 2436 3
; 2437 3 IF .NUM%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 2438 3
; 2439 3 !
; 2440 3 ! Not exceeded yet. Increment the number of retries we have attempted
; 2441 3 ! on this message.
; 2442 3 !
; 2443 3 NUM%RETRIES = .NUM%RETRIES + 1;
; 2444 3 !
; 2445 3 ! Attempt to send the packet and abort if the send fails.
; 2446 3 !
; 2447 3
; 2448 3 IF NOT SEND%PACKET (MSG%DATA, .SIZE, .MSG%NUMBER) THEN RETURN STATE%EX;
; 2449 3
; 2450 3 !
; 2451 3 ! Attempt to receive a message from the remote KERMIT.
; 2452 3 !
; 2453 3 STATUS = REC%PACKET ();
; 2454 3
; 2455 3 IF NOT .STATUS
; 2456 3 THEN
; 2457 4 BEGIN
; 2458 4
; 2459 5 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR (.STATUS EQL
; 2460 5 KER%CHKSUMERR)
; 2461 4 THEN
; 2462 4 RETURN .STATE
; 2463 4 ELSE
; 2464 4 RETURN STATE%EX;
; 2465 4
; 2466 3 END;
; 2467 3
; 2468 3 !
; 2469 3 ! Determine if the message is a NAK and the NAK is for the message number
; 2470 3 ! that we are current working on. If the NAK is for the next packet then
; 2471 3 ! treat it like an ACK for this packet
; 2472 3 !
; 2473 3
; 2474 4 IF .REC%TYPE EQL MSG%NAK AND (.REC%SEQ NEQ ((.MSG%NUMBER + 1) AND %O'77'))
; 2475 3 THEN
; 2476 3 RETURN .STATE;
; 2477 3
; 2478 3 !
; 2479 3 ! Make sure we have a NAK or ACK
; 2480 3 !
; 2481 3
; 2482 4 IF NOT (.REC%TYPE EQL MSG%ACK OR .REC%TYPE EQL MSG%NAK)
; 2483 3 THEN
; 2484 3 !
; 2485 3 ! Not an ACK or NAK, abort.
; 2486 3 !
; 2487 4 BEGIN
; 2488 4 KRM%ERROR (KER%PROTOERR);
; 2489 4 RETURN STATE%A;
; 2490 3 END;
; 2491 3
; 2492 3 !
; 2493 3 ! Is this for this message?
; 2494 3 !
; 2495 3
; 2496 3 IF .REC%TYPE EQL MSG%ACK AND .REC%SEQ NEQ .MSG%NUMBER THEN RETURN .STATE;
; 2497 3
; 2498 3 !
; 2499 3 ! It was. Set up for sending the next data message to the remote KERMIT
; 2500 3 ! and return.
; 2501 3 !
; 2502 3 !
; 2503 3 ! Check for data field in ACK indicating abort file or stream
; 2504 3 !
; 2505 3 !
; 2506 3
; 2507 3 IF .REC%TYPE EQL MSG%ACK AND .REC%LENGTH EQL 1
; 2508 3 THEN
; 2509 3
; 2510 3 SELECTONE CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG, CHR%SIZE)) OF ! [108]
; 2511 3 SET
; 2512 3
; 2513 3 [MSG%ACK%ABT%CUR] :
; 2514 3 ABT%CUR%FILE = TRUE;
; 2515 3
; 2516 3 [MSG%ACK%ABT%ALL] :
; 2517 3 ABT%ALL%FILE = TRUE;
; 2518 3 TES;
; 2519 3
; 2520 3 NUM%RETRIES = 0;
; 2521 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 2522 2 END; ! End of IF .SIZE NEQ 0
; 2523 2
; 2524 3 IF (BFR%FILL (FALSE) EQL KER%NORMAL) AND NOT (.ABT%CUR%FILE OR .ABT%ALL%FILE)
; 2525 2 THEN
; 2526 2 RETURN STATE%SD
; 2527 2 ELSE
; 2528 3 BEGIN
; 2529 3
; 2530 3 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 2531 3 THEN
; 2532 4 BEGIN
; 2533 4
; 2534 4 IF .ABT%ALL%FILE
; 2535 4 THEN
; 2536 4 TT%TEXT (UPLIT (%ASCIZ' [Group interrupted]'))
; 2537 4 ELSE
; 2538 4
; 2539 4 IF .ABT%CUR%FILE
; 2540 4 THEN
; 2541 4 TT%TEXT (UPLIT (%ASCIZ' [Interrupted]'))
; 2542 4 ELSE
; 2543 4 TT%TEXT (UPLIT (%ASCIZ' [OK]'));
; 2544 4
; 2545 4 TT%CRLF ();
; 2546 3 END;
; 2547 3
; 2548 3 IF .FLAG%FILE%OPEN THEN FILE%CLOSE (FALSE);
; 2549 3
; 2550 3 SUB%TYPE = %C'C'; ! Assume ok
; 2551 3
; 2552 3 IF .ABT%ALL%FILE
; 2553 3 THEN
; 2554 3 SUB%TYPE = %C'Z'
; 2555 3 ELSE
; 2556 3
; 2557 3 IF .ABT%CUR%FILE THEN SUB%TYPE = %C'X';
; 2558 3
; 2559 3 XFR%STATUS (%C'F', .SUB%TYPE);
; 2560 3 FLAG%FILE%OPEN = FALSE;
; 2561 3 RETURN STATE%SZ;
; 2562 2 END;
; 2563 2
; 2564 1 END;
P.AAB: BYTE (7)" ","[","G","r","o"
BYTE (7)"u","p"," ","i","n"
BYTE (7)"t","e","r","r","u"
BYTE (7)"p","t","e","d","]"
BYTE (7)000,000,000,000,000
P.AAC: BYTE (7)" ","[","I","n","t"
BYTE (7)"e","r","r","u","p"
BYTE (7)"t","e","d","]",000
P.AAD: BYTE (7)" ","[","O","K","]"
BYTE (7)000,000,000,000,000
; SEND%DATA
U.3: MOVE AC1,U.52 ; 2430
JUMPE AC1,L.87
MOVE AC2,U.54 ; 2437
CAMG AC2,PKT%RETRIES
JRST L.78
MOVEI AC1,24
POPJ SP,
L.78: AOS U.54 ; 2443
PUSH SP,C.28 ; 2448
PUSH SP,AC1
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.79
PUSHJ SP,U.26 ; 2453
TRNE AC1,1 ; 2455
JRST L.80
CAIE AC1,262 ; 2459
CAIN AC1,300
JRST L.83
CAIN AC1,172
JRST L.83 ; 2462
L.79: MOVEI AC1,23 ; 2464
POPJ SP, ; 2457
L.80: MOVE AC2,U.58 ; 2474
SETZ AC3,
CAIE AC2,116
JRST L.81
MOVEI AC3,1
MOVE AC1,U.55
ADDI AC1,1
LDB AC4,C.18
CAME AC4,U.56
JRST L.83
L.81: CAIE AC2,131 ; 2482
TRNE AC3,1
JRST L.82
PUSH SP,C.21 ; 2488
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 2489
MOVEI AC1,12 ; 2487
POPJ SP,
L.82: SETZ AC1, ; 2496
MOVEI AC2,131
CAME AC2,U.58
JRST L.84
MOVEI AC1,1
MOVE AC2,U.56
CAMN AC2,U.55
JRST L.84
L.83: MOVE AC1,U.51
POPJ SP,
L.84: TRNN AC1,1 ; 2507
JRST L.86
MOVEI AC1,1
CAME AC1,U.57
JRST L.86
MOVE AC2,C.27 ; 2510
MOVE AC1,U.39
ADJBP AC1,AC2
ILDB AC1,AC1
CAIE AC1,130 ; 2513
JRST L.85
MOVEI AC2,1 ; 2514
MOVEM AC2,ABT%CUR%FILE
JRST L.86 ; 2510
L.85: CAIE AC1,132 ; 2516
JRST L.86
MOVEI AC1,1 ; 2517
MOVEM AC1,ABT%ALL%FILE
L.86: SETZM U.54 ; 2520
MOVE AC1,U.55 ; 2521
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
L.87: PUSH SP,C.25 ; 2524
PUSHJ SP,U.29
ADJSP SP,-1
CAIE AC1,13
JRST L.88
MOVEI AC1,1
TDNE AC1,ABT%CUR%FILE
JRST L.88
MOVEI AC1,1
TDNE AC1,ABT%ALL%FILE
JRST L.88
MOVEI AC1,3 ; 2528
POPJ SP,
L.88: MOVEI AC1,1 ; 2530
TDNE AC1,CONNECT%FLAG
JRST L.92
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.92
MOVEI AC1,1 ; 2534
TDNN AC1,ABT%ALL%FILE
JRST L.89
PUSH SP,C.29 ; 2536
JRST L.91
L.89: MOVEI AC1,1 ; 2539
TDNN AC1,ABT%CUR%FILE
JRST L.90
PUSH SP,C.30 ; 2541
JRST L.91
L.90: PUSH SP,C.31 ; 2543
L.91: PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 2545
ADJSP SP,-1 ; 2532
L.92: MOVEI AC1,1 ; 2548
TDNN AC1,FLAG%FILE%OPEN
JRST L.93
PUSH SP,C.25
PUSHJ SP,FILE%CLOSE
ADJSP SP,-1
L.93: MOVEI AC1,103 ; 2550
MOVEI AC2,1 ; 2552
TDNN AC2,ABT%ALL%FILE
JRST L.94
MOVEI AC1,132 ; 2554
JRST L.95 ; 2552
L.94: MOVEI AC2,1 ; 2557
TDNE AC2,ABT%CUR%FILE
MOVEI AC1,130
L.95: PUSH SP,C.15 ; 2559
PUSH SP,AC1
PUSHJ SP,XFR%STATUS
SETZM FLAG%FILE%OPEN ; 2560
ADJSP SP,-2 ; 2528
MOVEI AC1,4
POPJ SP, ; 2382
C.27: POINT 8,U.59,-1
C.28: EXP 104
C.29: XWD 0,P.AAB
C.30: XWD 0,P.AAC
C.31: XWD 0,P.AAD
; Routine Size: 136 words
; 2565 1 %SBTTL 'SEND%FILE'
; 2566 1 ROUTINE SEND%FILE =
; 2567 1
; 2568 1 !++
; 2569 1 ! FUNCTIONAL DESCRIPTION:
; 2570 1 !
; 2571 1 ! This routine will send the file specification that is being
; 2572 1 ! transfered, or it will send a text header message.
; 2573 1 !
; 2574 1 ! CALLING SEQUENCE:
; 2575 1 !
; 2576 1 ! STATE = SEND%FILE();
; 2577 1 !
; 2578 1 ! INPUT PARAMETERS:
; 2579 1 !
; 2580 1 ! None.
; 2581 1 !
; 2582 1 ! IMPLICIT INPUTS:
; 2583 1 !
; 2584 1 ! TEXT%HEAD%FLAG - If true, send text header instead of file header
; 2585 1 !
; 2586 1 ! OUTPUT PARAMETERS:
; 2587 1 !
; 2588 1 ! New state to change the finite state machine to.
; 2589 1 !
; 2590 1 ! IMPLICIT OUTPUTS:
; 2591 1 !
; 2592 1 ! None.
; 2593 1 !
; 2594 1 ! COMPLETION CODES:
; 2595 1 !
; 2596 1 ! None.
; 2597 1 !
; 2598 1 ! SIDE EFFECTS:
; 2599 1 !
; 2600 1 ! None.
; 2601 1 !
; 2602 1 !--
; 2603 1
; 2604 2 BEGIN
; 2605 2
; 2606 2 LOCAL
; 2607 2 M%TYPE, ! Message type to send
; 2608 2 STATUS; ! Status returned by various routines
; 2609 2
; 2610 2 !
; 2611 2 ! Flag we don't want to abort yet
; 2612 2 !
; 2613 2 ABT%CUR%FILE = FALSE;
; 2614 2 ABT%ALL%FILE = FALSE;
; 2615 2 !
; 2616 2 ! First determine if we have exceed the number of retries that are
; 2617 2 ! allowed to attempt to send this message.
; 2618 2 !
; 2619 2
; 2620 2 IF .NUM%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 2621 2
; 2622 2 !
; 2623 2 ! The number of retries are not exceeded. Increment the number and then
; 2624 2 ! attempt to send the packet again.
; 2625 2 !
; 2626 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 2627 2 SIZE = 0; ! Assume no name
; 2628 2
; 2629 2 IF .TEXT%HEAD%FLAG THEN M%TYPE = MSG%TEXT ELSE M%TYPE = MSG%FILE;
; 2630 2
; 2631 2 IF .FILE%SIZE NEQ 0 AND NOT .NO%FILE%NEEDED
; 2632 2 THEN
; 2633 3 BEGIN
; 2634 3 ![025] CH$MOVE (.FILE%SIZE, CH$PTR (FILE%NAME),
; 2635 3 ![025] CH$PTR (SND%MSG, PKT%MSG,
; 2636 3 ![025] CHR%SIZE));
; 2637 3 ![025]
; 2638 3 ![025] Fill packet with file name
; 2639 3 ![025]
; 2640 3 SET%STRING (CH$PTR (FILE%NAME), .FILE%SIZE, TRUE);
; 2641 3 BFR%FILL (TRUE);
; 2642 3 SET%STRING (0, 0, FALSE);
; 2643 2 END;
; 2644 2
; 2645 2 IF NOT SEND%PACKET (.M%TYPE, .SIZE, .MSG%NUMBER) THEN RETURN STATE%EX;
; 2646 2
; 2647 2 !
; 2648 2 ! Now get the responce from the remote KERMIT.
; 2649 2 !
; 2650 2 STATUS = REC%PACKET ();
; 2651 2
; 2652 2 IF NOT .STATUS
; 2653 2 THEN
; 2654 3 BEGIN
; 2655 3
; 2656 4 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR(.STATUS EQL KER%CHKSUMERR)
; 2657 3 THEN
; 2658 3 RETURN .STATE
; 2659 3 ELSE
; 2660 3 RETURN STATE%EX;
; 2661 3
; 2662 2 END;
; 2663 2
; 2664 2 !
; 2665 2 ! Determine if the packet is good.
; 2666 2 !
; 2667 2
; 2668 3 IF NOT (.REC%TYPE EQL MSG%ACK OR .REC%TYPE EQL MSG%NAK)
; 2669 2 THEN
; 2670 3 BEGIN
; 2671 3 KRM%ERROR (KER%PROTOERR);
; 2672 3 RETURN STATE%A;
; 2673 2 END;
; 2674 2
; 2675 2 !
; 2676 2 ! If this is a NAK and the message number is not the one we just send
; 2677 2 ! treat this like an ACK, otherwise resend the last packet.
; 2678 2 !
; 2679 2
; 2680 2 IF .REC%TYPE EQL MSG%NAK AND (.REC%SEQ NEQ ((.MSG%NUMBER + 1) AND %O'77')) THEN RETURN .STATE;
; 2681 2
; 2682 2 IF .REC%TYPE EQL MSG%ACK AND .REC%SEQ NEQ .MSG%NUMBER THEN RETURN .STATE;
; 2683 2
; 2684 2 !
; 2685 2 ! If all is ok, bump the message number and fill first buffer
; 2686 2 !
; 2687 2 NUM%RETRIES = 0;
; 2688 2 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 2689 2
; 2690 2 IF BFR%FILL (TRUE) THEN RETURN STATE%SD ELSE RETURN STATE%A;
; 2691 2
; 2692 1 END; ! End of SEND%FILE
; SEND%FILE
U.4: PUSH SP,AC16 ; 2566
SETZM ABT%CUR%FILE ; 2613
SETZM ABT%ALL%FILE ; 2614
MOVE AC1,U.54 ; 2620
CAMG AC1,PKT%RETRIES
JRST L.96
MOVEI AC1,24
JRST L.107
L.96: AOS U.54 ; 2626
SETZM U.52 ; 2627
MOVEI AC1,1 ; 2629
TDNN AC1,U.62
JRST L.97
MOVEI AC16,130
JRST L.98
L.97: MOVEI AC16,106
L.98: MOVE AC1,FILE%SIZE ; 2631
JUMPE AC1,L.99
MOVEI AC2,1
TDNE AC2,U.63
JRST L.99
PUSH SP,C.10 ; 2640
PUSH SP,AC1
PUSH SP,C.2
PUSHJ SP,U.30
PUSH SP,C.2 ; 2641
PUSHJ SP,U.29
SETZM -2(SP) ; 2642
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
ADJSP SP,-4 ; 2633
L.99: PUSH SP,AC16 ; 2645
PUSH SP,U.52
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.100
PUSHJ SP,U.26 ; 2650
TRNE AC1,1 ; 2652
JRST L.101
CAIE AC1,262 ; 2656
CAIN AC1,300
JRST L.104
CAIN AC1,172
JRST L.104 ; 2658
L.100: MOVEI AC1,23 ; 2660
JRST L.107 ; 2654
L.101: MOVE AC1,U.58 ; 2668
CAIE AC1,131
CAIN AC1,116
JRST L.102
PUSH SP,C.21 ; 2671
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 2672
JRST L.106
L.102: MOVE AC2,U.58 ; 2680
CAIE AC2,116
JRST L.103
MOVE AC1,U.55
ADDI AC1,1
LDB AC3,C.18
CAME AC3,U.56
JRST L.104
L.103: CAIE AC2,131 ; 2682
JRST L.105
MOVE AC1,U.56
CAMN AC1,U.55
JRST L.105
L.104: MOVE AC1,U.51
JRST L.107
L.105: SETZM U.54 ; 2687
MOVE AC1,U.55 ; 2688
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
PUSH SP,C.2 ; 2690
PUSHJ SP,U.29
ADJSP SP,-1
TRNN AC1,1
JRST L.106
MOVEI AC1,3
JRST L.107
L.106: MOVEI AC1,12
L.107: POP SP,AC16 ; 2566
POPJ SP,
; Routine Size: 87 words
; 2693 1 %SBTTL 'SEND%EOF'
; 2694 1 ROUTINE SEND%EOF =
; 2695 1
; 2696 1 !++
; 2697 1 ! FUNCTIONAL DESCRIPTION:
; 2698 1 !
; 2699 1 ! This routine will send the end of file message to the remote
; 2700 1 ! KERMIT. It will then determine if there are more files to
; 2701 1 ! send to the remote.
; 2702 1 !
; 2703 1 ! CALLING SEQUENCE:
; 2704 1 !
; 2705 1 ! STATE = SEND%EOF();
; 2706 1 !
; 2707 1 ! INPUT PARAMETERS:
; 2708 1 !
; 2709 1 ! None.
; 2710 1 !
; 2711 1 ! IMPLICIT INPUTS:
; 2712 1 !
; 2713 1 ! None.
; 2714 1 !
; 2715 1 ! OUTPUT PARAMETERS:
; 2716 1 !
; 2717 1 ! New state to change the finite state machine to.
; 2718 1 !
; 2719 1 ! IMPLICIT OUTPUTS:
; 2720 1 !
; 2721 1 ! None.
; 2722 1 !
; 2723 1 ! COMPLETION CODES:
; 2724 1 !
; 2725 1 ! None.
; 2726 1 !
; 2727 1 ! SIDE EFFECTS:
; 2728 1 !
; 2729 1 ! Sets up for the next file to be processed if there is one.
; 2730 1 !
; 2731 1 !--
; 2732 1
; 2733 2 BEGIN
; 2734 2
; 2735 2 LOCAL
; 2736 2 STATUS, ! Status returned by various routines
; 2737 2 EOF%MSG%LEN; ! Length of EOF message to send
; 2738 2
; 2739 2 !
; 2740 2 ! First determine if we have exceed the number of retries that are
; 2741 2 ! allowed to attempt to send this message.
; 2742 2 !
; 2743 2
; 2744 2 IF .NUM%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 2745 2
; 2746 2 !
; 2747 2 ! The number of retries are not exceeded. Increment the number and then
; 2748 2 ! attempt to send the packet again.
; 2749 2 !
; 2750 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 2751 2 !
; 2752 2 ! Store character in packet to indicate discard of file
; 2753 2 ! Character will only be sent if file should be discarded
; 2754 2 !
; 2755 2 CH$WCHAR (MSG%EOF%DISCARD, CH$PTR (SND%MSG, PKT%MSG, CHR%SIZE));
; 2756 2
; 2757 2 IF .ABT%CUR%FILE OR .ABT%ALL%FILE THEN EOF%MSG%LEN = 1 ELSE EOF%MSG%LEN = 0;
; 2758 2
; 2759 2 IF NOT SEND%PACKET (MSG%EOF, .EOF%MSG%LEN, .MSG%NUMBER) THEN RETURN STATE%EX;
; 2760 2
; 2761 2 !
; 2762 2 ! Now get the responce from the remote KERMIT.
; 2763 2 !
; 2764 2 STATUS = REC%PACKET ();
; 2765 2
; 2766 2 IF NOT .STATUS
; 2767 2 THEN
; 2768 3 BEGIN
; 2769 3
; 2770 4 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR(.STATUS EQL KER%CHKSUMERR)
; 2771 3 THEN
; 2772 3 RETURN .STATE
; 2773 3 ELSE
; 2774 3 RETURN STATE%EX;
; 2775 3
; 2776 2 END;
; 2777 2
; 2778 2 !
; 2779 2 ! Determine if the packet is good.
; 2780 2 !
; 2781 2
; 2782 3 IF NOT (.REC%TYPE EQL MSG%ACK OR .REC%TYPE EQL MSG%NAK)
; 2783 2 THEN
; 2784 3 BEGIN
; 2785 3 KRM%ERROR (KER%PROTOERR);
; 2786 3 RETURN STATE%A;
; 2787 2 END;
; 2788 2
; 2789 2 !
; 2790 2 ! If this is a NAK and the message number is not the one we just send
; 2791 2 ! treat this like an ACK, otherwise resend the last packet.
; 2792 2 !
; 2793 2
; 2794 2 IF .REC%TYPE EQL MSG%NAK AND (.REC%SEQ NEQ ((.MSG%NUMBER + 1) AND %O'77')) THEN RETURN .STATE;
; 2795 2
; 2796 2 IF .REC%TYPE EQL MSG%ACK AND .REC%SEQ NEQ .MSG%NUMBER THEN RETURN .STATE;
; 2797 2
; 2798 2 !
; 2799 2 ! Here to determine if there is another file to send.
; 2800 2 !
; 2801 2 NUM%RETRIES = 0;
; 2802 2 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 2803 2
; 2804 2 IF NOT .ABT%ALL%FILE THEN STATUS = NEXT%FILE () ELSE STATUS = KER%NOMORFILES;
; 2805 2
; 2806 3 IF ( NOT .STATUS) OR (.STATUS EQL KER%NOMORFILES)
; 2807 2 THEN
; 2808 3 BEGIN
; 2809 3
; 2810 3 IF (.STATUS NEQ KER%NOMORFILES) THEN RETURN STATE%A ELSE RETURN STATE%SB;
; 2811 3
; 2812 3 END
; 2813 2 ELSE
; 2814 3 BEGIN
; 2815 3 FLAG%FILE%OPEN = TRUE; ! Have a file open again
; 2816 3
; 2817 3 IF .FIL%NORMAL%FORM THEN NORMALIZE%FILE (FILE%NAME, FILE%SIZE, -1, -1);
; 2818 3
; 2819 3 XFR%STATUS (%C'F', %C'S'); ! Inform display routine
; 2820 3
; 2821 3 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 2822 3 THEN
; 2823 4 BEGIN
; 2824 4 !![045] TT%TEXT (UPLIT (%ASCIZ'Sending: '));
; 2825 4 TT%TEXT (FILE%NAME);
; 2826 4 TT%OUTPUT ();
; 2827 3 END;
; 2828 3
; 2829 3 FILE%CHARS = 0; ! No characters sent yet
; 2830 3 RETURN STATE%SF;
; 2831 2 END;
; 2832 2
; 2833 1 END; ! End of SEND%EOF
; SEND%EOF
U.7: PUSH SP,AC16 ; 2694
MOVE AC1,U.54 ; 2744
CAMG AC1,PKT%RETRIES
JRST L.108
MOVEI AC1,24
JRST L.125
L.108: AOS U.54 ; 2750
MOVEI AC2,104 ; 2755
MOVE AC1,C.32
IDPB AC2,AC1
MOVEI AC1,1 ; 2757
TDNE AC1,ABT%CUR%FILE
JRST L.109
MOVEI AC1,1
TDNN AC1,ABT%ALL%FILE
JRST L.110
L.109: MOVEI AC1,1
JRST L.111
L.110: SETZ AC1,
L.111: PUSH SP,C.33 ; 2759
PUSH SP,AC1
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.112
PUSHJ SP,U.26 ; 2764
MOVE AC16,AC1
TRNE AC16,1 ; 2766
JRST L.113
CAIE AC16,262 ; 2770
CAIN AC16,300
JRST L.116
CAIN AC16,172
JRST L.116 ; 2772
L.112: MOVEI AC1,23 ; 2774
JRST L.125 ; 2768
L.113: MOVE AC1,U.58 ; 2782
CAIE AC1,131
CAIN AC1,116
JRST L.114
PUSH SP,C.21 ; 2785
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 2786
JRST L.120
L.114: MOVE AC2,U.58 ; 2794
CAIE AC2,116
JRST L.115
MOVE AC1,U.55
ADDI AC1,1
LDB AC3,C.18
CAME AC3,U.56
JRST L.116
L.115: CAIE AC2,131 ; 2796
JRST L.117
MOVE AC1,U.56
CAMN AC1,U.55
JRST L.117
L.116: MOVE AC1,U.51
JRST L.125
L.117: SETZM U.54 ; 2801
MOVE AC1,U.55 ; 2802
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
MOVEI AC1,1 ; 2804
TDNE AC1,ABT%ALL%FILE
JRST L.118
PUSHJ SP,NEXT%FILE
SKIPA AC16,AC1
L.118: MOVEI AC16,133
TRNN AC16,1 ; 2806
JRST L.119
CAIE AC16,133
JRST L.122
L.119: CAIN AC16,133 ; 2810
JRST L.121
L.120: MOVEI AC1,12
JRST L.125
L.121: MOVEI AC1,5
JRST L.125 ; 2814
L.122: MOVEI AC1,1 ; 2815
MOVEM AC1,FLAG%FILE%OPEN
MOVEI AC1,1 ; 2817
TDNN AC1,FIL%NORMAL%FORM
JRST L.123
PUSH SP,C.34
PUSH SP,C.35
PUSH SP,C.36
PUSH SP,C.36
PUSHJ SP,U.27
ADJSP SP,-4
L.123: PUSH SP,C.15 ; 2819
PUSH SP,C.8
PUSHJ SP,XFR%STATUS
MOVEI AC1,1 ; 2821
TDNE AC1,CONNECT%FLAG
JRST L.124
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.124
PUSH SP,C.34 ; 2825
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%OUTPUT ; 2826
ADJSP SP,-1 ; 2823
L.124: SETZM U.61 ; 2829
ADJSP SP,-2 ; 2814
MOVEI AC1,2
L.125: POP SP,AC16 ; 2694
POPJ SP,
C.32: POINT 8,U.60,31
C.33: EXP 132
C.34: XWD 0,FILE%NAME
C.35: XWD 0,FILE%SIZE
C.36: EXP -1
; Routine Size: 115 words
; 2834 1 %SBTTL 'SEND%INIT'
; 2835 1 ROUTINE SEND%INIT =
; 2836 1
; 2837 1 !++
; 2838 1 ! FUNCTIONAL DESCRIPTION:
; 2839 1 !
; 2840 1 ! This routine will send the initialization packet to the remote
; 2841 1 ! KERMIT. The message type sent is S.
; 2842 1 !
; 2843 1 ! CALLING SEQUENCE:
; 2844 1 !
; 2845 1 ! STATE = SEND%INIT();
; 2846 1 !
; 2847 1 ! INPUT PARAMETERS:
; 2848 1 !
; 2849 1 ! None.
; 2850 1 !
; 2851 1 ! IMPLICIT INPUTS:
; 2852 1 !
; 2853 1 ! None.
; 2854 1 !
; 2855 1 ! OUTPUT PARAMETERS:
; 2856 1 !
; 2857 1 ! New state to change the finite state machine to.
; 2858 1 !
; 2859 1 ! IMPLICIT OUTPUTS:
; 2860 1 !
; 2861 1 ! None.
; 2862 1 !
; 2863 1 ! COMPLETION CODES:
; 2864 1 !
; 2865 1 ! None.
; 2866 1 !
; 2867 1 ! SIDE EFFECTS:
; 2868 1 !
; 2869 1 ! None.
; 2870 1 !
; 2871 1 !--
; 2872 1
; 2873 2 BEGIN
; 2874 2
; 2875 2 LOCAL
; 2876 2 STATUS; ! Status returned by various routines
; 2877 2
; 2878 2 SET%SEND%INIT ();
; 2879 2
; 2880 2 IF .NUM%RETRIES GTR .SI%RETRIES THEN RETURN STATE%ER;
; 2881 2
; 2882 2 !
; 2883 2 ! Count the number of times we try this
; 2884 2 !
; 2885 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 2886 2
; 2887 2 IF NOT SEND%PACKET (MSG%SND%INIT, .SEND%INIT%SIZE, .MSG%NUMBER) THEN RETURN STATE%EX; ! [108]
; 2888 2
; 2889 2 !
; 2890 2 ! Determine if we received a packet it good condition. If we timed out or
; 2891 2 ! got an illegal message, just try again.
; 2892 2 !
; 2893 2 STATUS = REC%PACKET ();
; 2894 2
; 2895 2 IF NOT .STATUS
; 2896 2 THEN
; 2897 3 BEGIN
; 2898 3
; 2899 4 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR(.STATUS EQL KER%CHKSUMERR)
; 2900 3 THEN
; 2901 3 RETURN .STATE
; 2902 3 ELSE
; 2903 3 RETURN STATE%EX;
; 2904 3
; 2905 2 END;
; 2906 2
; 2907 2 !
; 2908 2 ! Determine if the packet is good.
; 2909 2 !
; 2910 2
; 2911 2 IF .REC%TYPE NEQ MSG%ACK THEN RETURN .STATE;
; 2912 2
; 2913 2 IF .REC%SEQ NEQ .MSG%NUMBER THEN RETURN .STATE;
; 2914 2
; 2915 2 !
; 2916 2 ! Here if we have an ACK for the initialization message that was just sent
; 2917 2 ! to the remote KERMIT.
; 2918 2 !
; 2919 2
; 2920 2 IF NOT (STATUS = PRS%SEND%INIT ()) THEN RETURN STATE%A;
; 2921 2
; 2922 2 BLK%CHK%TYPE = .INI%CHK%TYPE; ! We now use agreed upon block check type
; 2923 2 NUM%RETRIES = 0;
; 2924 2 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 2925 2 RETURN STATE%OF; ! Now need to open the file
; 2926 1 END;
; SEND%INIT
U.8: PUSHJ SP,U.20 ; 2878
MOVE AC1,U.54 ; 2880
CAMG AC1,SI%RETRIES
JRST L.126
MOVEI AC1,24
POPJ SP,
L.126: AOS U.54 ; 2885
PUSH SP,C.8 ; 2887
PUSH SP,U.46
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNE AC1,1
JRST L.127
MOVEI AC1,23
POPJ SP,
L.127: PUSHJ SP,U.26 ; 2893
TRNE AC1,1 ; 2895
JRST L.129
CAIE AC1,262 ; 2899
CAIN AC1,300
JRST L.128
CAIN AC1,172
L.128: SKIPA AC2,U.51 ; 2903
MOVEI AC2,23
MOVE AC1,AC2 ; 2897
POPJ SP,
L.129: MOVEI AC2,131 ; 2911
CAME AC2,U.58
JRST L.130
MOVE AC2,U.56 ; 2913
CAMN AC2,U.55
JRST L.131
L.130: MOVE AC1,U.51
POPJ SP,
L.131: PUSHJ SP,U.21 ; 2920
TRNE AC1,1
JRST L.132
MOVEI AC1,12
POPJ SP,
L.132: MOVE AC1,U.47 ; 2922
MOVEM AC1,U.48
SETZM U.54 ; 2923
MOVE AC1,U.55 ; 2924
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
MOVEI AC1,22 ; 2873
POPJ SP, ; 2835
; Routine Size: 49 words
; 2927 1 %SBTTL 'SEND%OPEN%FILE - Open file for sending'
; 2928 1 ROUTINE SEND%OPEN%FILE =
; 2929 1
; 2930 1 !++
; 2931 1 ! FUNCTIONAL DESCRIPTION:
; 2932 1 !
; 2933 1 ! This routine is called from DO%TRANSACTION when the first input file
; 2934 1 ! needs to be opened.
; 2935 1 !
; 2936 1 ! CALLING SEQUENCE:
; 2937 1 !
; 2938 1 ! STATE = SEND%OPEN%FILE ();
; 2939 1 !
; 2940 1 ! INPUT PARAMETERS:
; 2941 1 !
; 2942 1 ! None.
; 2943 1 !
; 2944 1 ! IMPLICIT INPUTS:
; 2945 1 !
; 2946 1 ! FILE%NAME, FILE%SIZE, etc.
; 2947 1 !
; 2948 1 ! OUPTUT PARAMETERS:
; 2949 1 !
; 2950 1 ! New state for FSM.
; 2951 1 !
; 2952 1 ! IMPLICIT OUTPUTS:
; 2953 1 !
; 2954 1 ! None.
; 2955 1 !
; 2956 1 ! COMPLETION CODES:
; 2957 1 !
; 2958 1 ! None.
; 2959 1 !
; 2960 1 ! SIDE EFFECTS:
; 2961 1 !
; 2962 1 ! None.
; 2963 1 !
; 2964 1 !--
; 2965 1
; 2966 2 BEGIN
; 2967 2
; 2968 2 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 2969 2 THEN
; 2970 3 BEGIN
; 2971 3 TT%TEXT (UPLIT (%ASCIZ'Sending: '));
; 2972 3 TT%OUTPUT ();
; 2973 2 END;
; 2974 2
; 2975 2 FILE%CHARS = 0; ! No characters sent yet
; 2976 2
; 2977 2 IF NOT .NO%FILE%NEEDED
; 2978 2 THEN
; 2979 2
; 2980 2 IF NOT FILE%OPEN (FNC%READ) THEN RETURN STATE%A ELSE FLAG%FILE%OPEN = TRUE;
; 2981 2
; 2982 2 ![023]
; 2983 2 ![023] If we want normalized file names, beat up the name now
; 2984 2 ![023]
; 2985 2
; 2986 2 IF .FIL%NORMAL%FORM THEN NORMALIZE%FILE (FILE%NAME, FILE%SIZE, -1, -1);
; 2987 2
; 2988 2 XFR%STATUS (%C'F', %C'S'); ! Inform display routine
; 2989 2
; 2990 2 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 2991 2 THEN
; 2992 3 BEGIN
; 2993 3 TT%TEXT (FILE%NAME);
; 2994 3 TT%OUTPUT ();
; 2995 2 END;
; 2996 2
; 2997 2 RETURN STATE%SF;
; 2998 1 END; ! End of FSM%OPEN%FILE
P.AAE: BYTE (7)"S","e","n","d","i"
BYTE (7)"n","g",":"," ",000
; SEND%OPEN%FILE
U.5: MOVEI AC1,1 ; 2968
TDNE AC1,CONNECT%FLAG
JRST L.133
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.133
PUSH SP,C.37 ; 2971
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%OUTPUT ; 2972
ADJSP SP,-1 ; 2970
L.133: SETZM U.61 ; 2975
MOVEI AC1,1 ; 2977
TDNE AC1,U.63
JRST L.135
PUSH SP,C.25 ; 2980
PUSHJ SP,FILE%OPEN
ADJSP SP,-1
TRNE AC1,1
JRST L.134
MOVEI AC1,12
POPJ SP,
L.134: MOVEI AC1,1
MOVEM AC1,FLAG%FILE%OPEN
L.135: MOVEI AC1,1 ; 2986
TDNN AC1,FIL%NORMAL%FORM
JRST L.136
PUSH SP,C.34
PUSH SP,C.35
PUSH SP,C.36
PUSH SP,C.36
PUSHJ SP,U.27
ADJSP SP,-4
L.136: PUSH SP,C.15 ; 2988
PUSH SP,C.8
PUSHJ SP,XFR%STATUS
MOVEI AC1,1 ; 2990
TDNE AC1,CONNECT%FLAG
JRST L.137
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.137
PUSH SP,C.34 ; 2993
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%OUTPUT ; 2994
ADJSP SP,-1 ; 2992
L.137: ADJSP SP,-2 ; 2997
MOVEI AC1,2 ; 2966
POPJ SP, ; 2928
C.37: XWD 0,P.AAE
; Routine Size: 49 words
; 2999 1 %SBTTL 'SEND%GENCMD'
; 3000 1 ROUTINE SEND%GENCMD =
; 3001 1
; 3002 1 !++
; 3003 1 ! FUNCTIONAL DESCRIPTION:
; 3004 1 !
; 3005 1 ! This routine will send a command packet to the server Kermit.
; 3006 1 ! The new state will depend upon the response. If a send-init
; 3007 1 ! is received, it will process it and switch to STATE%RF.
; 3008 1 ! If a text-header is received it will switch to STATE%RD.
; 3009 1 ! If an ACK is received, it will type the data portion and
; 3010 1 ! switch to STATE%C.
; 3011 1 !
; 3012 1 ! CALLING SEQUENCE:
; 3013 1 !
; 3014 1 ! STATE = SEND%GENCMD();
; 3015 1 !
; 3016 1 ! INPUT PARAMETERS:
; 3017 1 !
; 3018 1 ! None.
; 3019 1 !
; 3020 1 ! IMPLICIT INPUTS:
; 3021 1 !
; 3022 1 ! GEN%TYPE - Message type to send (normally MSG%GENERIC)
; 3023 1 ! GEN%SUBTYPE - Message subtype (only if MSG%GENERIC)
; 3024 1 ! GEN%1DATA - First argument string
; 3025 1 ! GEN%1SIZE - Size of first argument
; 3026 1 ! GEN%2DATA - Second argument string
; 3027 1 ! GEN%2SIZE - Size of second argument
; 3028 1 ! GEN%3DATA - Third argument string
; 3029 1 ! GEN%3SIZE - Size of third argument
; 3030 1 !
; 3031 1 ! OUTPUT PARAMETERS:
; 3032 1 !
; 3033 1 ! New state for the finite state machine.
; 3034 1 !
; 3035 1 ! IMPLICIT OUTPUTS:
; 3036 1 !
; 3037 1 ! None.
; 3038 1 !
; 3039 1 ! COMPLETION CODES:
; 3040 1 !
; 3041 1 ! None.
; 3042 1 !
; 3043 1 ! SIDE EFFECTS:
; 3044 1 !
; 3045 1 ! None.
; 3046 1 !
; 3047 1 !--
; 3048 1
; 3049 2 BEGIN
; 3050 2
; 3051 2 LOCAL
; 3052 2 POINTER, ! Pointer at DATA%TEXT
; 3053 2 DATA%TEXT : VECTOR [CH$ALLOCATION (MAX%MSG)], ! Data buffer
; 3054 2 DATA%SIZE, ! Length of data buffer used
; 3055 2 STATUS; ! Status returned by various routines
; 3056 2
; 3057 2 ROUTINE PACK%DATA (POINTER, LENGTH, SRC%ADDR, SRC%LEN) =
; 3058 2 !
; 3059 2 ! Routine to pack an argument into the buffer.
; 3060 2 !
; 3061 3 BEGIN
; 3062 3
; 3063 3 IF .SRC%LEN GTR MAX%MSG - .LENGTH - 1 THEN SRC%LEN = MAX%MSG - .LENGTH - 1;
; 3064 3
; 3065 3 LENGTH = .LENGTH + .SRC%LEN + 1;
; 3066 3 CH$WCHAR%A (CHAR (.SRC%LEN), .POINTER);
; 3067 3 .POINTER = CH$MOVE (.SRC%LEN, CH$PTR (.SRC%ADDR), ..POINTER);
; 3068 3 RETURN .LENGTH;
; 3069 2 END;
; PACK%DATA
U.77: MOVE AC1,-3(SP) ; 3063
SUBI AC1,1751
MOVN AC2,AC1
CAMGE AC2,-1(SP)
MOVNM AC1,-1(SP)
MOVE AC1,-3(SP) ; 3065
ADD AC1,-1(SP)
ADDI AC1,1
MOVEM AC1,-3(SP)
MOVE AC2,-1(SP) ; 3066
ADDI AC2,40
MOVE AC1,-4(SP)
IDPB AC2,0(AC1)
MOVE AC3,-4(SP) ; 3067
MOVE AC1,-2(SP)
MOVEI AC2,-1(AC1)
HRLI AC2,10700
MOVE AC1,-1(SP)
MOVE AC4,-1(SP)
MOVE AC5,0(AC3)
EXTEND AC1,C.9
JFCL
MOVEM AC5,0(AC3)
MOVE AC1,-3(SP) ; 3061
POPJ SP, ; 3057
; Routine Size: 25 words
; 3070 2 !
; 3071 2 ! First determine if we have exceed the number of retries that are
; 3072 2 ! allowed to attempt to send this message.
; 3073 2 !
; 3074 2
; 3075 2 IF .NUM%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 3076 2
; 3077 2 !
; 3078 2 ! The number of retries are not exceeded. Increment the number and then
; 3079 2 ! attempt to send the packet again.
; 3080 2 !
; 3081 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 3082 2 !
; 3083 2 ! Build the packet data field
; 3084 2 !
; 3085 2 POINTER = CH$PTR (DATA%TEXT);
; 3086 2 DATA%SIZE = 0;
; 3087 2
; 3088 2 IF .GEN%TYPE EQL MSG%GENERIC
; 3089 2 THEN
; 3090 3 BEGIN
; 3091 3 CH$WCHAR%A (.GEN%SUBTYPE, POINTER);
; 3092 3 DATA%SIZE = 1;
; 3093 3
; 3094 3 IF .GEN%1SIZE GTR 0 OR .GEN%2SIZE GTR 0 OR .GEN%3SIZE GTR 0
; 3095 3 THEN
; 3096 4 BEGIN
; 3097 4 DATA%SIZE = PACK%DATA (POINTER, .DATA%SIZE, GEN%1DATA, .GEN%1SIZE);
; 3098 4
; 3099 4 IF .GEN%2SIZE GTR 0 OR .GEN%3SIZE GTR 0
; 3100 4 THEN
; 3101 5 BEGIN
; 3102 5 DATA%SIZE = PACK%DATA (POINTER, .DATA%SIZE, GEN%2DATA, .GEN%2SIZE);
; 3103 5
; 3104 5 IF .GEN%3SIZE GTR 0
; 3105 5 THEN
; 3106 6 BEGIN
; 3107 6 DATA%SIZE = PACK%DATA (POINTER, .DATA%SIZE, GEN%3DATA, .GEN%3SIZE);
; 3108 5 END;
; 3109 5
; 3110 4 END;
; 3111 4
; 3112 3 END;
; 3113 3
; 3114 3 END
; 3115 2 ELSE
; 3116 3 BEGIN
; 3117 3
; 3118 3 IF .GEN%1SIZE GTR MAX%MSG THEN GEN%1SIZE = MAX%MSG;
; 3119 3
; 3120 3 DATA%SIZE = .GEN%1SIZE;
; 3121 3 CH$MOVE (.GEN%1SIZE, CH$PTR (GEN%1DATA), .POINTER);
; 3122 2 END;
; 3123 2
; 3124 2 SET%STRING (CH$PTR (DATA%TEXT), .DATA%SIZE, TRUE);
; 3125 2 BFR%FILL (TRUE);
; 3126 2 SET%STRING (0, 0, FALSE);
; 3127 2 !
; 3128 2 ! Send the packet
; 3129 2 !
; 3130 2
; 3131 2 IF NOT SEND%PACKET (.GEN%TYPE, .SIZE, .MSG%NUMBER) THEN RETURN STATE%EX;
; 3132 2
; 3133 2 !
; 3134 2 ! Now get the responce from the remote KERMIT.
; 3135 2 !
; 3136 2 STATUS = REC%PACKET ();
; 3137 2
; 3138 2 IF NOT .STATUS
; 3139 2 THEN
; 3140 3 BEGIN
; 3141 3
; 3142 4 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR(.STATUS EQL KER%CHKSUMERR)
; 3143 3 THEN
; 3144 3 RETURN .STATE
; 3145 3 ELSE
; 3146 3 RETURN STATE%EX;
; 3147 3
; 3148 2 END;
; 3149 2
; 3150 2 ! Did we get a send-init?
; 3151 2
; 3152 2 SELECTONE .REC%TYPE OF
; 3153 2 SET
; 3154 2
; 3155 2 [MSG%SND%INIT] :
; 3156 3 BEGIN
; 3157 3 MSG%NUMBER = .REC%SEQ; ! Initialize sequence numbers
; 3158 3 ! Determine if the parameters are ok. If not, give up
; 3159 3
; 3160 3 IF NOT (STATUS = PRS%SEND%INIT ()) THEN RETURN .STATUS;
; 3161 3
; 3162 3 SET%SEND%INIT (); ! Set up our acknowledgement to the send-init
; 3163 3 SEND%PACKET (MSG%ACK, .SEND%INIT%SIZE, .MSG%NUMBER); ! [108] ! Send it
; 3164 3 BLK%CHK%TYPE = .INI%CHK%TYPE; ! Can now use agreed upon type
; 3165 3 OLD%RETRIES = .NUM%RETRIES;
; 3166 3 NUM%RETRIES = 0;
; 3167 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3168 3 RETURN STATE%RF; ! Now expect file header
; 3169 2 END;
; 3170 2
; 3171 2 [MSG%TEXT] :
; 3172 2 !
; 3173 2 ! If we just got a text header, set up for typing on the terminal and
; 3174 2 ! shift to receiving data
; 3175 2 !
; 3176 3 BEGIN
; 3177 3 TEXT%HEAD%FLAG = TRUE; ! We want terminal output
; 3178 3 PUT%CHR%ROUTINE = TYPE%CHAR; ! Set up the put a character routine
; 3179 3
; 3180 3 IF .REC%LENGTH GTR 0
; 3181 3 THEN
; 3182 4 BEGIN
; 3183 4 TT%TEXT (UPLIT (%ASCIZ'<<')); ! Make sure file name sticks out
; 3184 4 BFR%EMPTY (); ! Dump the packet data to the terminal
; 3185 4 TT%TEXT (UPLIT (%ASCIZ'>>')); ! So user can tell where name ends
; 3186 4 TT%CRLF (); ! And a CRLF
; 3187 3 END;
; 3188 3
; 3189 3 SEND%PACKET (MSG%ACK, 0, .MSG%NUMBER); ! Send an ACK
; 3190 3 OLD%RETRIES = .NUM%RETRIES;
; 3191 3 NUM%RETRIES = 0;
; 3192 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3193 3 RETURN STATE%RD; ! We now want data
; 3194 2 END;
; 3195 2
; 3196 2 [MSG%ACK] :
; 3197 2 !
; 3198 2 ! If we get an ACK, just type the data on the terminal and complete the
; 3199 2 ! transaction.
; 3200 2 !
; 3201 3 BEGIN
; 3202 3 PUT%CHR%ROUTINE = TYPE%CHAR; ! Dump to terminal
; 3203 3 BFR%EMPTY (); ! Do it
; 3204 3
; 3205 3 IF .REC%LENGTH GTR 0 THEN TT%CRLF ();
; 3206 3
; 3207 3 RETURN STATE%C; ! And go idle
; 3208 2 END;
; 3209 2
; 3210 2 [MSG%NAK] :
; 3211 2 !
; 3212 2 ! If we get a NAK, stay in the same state. We will re-transmit the
; 3213 2 ! packet again.
; 3214 2 !
; 3215 2 RETURN .STATE;
; 3216 2 TES;
; 3217 2
; 3218 2 !
; 3219 2 ! If we get here, we didn't get anything resembling an acceptable
; 3220 2 ! packet, so we will abort.
; 3221 2 !
; 3222 2 KRM%ERROR (KER%PROTOERR);
; 3223 2 RETURN STATE%A;
; 3224 1 END;
P.AAF: BYTE (7)"<","<",000,000,000
P.AAG: BYTE (7)">",">",000,000,000
; SEND%GENCMD
U.6: ADJSP SP,312 ; 3000
MOVE AC1,U.54 ; 3075
CAMG AC1,PKT%RETRIES
JRST L.138
MOVEI AC1,24
JRST L.155
L.138: AOS U.54 ; 3081
MOVEI AC1,-312(SP) ; 3085
HRLI AC1,10700
MOVEM AC1,0(SP)
SETZ AC3, ; 3086
MOVEI AC1,107 ; 3088
CAME AC1,U.65
JRST L.143
MOVE AC1,U.66 ; 3091
IDPB AC1,0(SP)
MOVEI AC3,1 ; 3092
MOVE AC1,GEN%1SIZE ; 3094
JUMPG AC1,L.139
SKIPLE GEN%2SIZE
JRST L.139
SKIPG GEN%3SIZE
JRST L.145
L.139: MOVEI AC2,0(SP) ; 3097
PUSH SP,AC2
PUSH SP,AC3
PUSH SP,C.38
PUSH SP,AC1
PUSHJ SP,U.77
MOVE AC3,AC1
MOVE AC1,GEN%2SIZE ; 3099
JUMPG AC1,L.140
SKIPG GEN%3SIZE
JRST L.142
L.140: MOVEI AC2,-4(SP) ; 3102
PUSH SP,AC2
PUSH SP,AC3
PUSH SP,C.39
PUSH SP,AC1
PUSHJ SP,U.77
MOVE AC3,AC1
MOVE AC1,GEN%3SIZE ; 3104
JUMPLE AC1,L.141
MOVEI AC2,-10(SP) ; 3107
PUSH SP,AC2
PUSH SP,AC3
PUSH SP,C.40
PUSH SP,AC1
PUSHJ SP,U.77
MOVE AC3,AC1
ADJSP SP,-4 ; 3106
L.141: ADJSP SP,-4 ; 3101
L.142: ADJSP SP,-4 ; 3096
JRST L.145 ; 3094
L.143: MOVEI AC1,1752 ; 3118
CAML AC1,GEN%1SIZE
JRST L.144
MOVEI AC1,1752
MOVEM AC1,GEN%1SIZE
L.144: MOVE AC3,GEN%1SIZE ; 3120
MOVE AC1,GEN%1SIZE ; 3121
MOVE AC2,C.11
MOVE AC4,GEN%1SIZE
MOVE AC5,0(SP)
EXTEND AC1,C.9
JFCL
L.145: MOVEI AC1,-312(SP) ; 3124
HRLI AC1,10700
PUSH SP,AC1
PUSH SP,AC3
PUSH SP,C.2
PUSHJ SP,U.30
PUSH SP,C.2 ; 3125
PUSHJ SP,U.29
SETZM -2(SP) ; 3126
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
PUSH SP,U.65 ; 3131
PUSH SP,U.52
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNE AC1,1
JRST L.146
ADJSP SP,-4
MOVEI AC1,23
JRST L.155
L.146: PUSHJ SP,U.26 ; 3136
TRNE AC1,1 ; 3138
JRST L.148
CAIE AC1,262 ; 3142
CAIN AC1,300
JRST L.147
CAIN AC1,172
L.147: SKIPA AC2,U.51 ; 3146
MOVEI AC2,23
ADJSP SP,-4 ; 3142
MOVE AC1,AC2 ; 3140
JRST L.155
L.148: MOVE AC2,U.58 ; 3152
CAIE AC2,123 ; 3155
JRST L.150
MOVE AC3,U.56 ; 3157
MOVEM AC3,U.55
PUSHJ SP,U.21 ; 3160
TRNE AC1,1
JRST L.149
ADJSP SP,-4
JRST L.155
L.149: PUSHJ SP,U.20 ; 3162
PUSH SP,C.20 ; 3163
PUSH SP,U.46
PUSH SP,U.55
PUSHJ SP,U.24
MOVE AC1,U.47 ; 3164
MOVEM AC1,U.48
MOVE AC1,U.54 ; 3165
MOVEM AC1,U.53
SETZM U.54 ; 3166
MOVE AC1,U.55 ; 3167
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-7 ; 3168
MOVEI AC1,7 ; 3156
JRST L.155
L.150: CAIE AC2,130 ; 3171
JRST L.152
MOVEI AC1,1 ; 3177
MOVEM AC1,U.62
MOVEI AC1,U.31 ; 3178
MOVEM AC1,U.68
SKIPG U.57 ; 3180
JRST L.151
PUSH SP,C.41 ; 3183
PUSHJ SP,TT%TEXT
PUSHJ SP,U.28 ; 3184
PUSH SP,C.42 ; 3185
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 3186
ADJSP SP,-2 ; 3182
L.151: PUSH SP,C.20 ; 3189
PUSH SP,C.25
PUSH SP,U.55
PUSHJ SP,U.24
MOVE AC1,U.54 ; 3190
MOVEM AC1,U.53
SETZM U.54 ; 3191
MOVE AC1,U.55 ; 3192
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-7 ; 3193
MOVEI AC1,10 ; 3176
JRST L.155
L.152: CAIE AC2,131 ; 3196
JRST L.153
MOVEI AC1,U.31 ; 3202
MOVEM AC1,U.68
PUSHJ SP,U.28 ; 3203
SKIPLE U.57 ; 3205
PUSHJ SP,TT%CRLF
ADJSP SP,-4 ; 3207
MOVEI AC1,11 ; 3201
JRST L.155
L.153: CAIE AC2,116 ; 3210
JRST L.154
ADJSP SP,-4 ; 3215
MOVE AC1,U.51
JRST L.155
L.154: PUSH SP,C.21 ; 3222
PUSHJ SP,KRM%ERROR
ADJSP SP,-5 ; 3223
MOVEI AC1,12 ; 3049
L.155: ADJSP SP,-312 ; 3000
POPJ SP,
C.38: XWD 0,GEN%1DATA
C.39: XWD 0,GEN%2DATA
C.40: XWD 0,GEN%3DATA
C.41: XWD 0,P.AAF
C.42: XWD 0,P.AAG
; Routine Size: 182 words
; 3225 1 %SBTTL 'SEND%BREAK'
; 3226 1 ROUTINE SEND%BREAK =
; 3227 1
; 3228 1 !++
; 3229 1 ! FUNCTIONAL DESCRIPTION:
; 3230 1 !
; 3231 1 ! This routine will send the break (end of transmission) message
; 3232 1 ! to the remote KERMIT. On an ACK the state becomes STATE%C.
; 3233 1 !
; 3234 1 ! CALLING SEQUENCE:
; 3235 1 !
; 3236 1 ! STATE = SEND%BREAK();
; 3237 1 !
; 3238 1 ! INPUT PARAMETERS:
; 3239 1 !
; 3240 1 ! None.
; 3241 1 !
; 3242 1 ! IMPLICIT INPUTS:
; 3243 1 !
; 3244 1 ! None.
; 3245 1 !
; 3246 1 ! OUTPUT PARAMETERS:
; 3247 1 !
; 3248 1 ! New state for the finite state machine.
; 3249 1 !
; 3250 1 ! IMPLICIT OUTPUTS:
; 3251 1 !
; 3252 1 ! None.
; 3253 1 !
; 3254 1 ! COMPLETION CODES:
; 3255 1 !
; 3256 1 ! None.
; 3257 1 !
; 3258 1 ! SIDE EFFECTS:
; 3259 1 !
; 3260 1 ! None.
; 3261 1 !
; 3262 1 !--
; 3263 1
; 3264 2 BEGIN
; 3265 2
; 3266 2 LOCAL
; 3267 2 STATUS; ! Status returned by various routines
; 3268 2
; 3269 2 !
; 3270 2 ! First determine if we have exceed the number of retries that are
; 3271 2 ! allowed to attempt to send this message.
; 3272 2 !
; 3273 2
; 3274 2 IF .NUM%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 3275 2
; 3276 2 !
; 3277 2 ! The number of retries are not exceeded. Increment the number and then
; 3278 2 ! attempt to send the packet again.
; 3279 2 !
; 3280 2 NUM%RETRIES = .NUM%RETRIES + 1;
; 3281 2
; 3282 2 IF NOT SEND%PACKET (MSG%BREAK, 0, .MSG%NUMBER) THEN RETURN STATE%EX;
; 3283 2
; 3284 2 !
; 3285 2 ! Now get the responce from the remote KERMIT.
; 3286 2 !
; 3287 2 STATUS = REC%PACKET ();
; 3288 2
; 3289 2 IF NOT .STATUS
; 3290 2 THEN
; 3291 3 BEGIN
; 3292 3
; 3293 4 IF (.STATUS EQL KER%ZEROLENMSG) OR (.STATUS EQL KER%TIMEOUT) OR(.STATUS EQL KER%CHKSUMERR)
; 3294 3 THEN
; 3295 3 RETURN .STATE
; 3296 3 ELSE
; 3297 3 RETURN STATE%EX;
; 3298 3
; 3299 2 END;
; 3300 2
; 3301 2 !
; 3302 2 ! Determine if the packet is good.
; 3303 2 !
; 3304 2
; 3305 3 IF NOT (.REC%TYPE EQL MSG%ACK OR .REC%TYPE EQL MSG%NAK)
; 3306 2 THEN
; 3307 3 BEGIN
; 3308 3 KRM%ERROR (KER%PROTOERR);
; 3309 3 RETURN STATE%A;
; 3310 2 END;
; 3311 2
; 3312 2 !
; 3313 2 ! If this is a NAK and the message number is not the one we just send
; 3314 2 ! treat this like an ACK, otherwise resend the last packet.
; 3315 2 !
; 3316 2
; 3317 2 IF .REC%TYPE EQL MSG%NAK AND .REC%SEQ NEQ 0 THEN RETURN .STATE;
; 3318 2
; 3319 2 IF .REC%TYPE EQL MSG%ACK AND .REC%SEQ NEQ .MSG%NUMBER THEN RETURN .STATE;
; 3320 2
; 3321 2 !
; 3322 2 ! Here to determine if there is another file to send.
; 3323 2 !
; 3324 2 NUM%RETRIES = 0;
; 3325 2 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3326 2 RETURN STATE%C;
; 3327 1 END;
; SEND%BREAK
U.9: MOVE AC1,U.54 ; 3274
CAMG AC1,PKT%RETRIES
JRST L.156
MOVEI AC1,24
POPJ SP,
L.156: AOS U.54 ; 3280
PUSH SP,C.43 ; 3282
PUSH SP,C.25
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.157
PUSHJ SP,U.26 ; 3287
TRNE AC1,1 ; 3289
JRST L.158
CAIE AC1,262 ; 3293
CAIN AC1,300
JRST L.161
CAIN AC1,172
JRST L.161 ; 3295
L.157: MOVEI AC1,23 ; 3297
POPJ SP, ; 3291
L.158: MOVE AC1,U.58 ; 3305
CAIE AC1,131
CAIN AC1,116
JRST L.159
PUSH SP,C.21 ; 3308
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 3309
MOVEI AC1,12 ; 3307
POPJ SP,
L.159: MOVE AC1,U.58 ; 3317
CAIN AC1,116
SKIPN U.56
JRST L.160
JRST L.161
L.160: CAIE AC1,131 ; 3319
JRST L.162
MOVE AC1,U.56
CAMN AC1,U.55
JRST L.162
L.161: MOVE AC1,U.51
POPJ SP,
L.162: SETZM U.54 ; 3324
MOVE AC1,U.55 ; 3325
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
MOVEI AC1,11 ; 3264
POPJ SP, ; 3226
C.43: EXP 102
; Routine Size: 52 words
; 3328 1 %SBTTL 'REC%INIT'
; 3329 1 ROUTINE REC%INIT =
; 3330 1
; 3331 1 !++
; 3332 1 ! FUNCTIONAL DESCRIPTION:
; 3333 1 !
; 3334 1 ! This routine will process an initialization message received from
; 3335 1 ! the remote KERMIT.
; 3336 1 !
; 3337 1 ! CALLING SEQUENCE:
; 3338 1 !
; 3339 1 ! STATE = REC%INIT();
; 3340 1 !
; 3341 1 ! INPUT PARAMETERS:
; 3342 1 !
; 3343 1 ! None.
; 3344 1 !
; 3345 1 ! IMPLICIT INPUTS:
; 3346 1 !
; 3347 1 ! None.
; 3348 1 !
; 3349 1 ! OUTPUT PARAMETERS:
; 3350 1 !
; 3351 1 ! New machine state.
; 3352 1 !
; 3353 1 ! IMPLICIT OUTPUTS:
; 3354 1 !
; 3355 1 ! None.
; 3356 1 !
; 3357 1 ! COMPLETION CODES:
; 3358 1 !
; 3359 1 ! None.
; 3360 1 !
; 3361 1 ! SIDE EFFECTS:
; 3362 1 !
; 3363 1 ! None.
; 3364 1 !
; 3365 1 !--
; 3366 1
; 3367 2 BEGIN
; 3368 2
; 3369 2 LOCAL
; 3370 2 STATUS; ! Status returned by various routines
; 3371 2
; 3372 2 ROUTINE CHECK%INIT =
; 3373 3 BEGIN
; 3374 3
; 3375 3 IF .REC%TYPE EQL MSG%SND%INIT THEN RETURN TRUE ELSE RETURN FALSE;
; 3376 3
; 3377 2 END;
; CHECK%INIT
U.78: MOVEI AC1,123 ; 3375
CAME AC1,U.58
JRST L.163
MOVEI AC1,1
POPJ SP,
L.163: SETZ AC1,
POPJ SP, ; 3372
; Routine Size: 7 words
; 3378 2
; 3379 3 IF NOT (STATUS = REC%MESSAGE (CHECK%INIT))
; 3380 2 THEN
; 3381 2
; 3382 2 IF .STATUS NEQ KER%ABORTED THEN RETURN STATE%A ELSE RETURN STATE%EX;
; 3383 2
; 3384 2 MSG%NUMBER = .REC%SEQ;
; 3385 2
; 3386 2 IF NOT (STATUS = PRS%SEND%INIT ()) THEN RETURN STATE%A;
; 3387 2
; 3388 2 SET%SEND%INIT ();
; 3389 2 SEND%PACKET (MSG%ACK, .SEND%INIT%SIZE, .MSG%NUMBER); ! [108]
; 3390 2 BLK%CHK%TYPE = .INI%CHK%TYPE; ! Can now use agreed upon type
; 3391 2 OLD%RETRIES = .NUM%RETRIES;
; 3392 2 NUM%RETRIES = 0;
; 3393 2 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3394 2 RETURN STATE%RF;
; 3395 1 END; ! End of REC%INIT
; REC%INIT
U.11: PUSH SP,C.44 ; 3379
PUSHJ SP,U.25
ADJSP SP,-1
TRNE AC1,1
JRST L.166
CAIN AC1,312 ; 3382
JRST L.164
MOVEI AC2,12
JRST L.165
L.164: MOVEI AC2,23
L.165: MOVE AC1,AC2
POPJ SP,
L.166: MOVE AC2,U.56 ; 3384
MOVEM AC2,U.55
PUSHJ SP,U.21 ; 3386
TRNE AC1,1
JRST L.167
MOVEI AC1,12
POPJ SP,
L.167: PUSHJ SP,U.20 ; 3388
PUSH SP,C.20 ; 3389
PUSH SP,U.46
PUSH SP,U.55
PUSHJ SP,U.24
MOVE AC1,U.47 ; 3390
MOVEM AC1,U.48
MOVE AC1,U.54 ; 3391
MOVEM AC1,U.53
SETZM U.54 ; 3392
MOVE AC1,U.55 ; 3393
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-3 ; 3394
MOVEI AC1,7 ; 3367
POPJ SP, ; 3329
C.44: XWD 0,U.78
; Routine Size: 37 words
; 3396 1 %SBTTL 'REC%FILE'
; 3397 1 ROUTINE REC%FILE =
; 3398 1
; 3399 1 !++
; 3400 1 ! FUNCTIONAL DESCRIPTION:
; 3401 1 !
; 3402 1 ! This routine expects to receive an MSG%FILE packet from the remote
; 3403 1 ! KERMIT. If the message is correct this routine will change the state
; 3404 1 ! to STATE%RD.
; 3405 1 !
; 3406 1 ! This routine also expects MSG%SND%INIT, MSG%EOF, or MSG%BREAK.
; 3407 1 !
; 3408 1 ! CALLING SEQUENCE:
; 3409 1 !
; 3410 1 ! STATE = REC%FILE();
; 3411 1 !
; 3412 1 ! INPUT PARAMETERS:
; 3413 1 !
; 3414 1 ! None.
; 3415 1 !
; 3416 1 ! IMPLICIT INPUTS:
; 3417 1 !
; 3418 1 ! None.
; 3419 1 !
; 3420 1 ! OUTPUT PARAMETERS:
; 3421 1 !
; 3422 1 ! New state.
; 3423 1 !
; 3424 1 ! IMPLICIT OUTPUTS:
; 3425 1 !
; 3426 1 ! None.
; 3427 1 !
; 3428 1 ! COMPLETION CODES:
; 3429 1 !
; 3430 1 ! None.
; 3431 1 !
; 3432 1 ! SIDE EFFECTS:
; 3433 1 !
; 3434 1 ! None.
; 3435 1 !
; 3436 1 !--
; 3437 1
; 3438 2 BEGIN
; 3439 2
; 3440 2 LOCAL
; 3441 2 STATUS;
; 3442 2
; 3443 2 ROUTINE CHECK%FILE =
; 3444 3 BEGIN
; 3445 3
; 3446 4 IF (.REC%TYPE EQL MSG%SND%INIT) OR (.REC%TYPE EQL MSG%EOF) OR(.REC%TYPE EQL MSG%FILE) OR (
; 3447 4 .REC%TYPE EQL MSG%BREAK) OR (.REC%TYPE EQL MSG%TEXT)
; 3448 3 THEN
; 3449 3 RETURN TRUE
; 3450 3 ELSE
; 3451 3 RETURN FALSE;
; 3452 3
; 3453 2 END;
; CHECK%FILE
U.79: MOVE AC1,U.58 ; 3446
CAIE AC1,123
CAIN AC1,132
JRST L.168
CAIE AC1,106
CAIN AC1,102
JRST L.168
CAIE AC1,130 ; 3447
JRST L.169
L.168: MOVEI AC1,1 ; 3451
POPJ SP,
L.169: SETZ AC1,
POPJ SP, ; 3443
; Routine Size: 13 words
; 3454 2 !
; 3455 2 ! Initialize the abort flags
; 3456 2 !
; 3457 2 ABT%CUR%FILE = FALSE;
; 3458 2 ABT%ALL%FILE = FALSE;
; 3459 2 !
; 3460 2 ! Get a message
; 3461 2 !
; 3462 2
; 3463 3 IF NOT (STATUS = REC%MESSAGE (CHECK%FILE))
; 3464 2 THEN
; 3465 2
; 3466 2 IF .STATUS NEQ KER%ABORTED THEN RETURN STATE%A ELSE RETURN STATE%EX;
; 3467 2
; 3468 2 SELECTONE .REC%TYPE OF
; 3469 2 SET
; 3470 2
; 3471 2 [MSG%SND%INIT] :
; 3472 3 BEGIN
; 3473 3
; 3474 3 IF .OLD%RETRIES GTR .SI%RETRIES THEN RETURN STATE%ER;
; 3475 3
; 3476 3 OLD%RETRIES = .OLD%RETRIES + 1;
; 3477 3
; 3478 3 IF ((.MSG%NUMBER - 1) AND %O'77') EQL .REC%SEQ
; 3479 3 THEN
; 3480 4 BEGIN
; 3481 4 SET%SEND%INIT ();
; 3482 4 BLK%CHK%TYPE = CHK%1CHAR; ! Must use 1 character CHKSUM
; 3483 4 SEND%PACKET (MSG%ACK, .SEND%INIT%SIZE, .REC%SEQ); ! [108]
; 3484 4 BLK%CHK%TYPE = .INI%CHK%TYPE; ! Back to agreed upon type
; 3485 4 NUM%RETRIES = 0;
; 3486 4 RETURN .STATE;
; 3487 4 END
; 3488 3 ELSE
; 3489 4 BEGIN
; 3490 4 KRM%ERROR (KER%PROTOERR);
; 3491 4 RETURN STATE%A;
; 3492 3 END;
; 3493 3
; 3494 2 END;
; 3495 2
; 3496 2 [MSG%EOF] :
; 3497 3 BEGIN
; 3498 3
; 3499 3 IF .OLD%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 3500 3
; 3501 3 OLD%RETRIES = .OLD%RETRIES + 1;
; 3502 3
; 3503 3 IF ((.MSG%NUMBER - 1) AND %O'77') EQL .REC%SEQ
; 3504 3 THEN
; 3505 4 BEGIN
; 3506 4 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3507 4 NUM%RETRIES = 0;
; 3508 4 RETURN .STATE;
; 3509 4 END
; 3510 3 ELSE
; 3511 4 BEGIN
; 3512 4 KRM%ERROR (KER%PROTOERR);
; 3513 4 RETURN STATE%A;
; 3514 3 END;
; 3515 3
; 3516 2 END;
; 3517 2
; 3518 2 [MSG%FILE] :
; 3519 3 BEGIN
; 3520 3
; 3521 3 IF .MSG%NUMBER NEQ .REC%SEQ THEN RETURN STATE%ER;
; 3522 3
; 3523 3 IF .REC%LENGTH EQL 0
; 3524 3 THEN
; 3525 4 BEGIN
; 3526 4 KRM%ERROR (KER%PROTOERR);
; 3527 4 RETURN STATE%A;
; 3528 3 END;
; 3529 3
; 3530 3 ![025]
; 3531 3 ![025] Get file name from packet with all quoting undone
; 3532 3 ![025]
; 3533 3 SET%STRING (CH$PTR (FILE%NAME), MAX%FILE%NAME, TRUE);
; 3534 3 BFR%EMPTY ();
; 3535 3 FILE%SIZE = SET%STRING (0, 0, FALSE);
; 3536 3 CH$WCHAR (CHR%NUL, CH$PTR (FILE%NAME, .FILE%SIZE));
; 3537 3 ![025] FILE%SIZE = .REC%LENGTH;
; 3538 3 ![025] CH$COPY (.REC%LENGTH, CH$PTR (REC%MSG, PKT%MSG, CHR%SIZE), CHR%NUL, MAX%FILE%NAME,
; 3539 3 ![025] CH$PTR (FILE%NAME));
; 3540 3
; 3541 3 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 3542 3 THEN
; 3543 4 BEGIN
; 3544 4 TT%TEXT (UPLIT (%ASCIZ'Receiving: '));
; 3545 4 TT%TEXT (FILE%NAME);
; 3546 4 TT%OUTPUT ();
; 3547 3 END;
; 3548 3
; 3549 3 ![023]
; 3550 3 ![023] Force file name into normal form if desired
; 3551 3 ![023]
; 3552 3
; 3553 3 IF .FIL%NORMAL%FORM THEN NORMALIZE%FILE (FILE%NAME, FILE%SIZE, 9, 3);
; 3554 3
; 3555 3 FILE%CHARS = 0; ! No characters received yet
; 3556 3
; 3557 3 IF NOT FILE%OPEN (FNC%WRITE) THEN RETURN STATE%A;
; 3558 3
; 3559 3 XFR%STATUS (%C'F', %C'R'); ! Tell display routine
; 3560 3 TEXT%HEAD%FLAG = FALSE; ! Got an F, not an X
; 3561 3 FLAG%FILE%OPEN = TRUE;
; 3562 3 SEND%PACKET (MSG%ACK, 0, .MSG%NUMBER);
; 3563 3 OLD%RETRIES = .NUM%RETRIES;
; 3564 3 NUM%RETRIES = 0;
; 3565 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3566 3 RETURN STATE%RD;
; 3567 2 END;
; 3568 2
; 3569 2 [MSG%TEXT] :
; 3570 2 !
; 3571 2 ! If we get a text header, we will want to type the data on
; 3572 2 ! the terminal. Set up the put a character routine correctly.
; 3573 2 !
; 3574 3 BEGIN
; 3575 3
; 3576 3 IF .MSG%NUMBER NEQ .REC%SEQ
; 3577 3 THEN
; 3578 4 BEGIN
; 3579 4 KRM%ERROR (KER%PROTOERR);
; 3580 4 RETURN STATE%A;
; 3581 3 END;
; 3582 3
; 3583 3 TEXT%HEAD%FLAG = TRUE; ! Got an X, not an F
; 3584 3 PUT%CHR%ROUTINE = TYPE%CHAR; ! Empty buffer on terminal
; 3585 3
; 3586 3 IF .REC%LENGTH GTR 0
; 3587 3 THEN
; 3588 4 BEGIN
; 3589 4 TT%TEXT (UPLIT (%ASCIZ'<<')); ! Make file name stick out
; 3590 4 BFR%EMPTY (); ! Do the header data
; 3591 4 TT%TEXT (UPLIT (%ASCIZ'>>'));
; 3592 4 TT%CRLF (); ! And a crlf
; 3593 3 END;
; 3594 3
; 3595 3 SEND%PACKET (MSG%ACK, 0, .MSG%NUMBER);
; 3596 3 OLD%RETRIES = .NUM%RETRIES;
; 3597 3 NUM%RETRIES = 0;
; 3598 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3599 3 RETURN STATE%RD;
; 3600 2 END;
; 3601 2
; 3602 2 [MSG%BREAK] :
; 3603 3 BEGIN
; 3604 3
; 3605 3 IF .MSG%NUMBER NEQ .REC%SEQ
; 3606 3 THEN
; 3607 4 BEGIN
; 3608 4 KRM%ERROR (KER%PROTOERR);
; 3609 4 RETURN STATE%A;
; 3610 3 END;
; 3611 3
; 3612 3 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3613 3 RETURN STATE%C;
; 3614 2 END;
; 3615 2
; 3616 2 [OTHERWISE] :
; 3617 3 BEGIN
; 3618 3 KRM%ERROR (KER%PROTOERR);
; 3619 3 RETURN STATE%A;
; 3620 2 END;
; 3621 2 TES;
; 3622 2
; 3623 1 END; ! End of REC%FILE
P.AAH: BYTE (7)"R","e","c","e","i"
BYTE (7)"v","i","n","g",":"
BYTE (7)" ",000,000,000,000
P.AAI: BYTE (7)"<","<",000,000,000
P.AAJ: BYTE (7)">",">",000,000,000
; REC%FILE
U.12: SETZM ABT%CUR%FILE ; 3457
SETZM ABT%ALL%FILE ; 3458
PUSH SP,C.45 ; 3463
PUSHJ SP,U.25
ADJSP SP,-1
TRNE AC1,1
JRST L.170
CAIE AC1,312 ; 3466
JRST L.184
MOVEI AC1,23
POPJ SP,
L.170: MOVE AC1,U.58 ; 3468
CAIE AC1,123 ; 3471
JRST L.171
MOVE AC2,U.53 ; 3474
CAMLE AC2,SI%RETRIES
JRST L.174
AOS U.53 ; 3476
MOVE AC1,U.55 ; 3478
SUBI AC1,1
LDB AC2,C.18
CAME AC2,U.56
JRST L.186
PUSHJ SP,U.20 ; 3481
MOVEI AC1,61 ; 3482
MOVEM AC1,U.48
PUSH SP,C.20 ; 3483
PUSH SP,U.46
PUSH SP,U.56
PUSHJ SP,U.24
MOVE AC1,U.47 ; 3484
MOVEM AC1,U.48
JRST L.172
L.171: CAIE AC1,132 ; 3496
JRST L.173
MOVE AC2,U.53 ; 3499
CAMLE AC2,PKT%RETRIES
JRST L.174
AOS U.53 ; 3501
MOVE AC1,U.55 ; 3503
SUBI AC1,1
LDB AC2,C.18
CAME AC2,U.56
JRST L.186
PUSH SP,C.20 ; 3506
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
L.172: SETZM U.54 ; 3507
ADJSP SP,-2 ; 3505
MOVE AC1,U.51 ; 3511
JRST L.187
L.173: CAIE AC1,106 ; 3518
JRST L.179
MOVE AC2,U.55 ; 3521
CAMN AC2,U.56
JRST L.175
L.174: MOVEI AC1,24
POPJ SP,
L.175: SKIPN U.57 ; 3523
JRST L.183
PUSH SP,C.10 ; 3533
PUSH SP,C.22
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 3534
SETZM -2(SP) ; 3535
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
MOVEM AC1,FILE%SIZE
SETZ AC2, ; 3536
MOVE AC3,C.19
MOVE AC1,FILE%SIZE
ADJBP AC1,AC3
IDPB AC2,AC1
MOVEI AC1,1 ; 3541
TDNE AC1,CONNECT%FLAG
JRST L.176
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.176
PUSH SP,C.46 ; 3544
PUSHJ SP,TT%TEXT
PUSH SP,C.34 ; 3545
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%OUTPUT ; 3546
ADJSP SP,-2 ; 3543
L.176: MOVEI AC1,1 ; 3553
TDNN AC1,FIL%NORMAL%FORM
JRST L.177
PUSH SP,C.34
PUSH SP,C.35
PUSH SP,C.47
PUSH SP,C.48
PUSHJ SP,U.27
ADJSP SP,-4
L.177: SETZM U.61 ; 3555
PUSH SP,C.2 ; 3557
PUSHJ SP,FILE%OPEN
ADJSP SP,-1
TRNE AC1,1
JRST L.178
ADJSP SP,-3
JRST L.184
L.178: PUSH SP,C.15 ; 3559
PUSH SP,C.12
PUSHJ SP,XFR%STATUS
SETZM U.62 ; 3560
MOVEI AC1,1 ; 3561
MOVEM AC1,FLAG%FILE%OPEN
PUSH SP,C.20 ; 3562
PUSH SP,C.25
PUSH SP,U.55
PUSHJ SP,U.24
MOVE AC1,U.54 ; 3563
MOVEM AC1,U.53
SETZM U.54 ; 3564
MOVE AC1,U.55 ; 3565
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-7 ; 3519
JRST L.181
L.179: CAIE AC1,130 ; 3569
JRST L.182
MOVE AC1,U.55 ; 3576
CAME AC1,U.56
JRST L.183
MOVEI AC1,1 ; 3583
MOVEM AC1,U.62
MOVEI AC1,U.31 ; 3584
MOVEM AC1,U.68
SKIPG U.57 ; 3586
JRST L.180
PUSH SP,C.49 ; 3589
PUSHJ SP,TT%TEXT
PUSHJ SP,U.28 ; 3590
PUSH SP,C.50 ; 3591
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 3592
ADJSP SP,-2 ; 3588
L.180: PUSH SP,C.20 ; 3595
PUSH SP,C.25
PUSH SP,U.55
PUSHJ SP,U.24
MOVE AC1,U.54 ; 3596
MOVEM AC1,U.53
SETZM U.54 ; 3597
MOVE AC1,U.55 ; 3598
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-2 ; 3574
L.181: MOVEI AC1,10 ; 3468
JRST L.187
L.182: CAIE AC1,102 ; 3602
JRST L.186
MOVE AC1,U.55 ; 3605
CAMN AC1,U.56
JRST L.185
L.183: PUSH SP,C.21 ; 3608
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 3609
L.184: MOVEI AC1,12 ; 3607
POPJ SP,
L.185: PUSH SP,C.20 ; 3612
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
ADJSP SP,-2 ; 3603
MOVEI AC1,11 ; 3468
JRST L.187
L.186: PUSH SP,C.21 ; 3618
PUSHJ SP,KRM%ERROR
MOVEI AC1,12 ; 3468
L.187: ADJSP SP,-1 ; 3617
POPJ SP, ; 3397
C.45: XWD 0,U.79
C.46: XWD 0,P.AAH
C.47: EXP 11
C.48: EXP 3
C.49: XWD 0,P.AAI
C.50: XWD 0,P.AAJ
; Routine Size: 184 words
; 3624 1 %SBTTL 'REC%DATA'
; 3625 1 ROUTINE REC%DATA =
; 3626 1
; 3627 1 !++
; 3628 1 ! FUNCTIONAL DESCRIPTION:
; 3629 1 !
; 3630 1 ! This routine will accept data messages and write them to disk.
; 3631 1 ! It will also accept MSG%FILE, MSG%TEXT and MSG%EOF messages.
; 3632 1 !
; 3633 1 ! CALLING SEQUENCE:
; 3634 1 !
; 3635 1 ! STATE = REC%DATA();
; 3636 1 !
; 3637 1 ! INPUT PARAMETERS:
; 3638 1 !
; 3639 1 ! None.
; 3640 1 !
; 3641 1 ! IMPLICIT INPUTS:
; 3642 1 !
; 3643 1 ! None.
; 3644 1 !
; 3645 1 ! OUTPUT PARAMETERS:
; 3646 1 !
; 3647 1 ! New state for the finite state machine.
; 3648 1 !
; 3649 1 ! IMPLICIT OUTPUTS:
; 3650 1 !
; 3651 1 ! None.
; 3652 1 !
; 3653 1 ! COMPLETION CODES:
; 3654 1 !
; 3655 1 ! None.
; 3656 1 !
; 3657 1 ! SIDE EFFECTS:
; 3658 1 !
; 3659 1 ! None.
; 3660 1 !
; 3661 1 !--
; 3662 1
; 3663 2 BEGIN
; 3664 2
; 3665 2 LOCAL
; 3666 2 STATUS;
; 3667 2
; 3668 2 ROUTINE CHECK%DATA =
; 3669 3 BEGIN
; 3670 3
; 3671 3 IF .REC%TYPE EQL MSG%DATA OR (.REC%TYPE EQL MSG%FILE AND NOT .TEXT%HEAD%FLAG) OR .REC%TYPE
; 3672 4 EQL MSG%EOF OR (.REC%TYPE EQL MSG%TEXT AND .TEXT%HEAD%FLAG)
; 3673 3 THEN
; 3674 3 RETURN TRUE
; 3675 3 ELSE
; 3676 3 RETURN FALSE;
; 3677 3
; 3678 2 END;
; CHECK%DATA
U.80: MOVE AC1,U.58 ; 3671
CAIN AC1,104
JRST L.189
CAIE AC1,106
JRST L.188
MOVEI AC2,1
TDNN AC2,U.62
JRST L.189
L.188: CAIN AC1,132 ; 3672
JRST L.189
CAIE AC1,130
JRST L.190
MOVEI AC1,1
TDNN AC1,U.62
JRST L.190
L.189: MOVEI AC1,1 ; 3676
POPJ SP,
L.190: SETZ AC1,
POPJ SP, ; 3668
; Routine Size: 19 words
; 3679 2
; 3680 2 LOCAL
; 3681 2 SUB%TYPE, ! Subtype for XFR%STATUS
; 3682 2 DISCARD%FILE%FLAG, ! Sender requested discard
; 3683 2 ACK%MSG%LEN; ! Length of ACK to send
; 3684 2
; 3685 2 !
; 3686 2 ! First get a message
; 3687 2 !
; 3688 2
; 3689 3 IF NOT (STATUS = REC%MESSAGE (CHECK%DATA))
; 3690 2 THEN
; 3691 2
; 3692 2 IF .STATUS NEQ KER%ABORTED THEN RETURN STATE%A ELSE RETURN STATE%EX;
; 3693 2
; 3694 2 SELECTONE .REC%TYPE OF
; 3695 2 SET
; 3696 2
; 3697 2 [MSG%DATA] :
; 3698 3 BEGIN
; 3699 3
; 3700 3 IF .MSG%NUMBER NEQ .REC%SEQ
; 3701 3 THEN
; 3702 4 BEGIN
; 3703 4
; 3704 4 IF .OLD%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 3705 4
; 3706 4 OLD%RETRIES = .OLD%RETRIES + 1;
; 3707 4
; 3708 4 IF ((.MSG%NUMBER - 1) AND %O'77') EQL .REC%SEQ
; 3709 4 THEN
; 3710 5 BEGIN
; 3711 5 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3712 5 NUM%RETRIES = 0;
; 3713 5 RETURN .STATE;
; 3714 5 END
; 3715 4 ELSE
; 3716 5 BEGIN
; 3717 5 KRM%ERROR (KER%PROTOERR);
; 3718 5 RETURN STATE%A;
; 3719 4 END;
; 3720 4
; 3721 3 END;
; 3722 3
; 3723 3 !
; 3724 3 ! Here if we have a message with a valid message number
; 3725 3 !
; 3726 3
; 3727 3 IF NOT BFR%EMPTY () THEN RETURN STATE%A;
; 3728 3
; 3729 3 !
; 3730 3 ! Check if we wish to abort for some reason
; 3731 3 !
; 3732 3
; 3733 3 IF .ABT%CUR%FILE
; 3734 3 THEN
; 3735 4 BEGIN
; 3736 4 CH$WCHAR (MSG%ACK%ABT%CUR, CH$PTR (SND%MSG, PKT%MSG, CHR%SIZE));
; 3737 4 ACK%MSG%LEN = 1;
; 3738 4 END
; 3739 3 ELSE
; 3740 3
; 3741 3 IF .ABT%ALL%FILE
; 3742 3 THEN
; 3743 4 BEGIN
; 3744 4 CH$WCHAR (MSG%ACK%ABT%ALL, CH$PTR (SND%MSG, PKT%MSG, CHR%SIZE));
; 3745 4 ACK%MSG%LEN = 1;
; 3746 4 END
; 3747 3 ELSE
; 3748 3 ACK%MSG%LEN = 0;
; 3749 3
; 3750 3 !
; 3751 3 ! Now send the ACK
; 3752 3 !
; 3753 3 SEND%PACKET (MSG%ACK, .ACK%MSG%LEN, .REC%SEQ);
; 3754 3 OLD%RETRIES = .NUM%RETRIES;
; 3755 3 NUM%RETRIES = 0;
; 3756 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3757 3 RETURN STATE%RD;
; 3758 2 END;
; 3759 2
; 3760 2 [MSG%FILE, MSG%TEXT] :
; 3761 3 BEGIN
; 3762 3
; 3763 3 IF .OLD%RETRIES GTR .PKT%RETRIES THEN RETURN STATE%ER;
; 3764 3
; 3765 3 OLD%RETRIES = .OLD%RETRIES + 1;
; 3766 3
; 3767 3 IF ((.MSG%NUMBER - 1) AND %O'77') EQL .REC%SEQ
; 3768 3 THEN
; 3769 4 BEGIN
; 3770 4 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3771 4 NUM%RETRIES = 0;
; 3772 4 RETURN .STATE;
; 3773 4 END
; 3774 3 ELSE
; 3775 4 BEGIN
; 3776 4 KRM%ERROR (KER%PROTOERR);
; 3777 4 RETURN STATE%A;
; 3778 3 END;
; 3779 3
; 3780 2 END;
; 3781 2
; 3782 2 [MSG%EOF] :
; 3783 3 BEGIN
; 3784 3
; 3785 3 IF .MSG%NUMBER NEQ .REC%SEQ
; 3786 3 THEN
; 3787 4 BEGIN
; 3788 4 KRM%ERROR (KER%PROTOERR);
; 3789 4 RETURN STATE%A;
; 3790 3 END;
; 3791 3
; 3792 3 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3793 3
; 3794 3 IF NOT .TEXT%HEAD%FLAG
; 3795 3 THEN
; 3796 4 BEGIN
; 3797 4 FLAG%FILE%OPEN = FALSE;
; 3798 4 DISCARD%FILE%FLAG = FALSE; ! Assume we want file
; 3799 4
; 3800 4 IF .REC%LENGTH EQL 1
; 3801 4 THEN
; 3802 4
; 3803 4 IF CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG, CHR%SIZE)) EQL MSG%EOF%DISCARD ! [108]
; 3804 4 THEN
; 3805 4 DISCARD%FILE%FLAG = TRUE;
; 3806 4
; 3807 4 IF ( NOT .CONNECT%FLAG) AND .TY%FIL
; 3808 4 THEN
; 3809 5 BEGIN
; 3810 5
; 3811 5 IF .DISCARD%FILE%FLAG
; 3812 5 THEN
; 3813 5
; 3814 5 IF .ABT%FLAG
; 3815 5 THEN
; 3816 5 TT%TEXT (UPLIT (%ASCIZ' [Interrupted]'))
; 3817 5 ELSE
; 3818 5 TT%TEXT (UPLIT (%ASCIZ' [Interrupted, partial file saved]'))
; 3819 5
; 3820 5 ELSE
; 3821 5 TT%TEXT (UPLIT (%ASCIZ' [OK]'));
; 3822 5
; 3823 5 TT%CRLF ();
; 3824 4 END;
; 3825 4
; 3826 4 IF NOT FILE%CLOSE (.DISCARD%FILE%FLAG AND .ABT%FLAG) THEN RETURN STATE%A;
; 3827 4
; 3828 4 IF .DISCARD%FILE%FLAG
; 3829 4 THEN
; 3830 4
; 3831 4 IF .ABT%FLAG THEN SUB%TYPE = %C'X' ELSE SUB%TYPE = %C'D'
; 3832 4
; 3833 4 ELSE
; 3834 4 SUB%TYPE = %C'C';
; 3835 4
; 3836 4 END
; 3837 3 ELSE
; 3838 4 BEGIN
; 3839 4 TT%CRLF (); ! Make sure we have a CRLF
; 3840 4 TT%OUTPUT (); ! And make sure all output is sent
; 3841 3 END;
; 3842 3
; 3843 3 XFR%STATUS (%C'F', .SUB%TYPE);
; 3844 3 MSG%NUMBER = (.MSG%NUMBER + 1) AND %O'77';
; 3845 3 RETURN STATE%RF;
; 3846 2 END;
; 3847 2
; 3848 2 [OTHERWISE] :
; 3849 3 BEGIN
; 3850 3 KRM%ERROR (KER%PROTOERR);
; 3851 3 RETURN STATE%A;
; 3852 2 END;
; 3853 2 TES;
; 3854 2
; 3855 1 END; ! End of REC%DATA
P.AAK: BYTE (7)" ","[","I","n","t"
BYTE (7)"e","r","r","u","p"
BYTE (7)"t","e","d","]",000
P.AAL: BYTE (7)" ","[","I","n","t"
BYTE (7)"e","r","r","u","p"
BYTE (7)"t","e","d",","," "
BYTE (7)"p","a","r","t","i"
BYTE (7)"a","l"," ","f","i"
BYTE (7)"l","e"," ","s","a"
BYTE (7)"v","e","d","]",000
P.AAM: BYTE (7)" ","[","O","K","]"
BYTE (7)000,000,000,000,000
; REC%DATA
U.13: PUSH SP,AC16 ; 3625
PUSH SP,C.51 ; 3689
PUSHJ SP,U.25
ADJSP SP,-1
TRNE AC1,1
JRST L.191
CAIE AC1,312 ; 3692
JRST L.208
MOVEI AC1,23
JRST L.216
L.191: MOVE AC1,U.58 ; 3694
CAIE AC1,104 ; 3697
JRST L.197
MOVE AC2,U.55 ; 3700
CAMN AC2,U.56
JRST L.192
MOVE AC1,U.53 ; 3704
CAMLE AC1,PKT%RETRIES
JRST L.199
JRST L.200 ; 3625
L.192: PUSHJ SP,U.28 ; 3727
TRNN AC1,1
JRST L.208
MOVEI AC1,1 ; 3733
TDNN AC1,ABT%CUR%FILE
JRST L.193
MOVEI AC2,130 ; 3736
MOVE AC1,C.32
IDPB AC2,AC1
JRST L.194
L.193: MOVEI AC1,1 ; 3741
TDNN AC1,ABT%ALL%FILE
JRST L.195
MOVEI AC3,132 ; 3744
MOVE AC1,C.32
IDPB AC3,AC1
L.194: MOVEI AC2,1 ; 3745
JRST L.196 ; 3741
L.195: SETZ AC2, ; 3748
L.196: PUSH SP,C.20 ; 3753
PUSH SP,AC2
PUSH SP,U.56
PUSHJ SP,U.24
MOVE AC1,U.54 ; 3754
MOVEM AC1,U.53
SETZM U.54 ; 3755
MOVE AC1,U.55 ; 3756
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-2 ; 3698
MOVEI AC1,10 ; 3694
JRST L.215
L.197: CAIE AC1,106 ; 3760
CAIN AC1,130
JRST L.198
JRST L.201
L.198: MOVE AC1,U.53 ; 3763
CAMG AC1,PKT%RETRIES
JRST L.200
L.199: MOVEI AC1,24
JRST L.216
L.200: AOS U.53 ; 3765
MOVE AC1,U.55 ; 3767
SUBI AC1,1
LDB AC2,C.18
CAME AC2,U.56
JRST L.214
PUSH SP,C.20 ; 3770
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
SETZM U.54 ; 3771
ADJSP SP,-2 ; 3769
MOVE AC1,U.51 ; 3775
JRST L.215
L.201: CAIE AC1,132 ; 3782
JRST L.214
MOVE AC1,U.55 ; 3785
CAMN AC1,U.56
JRST L.202
PUSH SP,C.21 ; 3788
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 3789
JRST L.208
L.202: PUSH SP,C.20 ; 3792
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
MOVEI AC1,1 ; 3794
TDNE AC1,U.62
JRST L.212
SETZB AC16,FLAG%FILE%OPEN ; 3797
MOVEI AC1,1 ; 3800
CAME AC1,U.57
JRST L.203
MOVE AC2,C.27 ; 3803
MOVE AC1,U.39
ADJBP AC1,AC2
ILDB AC1,AC1
CAIN AC1,104
MOVEI AC16,1 ; 3805
L.203: MOVEI AC1,1 ; 3807
TDNE AC1,CONNECT%FLAG
JRST L.207
MOVEI AC1,1
TDNN AC1,TY%FIL
JRST L.207
TRNN AC16,1 ; 3811
JRST L.205
MOVEI AC1,1 ; 3814
TDNN AC1,ABT%FLAG
JRST L.204
PUSH SP,C.52 ; 3816
JRST L.206
L.204: PUSH SP,C.53 ; 3818
JRST L.206
L.205: PUSH SP,C.54 ; 3821
L.206: PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 3823
ADJSP SP,-1 ; 3809
L.207: MOVE AC1,AC16 ; 3826
AND AC1,ABT%FLAG
PUSH SP,AC1
PUSHJ SP,FILE%CLOSE
ADJSP SP,-1
TRNE AC1,1
JRST L.209
ADJSP SP,-3
L.208: MOVEI AC1,12
JRST L.216
L.209: TRNN AC16,1 ; 3828
JRST L.211
MOVEI AC1,1 ; 3831
TDNN AC1,ABT%FLAG
JRST L.210
MOVEI AC1,130
JRST L.213
L.210: MOVEI AC1,104
JRST L.213 ; 3828
L.211: MOVEI AC1,103 ; 3834
JRST L.213 ; 3794
L.212: PUSHJ SP,TT%CRLF ; 3839
PUSHJ SP,TT%OUTPUT ; 3840
L.213: PUSH SP,C.15 ; 3843
PUSH SP,AC1
PUSHJ SP,XFR%STATUS
MOVE AC1,U.55 ; 3844
ADDI AC1,1
LDB AC2,C.18
MOVEM AC2,U.55
ADJSP SP,-4 ; 3783
MOVEI AC1,7 ; 3694
JRST L.215
L.214: PUSH SP,C.21 ; 3850
PUSHJ SP,KRM%ERROR
MOVEI AC1,12 ; 3694
L.215: ADJSP SP,-1 ; 3849
L.216: POP SP,AC16 ; 3625
POPJ SP,
C.51: XWD 0,U.80
C.52: XWD 0,P.AAK
C.53: XWD 0,P.AAL
C.54: XWD 0,P.AAM
; Routine Size: 164 words
; 3856 1 %SBTTL 'SERVER - Generic commands'
; 3857 1 ROUTINE SERVER%GENERIC =
; 3858 1
; 3859 1 !++
; 3860 1 ! FUNCTIONAL DESCRIPTION:
; 3861 1 !
; 3862 1 ! This routine will handle the generic server messages.
; 3863 1 ! The generic server messages include FINISH, LOGOUT.
; 3864 1 !
; 3865 1 ! CALLING SEQUENCE:
; 3866 1 !
; 3867 1 ! STATE = SERVER%GENERIC();
; 3868 1 !
; 3869 1 ! INPUT PARAMETERS:
; 3870 1 !
; 3871 1 ! None.
; 3872 1 !
; 3873 1 ! IMPLICIT INPUTS:
; 3874 1 !
; 3875 1 ! Generic message receive in REC%MSG.
; 3876 1 !
; 3877 1 ! OUTPUT PARAMETERS:
; 3878 1 !
; 3879 1 ! Returns new state for FSM
; 3880 1 !
; 3881 1 ! IMPLICIT OUTPUTS:
; 3882 1 !
; 3883 1 ! None.
; 3884 1 !
; 3885 1 ! COMPLETION CODES:
; 3886 1 !
; 3887 1 ! None.
; 3888 1 !
; 3889 1 ! SIDE EFFECTS:
; 3890 1 !
; 3891 1 ! None.
; 3892 1 !
; 3893 1 !--
; 3894 1
; 3895 2 BEGIN
; 3896 2
; 3897 2 LOCAL
; 3898 2 STATUS, ! Returned status
; 3899 2 G%FUNC, ! Generic command function
; 3900 2 POINTER, ! Character pointer
; 3901 2 DATA%TEXT : VECTOR [CH$ALLOCATION (MAX%MSG)], ! Unpacked message
; 3902 2 DATA%SIZE; ! Actual size of data
; 3903 2
; 3904 2 ROUTINE UNPACK%DATA (POINTER, SIZE, DST%ADDR, DST%LEN) =
; 3905 2 !
; 3906 2 ! Routine to unpack an argument.
; 3907 2 ! This will copy the argument data to the desired buffer.
; 3908 2 !
; 3909 3 BEGIN
; 3910 3
; 3911 3 IF .SIZE GTR 0 ! If we have something to unpack
; 3912 3 THEN
; 3913 4 BEGIN
; 3914 4 .DST%LEN = UNCHAR (CH$RCHAR%A (.POINTER));
; 3915 4
; 3916 4 IF ..DST%LEN LSS 0
; 3917 4 THEN
; 3918 5 BEGIN
; 3919 5 KRM%ERROR (KER%PROTOERR); ! Someone screwed up
; 3920 5 ..DST%LEN = 0;
; 3921 5 RETURN -1;
; 3922 4 END;
; 3923 4
; 3924 4 IF ..DST%LEN GTR .SIZE - 1 THEN .DST%LEN = .SIZE - 1;
; 3925 4
; 3926 4 CH$COPY (..DST%LEN, ..POINTER, CHR%NUL, MAX%MSG, CH$PTR(.DST%ADDR));
; 3927 4 .POINTER = CH$PLUS (..POINTER, ..DST%LEN);
; 3928 4 RETURN .SIZE - ..DST%LEN - 1;
; 3929 4 END
; 3930 3 ELSE
; 3931 3 !
; 3932 3 ! If nothing left in buffer, return the current size (0)
; 3933 3 !
; 3934 3 RETURN .SIZE;
; 3935 3
; 3936 2 END;
; UNPACK%DATA
U.81: PUSH SP,AC12 ; 3904
PUSH SP,AC13
PUSH SP,AC14
PUSH SP,AC16
MOVE AC12,-7(SP) ; 3911
JUMPLE AC12,L.218
MOVE AC13,-5(SP) ; 3914
MOVE AC16,-10(SP)
ILDB AC1,0(AC16)
SUBI AC1,40
MOVEM AC1,0(AC13)
MOVE AC14,0(AC13) ; 3916
JUMPGE AC14,L.217
PUSH SP,C.21 ; 3919
PUSHJ SP,KRM%ERROR
SETZM 0(AC14) ; 3920
ADJSP SP,-1 ; 3921
SETO AC1, ; 3918
JRST L.219
L.217: MOVE AC1,AC12 ; 3924
SUBI AC1,1
CAMLE AC14,AC1
MOVEM AC1,0(AC13)
MOVE AC1,-6(SP) ; 3926
MOVEI AC5,-1(AC1)
HRLI AC5,10700
MOVE AC1,0(AC13)
MOVE AC2,0(AC16)
MOVEI AC4,1752
EXTEND AC1,C.1
JFCL
MOVE AC1,0(AC13) ; 3927
ADJBP AC1,0(AC16)
MOVEM AC1,0(AC16)
MOVE AC1,AC12 ; 3928
SUB AC1,0(AC13)
SOJA AC1,L.219 ; 3934
L.218: MOVE AC1,AC12
L.219: POP SP,AC16 ; 3904
POP SP,AC14
POP SP,AC13
POP SP,AC12
POPJ SP,
; Routine Size: 43 words
; 3937 2 !
; 3938 2 ! First unpack the message data into its various pieces
; 3939 2 !
; 3940 2 SET%STRING (CH$PTR (DATA%TEXT), MAX%MSG, TRUE); ! Initialize for unpacking
; 3941 2 BFR%EMPTY (); ! Unpack the data
; 3942 2 DATA%SIZE = SET%STRING (0, 0, FALSE); ! All done, get size
; 3943 2
; 3944 2 IF .DATA%SIZE LEQ 0
; 3945 2 THEN
; 3946 3 BEGIN
; 3947 3 KRM%ERROR (KER%PROTOERR); ! Someone screwed up
; 3948 3 RETURN STATE%A; ! Since no subtype
; 3949 2 END;
; 3950 2
; 3951 2 !
; 3952 2 ! Get the arguments from the unpacked data (if any)
; 3953 2 !
; 3954 2 GEN%1SIZE = 0; ! Assume no args
; 3955 2 GEN%2SIZE = 0; ! none at all
; 3956 2 GEN%3SIZE = 0;
; 3957 2 CH$WCHAR (CHR%NUL, CH$PTR (GEN%1DATA)); ! Ensure all are null terminated
; 3958 2 CH$WCHAR (CHR%NUL, CH$PTR (GEN%2DATA));
; 3959 2 CH$WCHAR (CHR%NUL, CH$PTR (GEN%3DATA));
; 3960 2 POINTER = CH$PTR (DATA%TEXT, 1); ! Point at second character
; 3961 2 DATA%SIZE = .DATA%SIZE - 1; ! Account for subtype
; 3962 2
; 3963 2 IF .DATA%SIZE GTR 0 ! Room for first arg?
; 3964 2 THEN
; 3965 3 BEGIN
; 3966 3 DATA%SIZE = UNPACK%DATA (POINTER, .DATA%SIZE, GEN%1DATA, GEN%1SIZE);
; 3967 3
; 3968 3 IF .DATA%SIZE LSS 0 THEN RETURN STATE%A; ! Punt if bad arguments
; 3969 3
; 3970 3 IF .DATA%SIZE GTR 0 ! Second argument present?
; 3971 3 THEN
; 3972 4 BEGIN
; 3973 4 DATA%SIZE = UNPACK%DATA (POINTER, .DATA%SIZE, GEN%2DATA, GEN%2SIZE);
; 3974 4
; 3975 4 IF .DATA%SIZE LSS 0 THEN RETURN STATE%A; ! Punt if bad arguments
; 3976 4
; 3977 4 IF .DATA%SIZE GTR 0 ! Third argument here?
; 3978 4 THEN
; 3979 5 BEGIN
; 3980 5 DATA%SIZE = UNPACK%DATA (POINTER, .DATA%SIZE, GEN%3DATA, GEN%3SIZE);
; 3981 5
; 3982 5 IF .DATA%SIZE LSS 0 THEN RETURN STATE%A; ! Punt if bad arguments
; 3983 5
; 3984 4 END;
; 3985 4
; 3986 3 END;
; 3987 3
; 3988 2 END;
; 3989 2
; 3990 2 SELECTONE CH$RCHAR (CH$PTR (DATA%TEXT)) OF
; 3991 2 SET
; 3992 2 !
; 3993 2 ! EXIT command, just return the status to the upper level
; 3994 2 !
; 3995 2
; 3996 2 [MSG%GEN%EXIT] :
; 3997 3 BEGIN
; 3998 3 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 3999 3 RETURN STATE%FI;
; 4000 2 END;
; 4001 2 !
; 4002 2 ! LOGOUT command, ACK the message then call the system routine to
; 4003 2 ! kill the process (log the job out, etc.)
; 4004 2 !
; 4005 2
; 4006 2 [MSG%GEN%LOGOUT] :
; 4007 3 BEGIN
; 4008 3 SEND%PACKET (MSG%ACK, 0, .REC%SEQ);
; 4009 3 SY%LOGOUT ();
; 4010 3 RETURN STATE%LG;
; 4011 2 END;
; 4012 2 !
; 4013 2 ! For a type command, just set up a transfer flagging we want a text header
; 4014 2 ! instead of a file header.
; 4015 2 !
; 4016 2
; 4017 2 [MSG%GEN%TYPE] :
; 4018 3 BEGIN
; 4019 3 CH$COPY (.GEN%1SIZE, CH$PTR (GEN%1DATA), CHR%NUL, MAX%FILE%NAME, CH$PTR (FILE%NAME));
; 4020 3 FILE%SIZE = .GEN%1SIZE;
; 4021 3 TEXT%HEAD%FLAG = TRUE; ! Now want text header
; 4022 3 XFR%STATUS (%C'I', %C'G'); ! Tell display routine we are doing a command
; 4023 3
; 4024 3 IF .STATE EQL STATE%II AND .BLK%CHK%TYPE EQL .INI%CHK%TYPE
; 4025 3 THEN
; 4026 3 RETURN STATE%OF ! Must open the file
; 4027 3 ELSE
; 4028 3 RETURN STATE%S; ! Start the transaction with a send
; 4029 3
; 4030 2 END;
; 4031 2
; 4032 2 [MSG%GEN%DIRECTORY] :
; 4033 2 G%FUNC = GC%DIRECTORY;
; 4034 2
; 4035 2 [MSG%GEN%DISK%USAGE] :
; 4036 2 G%FUNC = GC%DISK%USAGE;
; 4037 2
; 4038 2 [MSG%GEN%DELETE] :
; 4039 2 G%FUNC = GC%DELETE;
; 4040 2
; 4041 2 [MSG%GEN%HELP] :
; 4042 2 G%FUNC = GC%HELP;
; 4043 2
; 4044 2 [MSG%GEN%LOGIN] :
; 4045 2 G%FUNC = GC%LGN;
; 4046 2
; 4047 2 [MSG%GEN%CONNECT] :
; 4048 2 G%FUNC = GC%CONNECT;
; 4049 2
; 4050 2 [MSG%GEN%RENAME] :
; 4051 2 G%FUNC = GC%RENAME;
; 4052 2
; 4053 2 [MSG%GEN%COPY] :
; 4054 2 G%FUNC = GC%COPY;
; 4055 2
; 4056 2 [MSG%GEN%WHO] :
; 4057 2 G%FUNC = GC%WHO;
; 4058 2
; 4059 2 [MSG%GEN%SEND] :
; 4060 2 G%FUNC = GC%SEND%MSG;
; 4061 2
; 4062 2 [MSG%GEN%QUERY] :
; 4063 2 G%FUNC = GC%STATUS;
; 4064 2
; 4065 2 [MSG%GEN%PROGRAM] :
; 4066 2 G%FUNC = GC%PROGRAM;
; 4067 2
; 4068 2 [MSG%GEN%JOURNAL] :
; 4069 2 G%FUNC = GC%JOURNAL;
; 4070 2
; 4071 2 [MSG%GEN%VARIABLE] :
; 4072 2 G%FUNC = GC%VARIABLE;
; 4073 2 !
; 4074 2 ! Here if we have a function that is not implemented in KERMSG.
; 4075 2 !
; 4076 2
; 4077 2 [OTHERWISE] :
; 4078 3 BEGIN
; 4079 3 KRM%ERROR (KER%UNIMPLGEN);
; 4080 3 RETURN STATE%A;
; 4081 2 END;
; 4082 2 TES;
; 4083 2
; 4084 2 !
; 4085 2 ! If we get here, we have gotten a known type of generic message that
; 4086 2 ! we need to have our operating system dependent routine handle.
; 4087 2 !
; 4088 2 RETURN CALL%SY%RTN (.G%FUNC);
; 4089 1 END; ! End of SERVER%GENERIC
; SERVER%GENERIC
U.14: PUSH SP,AC14 ; 3857
PUSH SP,AC16
ADJSP SP,312
MOVEI AC1,-312(SP) ; 3940
HRLI AC1,10700
PUSH SP,AC1
PUSH SP,C.55
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 3941
SETZM -2(SP) ; 3942
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
MOVE AC14,AC1
JUMPG AC14,L.220 ; 3944
PUSH SP,C.21 ; 3947
JRST L.246
L.220: SETZM GEN%1SIZE ; 3954
SETZM GEN%2SIZE ; 3955
SETZB AC2,GEN%3SIZE ; 3956
MOVE AC1,C.11 ; 3957
IDPB AC2,AC1
SETZ AC2, ; 3958
MOVE AC1,C.56
IDPB AC2,AC1
SETZ AC2, ; 3959
MOVE AC1,C.57
IDPB AC2,AC1
MOVEI AC1,-314(SP) ; 3960
HRLI AC1,350700
MOVEM AC1,-3(SP)
SOJLE AC14,L.226 ; 3963
MOVEI AC1,-3(SP) ; 3966
PUSH SP,AC1
PUSH SP,AC14
PUSH SP,C.38
PUSH SP,C.58
PUSHJ SP,U.81
MOVE AC14,AC1
JUMPGE AC14,L.221 ; 3968
ADJSP SP,-7
JRST L.247
L.221: JUMPLE AC14,L.225 ; 3970
MOVEI AC1,-7(SP) ; 3973
PUSH SP,AC1
PUSH SP,AC14
PUSH SP,C.39
PUSH SP,C.59
PUSHJ SP,U.81
MOVE AC14,AC1
JUMPGE AC14,L.222 ; 3975
ADJSP SP,-13
JRST L.247
L.222: JUMPLE AC14,L.224 ; 3977
MOVEI AC1,-13(SP) ; 3980
PUSH SP,AC1
PUSH SP,AC14
PUSH SP,C.40
PUSH SP,C.60
PUSHJ SP,U.81
MOVE AC14,AC1
JUMPGE AC14,L.223 ; 3982
ADJSP SP,-17
JRST L.247
L.223: ADJSP SP,-4 ; 3979
L.224: ADJSP SP,-4 ; 3972
L.225: ADJSP SP,-4 ; 3965
L.226: MOVEI AC1,-315(SP) ; 3990
HRLI AC1,10700
ILDB AC16,AC1
CAIE AC16,106 ; 3996
JRST L.227
PUSH SP,C.20 ; 3998
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
ADJSP SP,-6 ; 3999
MOVEI AC1,20 ; 3997
JRST L.249
L.227: CAIE AC16,114 ; 4006
JRST L.228
PUSH SP,C.20 ; 4008
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
PUSHJ SP,SY%LOGOUT ; 4009
ADJSP SP,-6 ; 4010
MOVEI AC1,21 ; 4007
JRST L.249
L.228: CAIE AC16,124 ; 4017
JRST L.231
MOVE AC1,GEN%1SIZE ; 4019
MOVE AC2,C.11
MOVEI AC4,204
MOVE AC5,C.10
EXTEND AC1,C.1
JFCL
MOVE AC1,GEN%1SIZE ; 4020
MOVEM AC1,FILE%SIZE
MOVEI AC1,1 ; 4021
MOVEM AC1,U.62
PUSH SP,C.6 ; 4022
PUSH SP,C.61
PUSHJ SP,XFR%STATUS
MOVEI AC1,17 ; 4024
CAME AC1,U.51
JRST L.229
MOVE AC1,U.48
CAME AC1,U.47
JRST L.229
MOVEI AC1,22 ; 4028
JRST L.230
L.229: MOVEI AC1,1
L.230: ADJSP SP,-5 ; 4024
JRST L.249 ; 4018
L.231: CAIE AC16,104 ; 4032
JRST L.232
MOVEI AC14,2 ; 4033
JRST L.248 ; 3990
L.232: CAIE AC16,125 ; 4035
JRST L.233
MOVEI AC14,3 ; 4036
JRST L.248 ; 3990
L.233: CAIE AC16,105 ; 4038
JRST L.234
MOVEI AC14,4 ; 4039
JRST L.248 ; 3990
L.234: CAIE AC16,110 ; 4041
JRST L.235
MOVEI AC14,6 ; 4042
JRST L.248 ; 3990
L.235: CAIE AC16,111 ; 4044
JRST L.236
MOVEI AC14,10 ; 4045
JRST L.248 ; 3990
L.236: CAIE AC16,103 ; 4047
JRST L.237
MOVEI AC14,11 ; 4048
JRST L.248 ; 3990
L.237: CAIE AC16,122 ; 4050
JRST L.238
MOVEI AC14,12 ; 4051
JRST L.248 ; 3990
L.238: CAIE AC16,113 ; 4053
JRST L.239
MOVEI AC14,13 ; 4054
JRST L.248 ; 3990
L.239: CAIE AC16,127 ; 4056
JRST L.240
MOVEI AC14,14 ; 4057
JRST L.248 ; 3990
L.240: CAIE AC16,115 ; 4059
JRST L.241
MOVEI AC14,15 ; 4060
JRST L.248 ; 3990
L.241: CAIE AC16,121 ; 4062
JRST L.242
MOVEI AC14,16 ; 4063
JRST L.248 ; 3990
L.242: CAIE AC16,120 ; 4065
JRST L.243
MOVEI AC14,23 ; 4066
JRST L.248 ; 3990
L.243: CAIE AC16,112 ; 4068
JRST L.244
MOVEI AC14,21 ; 4069
JRST L.248 ; 3990
L.244: CAIE AC16,126 ; 4071
JRST L.245
MOVEI AC14,22 ; 4072
JRST L.248 ; 3990
L.245: PUSH SP,C.13 ; 4079
L.246: PUSHJ SP,KRM%ERROR
ADJSP SP,-4 ; 4080
L.247: MOVEI AC1,12 ; 4078
JRST L.249
L.248: MOVEM AC14,0(SP) ; 4088
PUSHJ SP,U.17
ADJSP SP,-3
L.249: ADJSP SP,-312 ; 3857
POP SP,AC16
POP SP,AC14
POPJ SP,
C.55: EXP 1752
C.56: POINT 7,GEN%2DATA-1,34
C.57: POINT 7,GEN%3DATA-1,34
C.58: XWD 0,GEN%1SIZE
C.59: XWD 0,GEN%2SIZE
C.60: XWD 0,GEN%3SIZE
C.61: EXP 107
; Routine Size: 191 words
; 4090 1 %SBTTL 'HOST%COMMAND - perform a host command'
; 4091 1 ROUTINE HOST%COMMAND =
; 4092 1
; 4093 1 !++
; 4094 1 ! FUNCTIONAL DESCRIPTION:
; 4095 1 !
; 4096 1 ! This routine will handle the host command packet.
; 4097 1 ! It will set up the data for the call to the system routine.
; 4098 1 !
; 4099 1 ! CALLING SEQUENCE:
; 4100 1 !
; 4101 1 ! STATE = HOST%COMMAND();
; 4102 1 !
; 4103 1 ! INPUT PARAMETERS:
; 4104 1 !
; 4105 1 ! None.
; 4106 1 !
; 4107 1 ! IMPLICIT INPUTS:
; 4108 1 !
; 4109 1 ! Generic message receive in REC%MSG.
; 4110 1 !
; 4111 1 ! OUTPUT PARAMETERS:
; 4112 1 !
; 4113 1 ! Returns new state for FSM
; 4114 1 !
; 4115 1 ! IMPLICIT OUTPUTS:
; 4116 1 !
; 4117 1 ! None.
; 4118 1 !
; 4119 1 ! COMPLETION CODES:
; 4120 1 !
; 4121 1 ! None.
; 4122 1 !
; 4123 1 ! SIDE EFFECTS:
; 4124 1 !
; 4125 1 ! None.
; 4126 1 !
; 4127 1 !--
; 4128 1
; 4129 2 BEGIN
; 4130 2 GEN%1SIZE = 0;
; 4131 2 GEN%2SIZE = 0;
; 4132 2 GEN%3SIZE = 0;
; 4133 2
; 4134 2 IF .REC%LENGTH LEQ 0
; 4135 2 THEN
; 4136 3 BEGIN
; 4137 3 KRM%ERROR (KER%PROTOERR); ! Return an error
; 4138 3 RETURN STATE%A; ! Just abort
; 4139 2 END;
; 4140 2
; 4141 2 SET%STRING (CH$PTR (GEN%1DATA), MAX%MSG, TRUE); ! Start writing to buffer
; 4142 2 BFR%EMPTY (); ! Dump the text
; 4143 2 GEN%1SIZE = SET%STRING (0, 0, FALSE); ! Get the result
; 4144 2 RETURN CALL%SY%RTN (GC%COMMAND);
; 4145 1 END; ! End of HOST%COMMAND
; HOST%COMMAND
U.15: SETZM GEN%1SIZE ; 4130
SETZM GEN%2SIZE ; 4131
SETZM GEN%3SIZE ; 4132
SKIPLE U.57 ; 4134
JRST L.250
PUSH SP,C.21 ; 4137
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 4138
MOVEI AC1,12 ; 4136
POPJ SP,
L.250: PUSH SP,C.11 ; 4141
PUSH SP,C.55
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 4142
SETZM -2(SP) ; 4143
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
MOVEM AC1,GEN%1SIZE
PUSH SP,C.62 ; 4144
PUSHJ SP,U.17
ADJSP SP,-4
POPJ SP, ; 4091
C.62: EXP 17
; Routine Size: 25 words
; 4146 1 %SBTTL 'KERMIT%COMMAND - perform a KERMIT command'
; 4147 1 ROUTINE KERMIT%COMMAND =
; 4148 1
; 4149 1 !++
; 4150 1 ! FUNCTIONAL DESCRIPTION:
; 4151 1 !
; 4152 1 ! This routine will handle the KERMIT command packet.
; 4153 1 ! It will set up the data for the call to the system routine.
; 4154 1 !
; 4155 1 ! CALLING SEQUENCE:
; 4156 1 !
; 4157 1 ! STATE = KERMIT%COMMAND();
; 4158 1 !
; 4159 1 ! INPUT PARAMETERS:
; 4160 1 !
; 4161 1 ! None.
; 4162 1 !
; 4163 1 ! IMPLICIT INPUTS:
; 4164 1 !
; 4165 1 ! Generic message receive in REC%MSG.
; 4166 1 !
; 4167 1 ! OUTPUT PARAMETERS:
; 4168 1 !
; 4169 1 ! Returns new state for FSM
; 4170 1 !
; 4171 1 ! IMPLICIT OUTPUTS:
; 4172 1 !
; 4173 1 ! None.
; 4174 1 !
; 4175 1 ! COMPLETION CODES:
; 4176 1 !
; 4177 1 ! None.
; 4178 1 !
; 4179 1 ! SIDE EFFECTS:
; 4180 1 !
; 4181 1 ! None.
; 4182 1 !
; 4183 1 !--
; 4184 1
; 4185 2 BEGIN
; 4186 2 GEN%1SIZE = 0;
; 4187 2 GEN%2SIZE = 0;
; 4188 2 GEN%3SIZE = 0;
; 4189 2
; 4190 2 IF .REC%LENGTH LEQ 0
; 4191 2 THEN
; 4192 3 BEGIN
; 4193 3 KRM%ERROR (KER%PROTOERR); ! Return an error
; 4194 3 RETURN STATE%A; ! Just abort
; 4195 2 END;
; 4196 2
; 4197 2 SET%STRING (CH$PTR (GEN%1DATA), MAX%MSG, TRUE); ! Start writing to buffer
; 4198 2 BFR%EMPTY (); ! Dump the text
; 4199 2 GEN%1SIZE = SET%STRING (0, 0, FALSE); ! Get the result
; 4200 2 RETURN CALL%SY%RTN (GC%KERMIT);
; 4201 1 END; ! End of KERMIT%COMMAND
; KERMIT%COMMAND
U.16: SETZM GEN%1SIZE ; 4186
SETZM GEN%2SIZE ; 4187
SETZM GEN%3SIZE ; 4188
SKIPLE U.57 ; 4190
JRST L.251
PUSH SP,C.21 ; 4193
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 4194
MOVEI AC1,12 ; 4192
POPJ SP,
L.251: PUSH SP,C.11 ; 4197
PUSH SP,C.55
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 4198
SETZM -2(SP) ; 4199
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
MOVEM AC1,GEN%1SIZE
PUSH SP,C.63 ; 4200
PUSHJ SP,U.17
ADJSP SP,-4
POPJ SP, ; 4147
C.63: EXP 20
; Routine Size: 25 words
; 4202 1 %SBTTL 'CALL%SY%RTN - handle operating system dependent functions'
; 4203 1 ROUTINE CALL%SY%RTN (G%FUNC) =
; 4204 1
; 4205 1 !++
; 4206 1 ! FUNCTIONAL DESCRIPTION:
; 4207 1 !
; 4208 1 ! This routine will handle calling the operating system dependent routine
; 4209 1 ! for a server function and returning the response.
; 4210 1 !
; 4211 1 ! CALLING SEQUENCE:
; 4212 1 !
; 4213 1 ! STATE = CALL%SY%RTN(.G%FUNC);
; 4214 1 !
; 4215 1 ! INPUT PARAMETERS:
; 4216 1 !
; 4217 1 ! G%FUNC - Generic function code
; 4218 1 !
; 4219 1 ! IMPLICIT INPUTS:
; 4220 1 !
; 4221 1 ! Generic message data in GEN%1DATA
; 4222 1 !
; 4223 1 ! OUTPUT PARAMETERS:
; 4224 1 !
; 4225 1 ! Returns new state for FSM
; 4226 1 !
; 4227 1 ! IMPLICIT OUTPUTS:
; 4228 1 !
; 4229 1 ! None.
; 4230 1 !
; 4231 1 ! COMPLETION CODES:
; 4232 1 !
; 4233 1 ! None.
; 4234 1 !
; 4235 1 ! SIDE EFFECTS:
; 4236 1 !
; 4237 1 ! None.
; 4238 1 !
; 4239 1 !--
; 4240 1
; 4241 2 BEGIN
; 4242 2
; 4243 2 LOCAL
; 4244 2 STRING%ADDRESS, ! Address of string result
; 4245 2 STRING%LENGTH, ! Length of string result
; 4246 2 GET%CHR%SUBROUTINE, ! Routine to get a response character
; 4247 2 STATUS; ! Status value
; 4248 2
; 4249 2 !
; 4250 2 ! Call the routine with the desired type of command.
; 4251 2 !
; 4252 2 STRING%LENGTH = 0; ! Initialize for no string
; 4253 2 GET%CHR%SUBROUTINE = 0; ! And no subroutine
; 4254 2
; 4255 2 IF NOT SY%GENERIC (.G%FUNC, STRING%ADDRESS, STRING%LENGTH, GET%CHR%SUBROUTINE)
; 4256 2 THEN
; 4257 2 RETURN STATE%A; ! And abort
; 4258 2
; 4259 2 IF .STRING%LENGTH GTR 0
; 4260 2 THEN
; 4261 3 BEGIN
; 4262 3 SET%STRING (CH$PTR (.STRING%ADDRESS), .STRING%LENGTH, TRUE);
; 4263 3
; 4264 3 IF .STRING%LENGTH LSS .SEND%PKT%SIZE - PKT%OVR%HEAD
; 4265 3 THEN
; 4266 4 BEGIN
; 4267 4 BFR%FILL (TRUE); ! If it should fit, pack it in
; 4268 4
; 4269 4 IF SET%STRING (0, 0, FALSE) GEQ .STRING%LENGTH
; 4270 4 THEN ! It fit, so just send the ACK
; 4271 4
; 4272 4 IF SEND%PACKET (MSG%ACK, .SIZE, .REC%SEQ) THEN RETURN STATE%C ELSE RETURN STATE%EX;
; 4273 4
; 4274 4 !
; 4275 4 ! It didn't fit, reset the pointers to the beginning
; 4276 4 !
; 4277 4 SET%STRING (CH$PTR (.STRING%ADDRESS), .STRING%LENGTH, TRUE);
; 4278 3 END;
; 4279 3
; 4280 3 NO%FILE%NEEDED = TRUE; ! Don't need a file
; 4281 3 END
; 4282 2 ELSE
; 4283 2
; 4284 2 IF .GET%CHR%SUBROUTINE NEQ 0 ! If we got a subroutine back
; 4285 2 THEN
; 4286 3 BEGIN
; 4287 3 GET%CHR%ROUTINE = .GET%CHR%SUBROUTINE;
; 4288 3 NO%FILE%NEEDED = TRUE;
; 4289 2 END;
; 4290 2
; 4291 2 TEXT%HEAD%FLAG = TRUE; ! Send to be typed
; 4292 2 XFR%STATUS (%C'I', %C'G'); ! Doing a generic command
; 4293 2
; 4294 2 IF .STATE EQL STATE%II AND .BLK%CHK%TYPE EQL .INI%CHK%TYPE
; 4295 2 THEN
; 4296 2 RETURN STATE%OF
; 4297 2 ELSE
; 4298 2 RETURN STATE%S; ! Send the response
; 4299 2
; 4300 1 END; ! End of CALL%SY%RTN
; CALL%SY%RTN
U.17: PUSH SP,AC14 ; 4203
PUSH SP,AC16
ADJSP SP,3
SETZM -1(SP) ; 4252
SETZM -2(SP) ; 4253
PUSH SP,-6(SP) ; 4255
MOVEI AC1,-1(SP)
PUSH SP,AC1
MOVEI AC1,-3(SP)
PUSH SP,AC1
MOVEI AC1,-5(SP)
PUSH SP,AC1
PUSHJ SP,SY%GENERIC
ADJSP SP,-4
TRNE AC1,1
JRST L.252
MOVEI AC1,12 ; 4257
JRST L.261
L.252: MOVE AC14,-1(SP) ; 4259
JUMPLE AC14,L.257
MOVE AC16,0(SP) ; 4262
MOVEI AC1,-1(AC16)
HRLI AC1,10700
PUSH SP,AC1
PUSH SP,AC14
PUSH SP,C.2
PUSHJ SP,U.30
MOVE AC1,U.40 ; 4264
SUBI AC1,3
CAML AC14,AC1
JRST L.256
PUSH SP,C.2 ; 4267
PUSHJ SP,U.29
SETZM -2(SP) ; 4269
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
CAMGE AC1,AC14
JRST L.255
PUSH SP,C.20 ; 4272
PUSH SP,U.52
PUSH SP,U.56
PUSHJ SP,U.24
ADJSP SP,-3
TRNN AC1,1
JRST L.253
MOVEI AC1,11
JRST L.254
L.253: MOVEI AC1,23
L.254: ADJSP SP,-4
JRST L.261
L.255: MOVEI AC1,-1(AC16) ; 4277
HRLI AC1,10700
PUSH SP,AC1
PUSH SP,AC14
PUSH SP,C.2
PUSHJ SP,U.30
ADJSP SP,-4 ; 4266
L.256: MOVEI AC1,1 ; 4280
MOVEM AC1,U.63
ADJSP SP,-3 ; 4261
JRST L.258 ; 4259
L.257: MOVE AC1,-2(SP) ; 4284
JUMPE AC1,L.258
MOVEM AC1,U.67 ; 4287
MOVEI AC1,1 ; 4288
MOVEM AC1,U.63
L.258: MOVEI AC1,1 ; 4291
MOVEM AC1,U.62
PUSH SP,C.6 ; 4292
PUSH SP,C.61
PUSHJ SP,XFR%STATUS
MOVEI AC1,17 ; 4294
CAME AC1,U.51
JRST L.259
MOVE AC1,U.48
CAME AC1,U.47
JRST L.259
MOVEI AC1,22 ; 4298
JRST L.260
L.259: MOVEI AC1,1
L.260: ADJSP SP,-2 ; 4294
L.261: ADJSP SP,-3 ; 4203
POP SP,AC16
POP SP,AC14
POPJ SP,
; Routine Size: 86 words
; 4301 1 %SBTTL 'Message processing -- PRS%SEND%INIT - Parse send init params'
; 4302 1 ROUTINE PRS%SEND%INIT =
; 4303 1
; 4304 1 !++
; 4305 1 ! FUNCTIONAL DESCRIPTION:
; 4306 1 !
; 4307 1 ! This routine will parse the SEND%INIT parameters that were sent by
; 4308 1 ! the remote Kermit. The items will be stored into the low segment.
; 4309 1 !
; 4310 1 ! CALLING SEQUENCE:
; 4311 1 !
; 4312 1 ! PRS%SEND%INIT ();
; 4313 1 !
; 4314 1 ! INPUT PARAMETERS:
; 4315 1 !
; 4316 1 ! None.
; 4317 1 !
; 4318 1 ! IMPLICIT INPUTS:
; 4319 1 !
; 4320 1 ! Message stored in REC%MSG.
; 4321 1 !
; 4322 1 ! OUTPUT PARAMETERS:
; 4323 1 !
; 4324 1 ! None.
; 4325 1 !
; 4326 1 ! IMPLICIT OUTPUTS:
; 4327 1 !
; 4328 1 ! None.
; 4329 1 !
; 4330 1 ! COMPLETION CODES:
; 4331 1 !
; 4332 1 ! None.
; 4333 1 !
; 4334 1 ! SIDE EFFECTS:
; 4335 1 !
; 4336 1 ! None.
; 4337 1 !
; 4338 1 !--
; 4339 1
; 4340 2 BEGIN
; 4341 2 ! The following section of code will parse the various send parameters
; 4342 2 ! that are found in the send-init message. The following code will store
; 4343 2 ! the following as the value.
; 4344 2 !
; 4345 2 ! If the user specified a value then the user supplied value will be used else
; 4346 2 ! the value in the message and if none in the message then the default value.
; 4347 2 !
; 4348 2 ! User supplied values are denoted as positive values in SND%xxxxxxx.
; 4349 2 !
; 4350 2 ! Parse the packet size
; 4351 2 !
; 4352 3 SEND%PKT%SIZE = (IF .SND%PKT%SIZE GEQ 0 THEN ! [108]
; 4353 3 (IF .SND%PKT%SIZE GTR 94 THEN 94 ELSE .SND%PKT%SIZE) ELSE ! [108]
; 4354 4 BEGIN
; 4355 4
; 4356 4 IF .REC%LENGTH GTR P%SI%BUFSIZ
; 4357 4 THEN
; P 4358 4 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG,
; 4359 5 .RECV%PKT%MSG + P%SI%BUFSIZ, CHR%SIZE))) ! [108]
; 4360 4 ELSE
; 4361 4 ABS (.SND%PKT%SIZE)
; 4362 4
; 4363 4 END
; 4364 2 );
; 4365 2 !
; 4366 2 ! Parse the time out value
; 4367 2 !
; 4368 3 SEND%TIMEOUT = (IF .SND%TIMEOUT GEQ 0 THEN .SND%TIMEOUT ELSE
; 4369 4 BEGIN
; 4370 4
; 4371 4 IF .REC%LENGTH GTR P%SI%TIMOUT
; 4372 4 THEN
; P 4373 4 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG,
; 4374 5 .RECV%PKT%MSG + P%SI%TIMOUT, CHR%SIZE))) ! [108]
; 4375 4 ELSE
; 4376 4 ABS (.SND%TIMEOUT)
; 4377 4
; 4378 4 END
; 4379 2 );
; 4380 2 !
; 4381 2 ! Parse the number of padding characters supplied
; 4382 2 !
; 4383 3 SEND%NPAD = (IF .SND%NPAD GEQ 0 THEN .SND%NPAD ELSE
; 4384 4 BEGIN
; 4385 4
; 4386 4 IF .REC%LENGTH GTR P%SI%NPAD
; 4387 4 THEN
; P 4388 4 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG + P%SI%NPAD,
; 4389 5 CHR%SIZE))) ! [108]
; 4390 4 ELSE
; 4391 4 ABS (.SND%NPAD)
; 4392 4
; 4393 4 END
; 4394 2 );
; 4395 2 !
; 4396 2 ! Parse the padding character
; 4397 2 !
; 4398 3 SEND%PADCHAR = (IF .SND%PADCHAR GEQ 0 THEN .SND%PADCHAR ELSE
; 4399 4 BEGIN
; 4400 4
; 4401 4 IF .REC%LENGTH GTR P%SI%PAD
; 4402 4 THEN
; P 4403 4 CTL (CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG + P%SI%PAD,
; 4404 5 CHR%SIZE))) ! [108]
; 4405 4 ELSE
; 4406 4 ABS (.SND%PADCHAR)
; 4407 4
; 4408 4 END
; 4409 2 );
; 4410 2 !
; 4411 2 ! Parse the end of line character
; 4412 2 !
; 4413 3 SEND%EOL = (IF .SND%EOL GEQ 0 THEN .SND%EOL ELSE
; 4414 4 BEGIN
; 4415 4
; 4416 4 IF .REC%LENGTH GTR P%SI%EOL
; 4417 4 THEN
; P 4418 4 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG + P%SI%EOL,
; 4419 5 CHR%SIZE))) ! [108]
; 4420 4 ELSE
; 4421 4 ABS (.SND%EOL)
; 4422 4
; 4423 4 END
; 4424 2 );
; 4425 2 !
; 4426 2 ! Parse the quoting character
; 4427 2 !
; 4428 3 SEND%QUOTE%CHR = (IF .SND%QUOTE%CHR GEQ 0 THEN .SND%QUOTE%CHR ELSE
; 4429 4 BEGIN
; 4430 4
; 4431 4 IF .REC%LENGTH GTR P%SI%QUOTE
; 4432 4 THEN
; 4433 4 CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG + P%SI%QUOTE, ! [108]
; 4434 4 CHR%SIZE))
; 4435 4 ELSE
; 4436 4 ABS (.SND%QUOTE%CHR)
; 4437 4
; 4438 4 END
; 4439 2 );
; 4440 2 !
; 4441 2 ! Parse the 8-bit quoting character
; 4442 2 !
; 4443 2 ! If the character was not included in the packet, assume no eight-bit
; 4444 2 ! quoting allowed (we are probably talking to an old version of Kermit).
; 4445 2 !
; 4446 3 SEND%8QUOTE%CHR = (IF .REC%LENGTH GTR P%SI%8QUOTE THEN CH$RCHAR(CH$PTR (REC%MSG,
; 4447 3 .RECV%PKT%MSG + P%SI%8QUOTE, CHR%SIZE)) ELSE %C'N' ! [108] ! Assume no 8-bit quoting allowed
; 4448 2 );
; 4449 2 !
; 4450 2 ! Parse the checksum type
; 4451 2 !
; 4452 2
; 4453 2 IF .REC%LENGTH GTR P%SI%CHKTYPE
; 4454 2 THEN
; 4455 3 BEGIN
; 4456 3
; 4457 3 LOCAL
; 4458 3 REQ%CHK%TYPE;
; 4459 3
; 4460 3 REQ%CHK%TYPE = CH$RCHAR (CH$PTR (REC%MSG, .RECV%PKT%MSG + ! [108]
; 4461 3 P%SI%CHKTYPE, CHR%SIZE));
; 4462 3
; 4463 3 IF .REC%TYPE NEQ MSG%ACK
; 4464 3 THEN
; 4465 3
; 4466 3 IF .REQ%CHK%TYPE GEQ CHK%1CHAR AND .REQ%CHK%TYPE LEQ CHK%CRC
; 4467 3 THEN
; 4468 3 INI%CHK%TYPE = .REQ%CHK%TYPE
; 4469 3 ELSE
; 4470 3 INI%CHK%TYPE = CHK%1CHAR
; 4471 3
; 4472 3 ELSE
; 4473 3
; 4474 3 IF .REQ%CHK%TYPE NEQ .CHKTYPE
; 4475 3 THEN
; 4476 3 INI%CHK%TYPE = CHK%1CHAR
; 4477 3 ELSE
; 4478 3 INI%CHK%TYPE = .REQ%CHK%TYPE
; 4479 3
; 4480 3 END
; 4481 2 ELSE
; 4482 2 INI%CHK%TYPE = CHK%1CHAR; ! Only single character checksum if not specified
; 4483 2
; 4484 2 !
; 4485 2 ! Parse the repeat character
; 4486 2 !
; 4487 3 REPT%CHR = (IF .REC%LENGTH GTR P%SI%REPEAT THEN CH$RCHAR (CH$PTR (REC%MSG,
; 4488 2 .RECV%PKT%MSG + P%SI%REPEAT, CHR%SIZE)) ELSE %C' '); ! [108]
; 4489 2 ! ! [108]
; 4490 2 ! Parse the capas field, if present and if we enabled extended length ! [108]
; 4491 2 ! ! [108]
; 4492 2 ! [108]
; 4493 3 IF (.REC%LENGTH GTR P%SI%CAPAS) AND (ABS(.SND%PKT%SIZE) GTR 94) ! [108]
; 4494 2 THEN ! [108]
; 4495 3 BEGIN ! [108]
; 4496 3 ! [108]
; 4497 3 LOCAL ! [108]
; 4498 3 CAPAS%OFFSET; ! [108]
; 4499 3 ! [108]
; 4500 3 CAPAS%OFFSET = .RECV%PKT%MSG + P%SI%CAPAS; ! [108]
; 4501 3
; 4502 3 IF (UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, .CAPAS%OFFSET, CHR%SIZE))) AND 2) NEQ 0
; 4503 3 THEN ! [108]
; 4504 4 BEGIN ! [108]
; 4505 4 ! [108]
; 4506 4 SEND%PKT%SIZE = 500; ! [108]
; 4507 4 ! [108]
; 4508 4 WHILE (.REC%LENGTH GTR .CAPAS%OFFSET-.RECV%PKT%MSG) AND ! [108]
; P 4509 6 ((UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, .CAPAS%OFFSET, ! [108]
; 4510 4 CHR%SIZE))) AND 1) EQL 1) DO ! [108]
; 4511 5 BEGIN ! [108]
; 4512 5 CAPAS%OFFSET = .CAPAS%OFFSET + 1; ! [108]
; 4513 4 END; ! [108]
; 4514 4 IF .REC%LENGTH GTR .CAPAS%OFFSET-.RECV%PKT%MSG+3 ! [108]
; 4515 4 THEN ! [108]
; P 4516 4 SEND%PKT%SIZE = UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, ! [108]
; 4517 4 .CAPAS%OFFSET+2, CHR%SIZE))) * 95 +
; P 4518 4 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, ! [108]
; 4519 4 .CAPAS%OFFSET+3, CHR%SIZE))); ! [108]
; 4520 4 IF .SEND%PKT%SIZE GTR MAX%MSG - 2 ! [108]
; 4521 4 THEN ! [108]
; 4522 4 SEND%PKT%SIZE = MAX%MSG - 2; ! [108]
; 4523 4 IF .SEND%PKT%SIZE GTR ABS(.SND%PKT%SIZE) ! [108]
; 4524 4 THEN ! [108]
; 4525 4 SEND%PKT%SIZE = ABS(.SND%PKT%SIZE); ! [108]
; 4526 3 END; ! [108]
; 4527 2 END; ! [108]
; 4528 2 !
; 4529 2 ! Check for a valid quoting character. If it is not valid, then we have
; 4530 2 ! a protocol error
; 4531 2 !
; 4532 2
; 4533 4 IF NOT ((.SEND%QUOTE%CHR GEQ %O'41' AND .SEND%QUOTE%CHR LEQ %O'76') OR (.SEND%QUOTE%CHR GEQ %O
; 4534 3 '140' AND .SEND%QUOTE%CHR LEQ %O'176'))
; 4535 2 THEN
; 4536 3 BEGIN
; 4537 3 KRM%ERROR (KER%PROTOERR);
; 4538 3 RETURN KER%PROTOERR;
; 4539 2 END;
; 4540 2
; 4541 2 !
; 4542 2 ! Check for a valid 8 bit quoting and set the 8 bit quoting flag as needed
; 4543 2 !
; 4544 2
; 4545 5 IF ( NOT ((.SEND%8QUOTE%CHR GEQ %O'041' AND .SEND%8QUOTE%CHR LEQ %O'076') OR (.SEND%8QUOTE%CHR
; 4546 5 GEQ %O'140' AND .SEND%8QUOTE%CHR LEQ %O'176') OR (.SEND%8QUOTE%CHR EQL %C'N') OR (
; 4547 2 .SEND%8QUOTE%CHR EQL %C'Y'))) OR .SEND%8QUOTE%CHR EQL .SEND%QUOTE%CHR OR .SEND%8QUOTE%CHR
; 4548 2 EQL .RCV%QUOTE%CHR
; 4549 2 THEN
; 4550 3 BEGIN
; 4551 3 KRM%ERROR (KER%PROTOERR);
; 4552 3 RETURN KER%PROTOERR;
; 4553 2 END;
; 4554 2
; 4555 2 IF .SEND%8QUOTE%CHR EQL %C'Y' THEN SEND%8QUOTE%CHR = .RECV%8QUOTE%CHR;
; 4556 2
; 4557 2 IF .SEND%8QUOTE%CHR NEQ %C'N' AND .SEND%8QUOTE%CHR NEQ %C'Y'
; 4558 2 THEN
; 4559 2 FLAG%8QUOTE = TRUE
; 4560 2 ELSE
; 4561 2 FLAG%8QUOTE = FALSE;
; 4562 2
; 4563 2 !
; 4564 2 ! Check the repeat character and set flags
; 4565 2 !
; 4566 2
; 4567 5 IF ( NOT ((.REPT%CHR GEQ %O'41' AND .REPT%CHR LEQ %O'76') OR(.REPT%CHR GEQ %O'140' AND
; 4568 3 .REPT%CHR LEQ %O'176')) OR .REPT%CHR EQL .SEND%QUOTE%CHR OR .REPT%CHR EQL .SEND%8QUOTE%CHR
; 4569 2 OR .REPT%CHR EQL .RCV%QUOTE%CHR) AND .REPT%CHR NEQ %C' '
; 4570 2 THEN
; 4571 3 BEGIN
; 4572 3 KRM%ERROR (KER%PROTOERR);
; 4573 3 RETURN KER%PROTOERR;
; 4574 2 END;
; 4575 2
; 4576 2 IF .REPT%CHR NEQ %C' ' THEN FLAG%REPEAT = TRUE ELSE FLAG%REPEAT = FALSE;
; 4577 2
; 4578 2 RETURN KER%NORMAL;
; 4579 1 END; ! End of PRS%SEND%INIT
; PRS%SEND%INIT
U.21: MOVE AC4,SND%PKT%SIZE ; 4352
JUMPL AC4,L.263
CAIG AC4,136 ; 4353
JRST L.262
MOVEI AC1,136
JRST L.265
L.262: MOVE AC1,AC4
JRST L.265 ; 4352
L.263: SKIPG U.57 ; 4356
JRST L.264
MOVE AC2,C.27 ; 4359
MOVE AC1,U.39
ADJBP AC1,AC2
ILDB AC1,AC1
SUBI AC1,40
JRST L.265 ; 4354
L.264: MOVM AC1,AC4 ; 4361
L.265: MOVEM AC1,U.40 ; 4352
MOVE AC1,SND%TIMEOUT ; 4368
JUMPGE AC1,L.267
MOVEI AC2,1 ; 4371
CAML AC2,U.57
JRST L.266
MOVE AC1,U.39 ; 4374
ADDI AC1,1
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
SUBI AC1,40
JRST L.267 ; 4369
L.266: MOVM AC1,AC1 ; 4376
L.267: MOVEM AC1,SEND%TIMEOUT ; 4368
MOVE AC1,SND%NPAD ; 4383
JUMPGE AC1,L.269
MOVEI AC2,2 ; 4386
CAML AC2,U.57
JRST L.268
MOVE AC1,U.39 ; 4389
ADDI AC1,2
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
SUBI AC1,40
JRST L.269 ; 4384
L.268: MOVM AC1,AC1 ; 4391
L.269: MOVEM AC1,U.41 ; 4383
MOVE AC1,SND%PADCHAR ; 4398
JUMPGE AC1,L.271
MOVEI AC2,3 ; 4401
CAML AC2,U.57
JRST L.270
MOVE AC1,U.39 ; 4404
ADDI AC1,3
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
TRCA AC1,100
L.270: MOVM AC1,AC1 ; 4406
L.271: MOVEM AC1,U.42 ; 4398
MOVE AC1,SND%EOL ; 4413
JUMPGE AC1,L.273
MOVEI AC2,4 ; 4416
CAML AC2,U.57
JRST L.272
MOVE AC1,U.39 ; 4419
ADDI AC1,4
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
SUBI AC1,40
JRST L.273 ; 4414
L.272: MOVM AC1,AC1 ; 4421
L.273: MOVEM AC1,U.43 ; 4413
MOVE AC1,SND%QUOTE%CHR ; 4428
JUMPGE AC1,L.275
MOVEI AC2,5 ; 4431
CAML AC2,U.57
JRST L.274
MOVE AC1,U.39 ; 4433
ADDI AC1,5
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
JRST L.275 ; 4429
L.274: MOVM AC1,AC1 ; 4436
L.275: MOVEM AC1,U.44 ; 4428
MOVE AC3,U.57 ; 4446
CAIG AC3,6
JRST L.276
MOVE AC1,U.39 ; 4447
ADDI AC1,6
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
JRST L.277 ; 4446
L.276: MOVEI AC1,116
L.277: MOVEM AC1,U.45
CAIG AC3,7 ; 4453
JRST L.280
MOVE AC1,U.39 ; 4460
ADDI AC1,7
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
MOVEI AC2,131 ; 4463
CAMN AC2,U.58
JRST L.278
CAIL AC1,61 ; 4466
CAILE AC1,63
JRST L.279
JRST L.281
L.278: CAMN AC1,CHKTYPE ; 4474
JRST L.281
L.279: MOVEI AC2,61 ; 4476
MOVEM AC2,U.47
JRST L.282 ; 4474
L.280: MOVEI AC1,61 ; 4482
L.281: MOVEM AC1,U.47
L.282: CAIG AC3,10 ; 4487
JRST L.283
MOVE AC1,U.39 ; 4488
ADDI AC1,10
MOVE AC2,C.27
ADJBP AC1,AC2
ILDB AC1,AC1
JRST L.284 ; 4487
L.283: MOVEI AC1,40
L.284: MOVEM AC1,U.38
CAIG AC3,11 ; 4493
JRST L.289
MOVM AC1,AC4
CAIG AC1,136
JRST L.289
MOVE AC1,U.39 ; 4500
ADDI AC1,11
MOVE AC5,C.27 ; 4502
MOVE AC2,AC1
ADJBP AC2,AC5
ILDB AC2,AC2
SUBI AC2,40
TRNN AC2,2
JRST L.289
MOVEI AC2,764 ; 4506
MOVEM AC2,U.40
L.285: MOVE AC2,AC1 ; 4508
SUB AC2,U.39
CAMG AC3,AC2
JRST L.286
MOVE AC5,C.27 ; 4510
MOVE AC2,AC1
ADJBP AC2,AC5
ILDB AC2,AC2
SUBI AC2,40
TRNE AC2,1 ; 4509
AOJA AC1,L.285 ; 4508
L.286: MOVE AC2,AC1 ; 4514
SUB AC2,U.39
ADDI AC2,3
CAMG AC3,AC2
JRST L.287
MOVE AC2,AC1 ; 4517
ADDI AC2,2
MOVE AC3,C.27
ADJBP AC2,AC3
ILDB AC2,AC2
IMULI AC2,137
ADDI AC1,3 ; 4519
MOVE AC3,C.27
ADJBP AC1,AC3
ILDB AC1,AC1
ADD AC2,AC1 ; 4517
SUBI AC2,6000
MOVEM AC2,U.40
L.287: MOVEI AC1,1750 ; 4520
CAML AC1,U.40
JRST L.288
MOVEI AC1,1750 ; 4522
MOVEM AC1,U.40
L.288: MOVM AC1,AC4 ; 4523
CAMGE AC1,U.40
MOVEM AC1,U.40 ; 4525
L.289: MOVE AC1,U.44 ; 4533
CAIGE AC1,41
JRST L.290
CAIG AC1,76
JRST L.291
L.290: CAIL AC1,140
CAILE AC1,176 ; 4534
JRST L.301 ; 4536
L.291: MOVE AC1,U.45 ; 4545
CAIGE AC1,41
JRST L.292
CAIG AC1,76
JRST L.294
L.292: CAIGE AC1,140 ; 4546
JRST L.293
CAIG AC1,176
JRST L.294
L.293: CAIN AC1,116
JRST L.294
CAIE AC1,131
JRST L.301
L.294: CAME AC1,U.44 ; 4547
CAMN AC1,RCV%QUOTE%CHR ; 4548
JRST L.301 ; 4550
MOVEI AC1,131 ; 4555
CAME AC1,U.45
JRST L.295
MOVE AC1,U.37
MOVEM AC1,U.45
L.295: MOVE AC2,U.45 ; 4557
CAIE AC2,116
CAIN AC2,131
JRST L.296
MOVEI AC1,1 ; 4559
MOVEM AC1,U.49
JRST L.297 ; 4557
L.296: SETZM U.49 ; 4561
L.297: MOVE AC1,U.38 ; 4567
CAIGE AC1,41
JRST L.298
CAIG AC1,76
JRST L.299
L.298: CAIL AC1,140
CAILE AC1,176 ; 4568
JRST L.300
L.299: CAME AC1,U.44
CAMN AC1,AC2
JRST L.300
CAME AC1,RCV%QUOTE%CHR ; 4569
JRST L.302
L.300: CAIN AC1,40
JRST L.302
L.301: PUSH SP,C.21 ; 4572
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 4573
MOVEI AC1,252 ; 4571
POPJ SP,
L.302: MOVEI AC1,40 ; 4576
CAMN AC1,U.38
JRST L.303
MOVEI AC1,1
MOVEM AC1,U.50
JRST L.304
L.303: SETZM U.50
L.304: MOVEI AC1,13 ; 4340
POPJ SP, ; 4302
; Routine Size: 247 words
; 4580 1 %SBTTL 'SET%SEND%INIT'
; 4581 1 ROUTINE SET%SEND%INIT : NOVALUE =
; 4582 1
; 4583 1 !++
; 4584 1 ! FUNCTIONAL DESCRIPTION:
; 4585 1 !
; 4586 1 ! This routine will initialize the various parameters for the
; 4587 1 ! MSG%SND%INIT message.
; 4588 1 !
; 4589 1 ! CALLING SEQUENCE:
; 4590 1 !
; 4591 1 ! SET%SEND%INIT();
; 4592 1 !
; 4593 1 ! INPUT PARAMETERS:
; 4594 1 !
; 4595 1 ! None.
; 4596 1 !
; 4597 1 ! IMPLICIT INPUTS:
; 4598 1 !
; 4599 1 ! None.
; 4600 1 !
; 4601 1 ! OUTPUT PARAMETERS:
; 4602 1 !
; 4603 1 ! None.
; 4604 1 !
; 4605 1 ! IMPLICIT OUTPUTS:
; 4606 1 !
; 4607 1 ! SND%MSG parameters set up.
; 4608 1 !
; 4609 1 ! COMPLETION CODES:
; 4610 1 !
; 4611 1 ! None.
; 4612 1 !
; 4613 1 ! SIDE EFFECTS:
; 4614 1 !
; 4615 1 ! None.
; 4616 1 !
; 4617 1 !--
; 4618 1
; 4619 2 BEGIN
; 4620 2 CH$WCHAR (CHAR ((IF .RCV%PKT%SIZE LSS 94 THEN .RCV%PKT%SIZE ELSE 94)),
; 4621 2 CH$PTR (SND%MSG, PKT%MSG + P%SI%BUFSIZ, CHR%SIZE)); ! [108]
; 4622 2 CH$WCHAR (CHAR (.RCV%TIMEOUT), CH$PTR (SND%MSG, PKT%MSG + P%SI%TIMOUT, CHR%SIZE));
; 4623 2 CH$WCHAR (CHAR (.RCV%NPAD), CH$PTR (SND%MSG, PKT%MSG + P%SI%NPAD, CHR%SIZE));
; 4624 2 CH$WCHAR (CTL (.RCV%PADCHAR), CH$PTR (SND%MSG, PKT%MSG + P%SI%PAD, CHR%SIZE));
; 4625 2 CH$WCHAR (CHAR (.RCV%EOL), CH$PTR (SND%MSG, PKT%MSG + P%SI%EOL, CHR%SIZE));
; 4626 2 CH$WCHAR (.RCV%QUOTE%CHR, CH$PTR (SND%MSG, PKT%MSG + P%SI%QUOTE, CHR%SIZE));
; 4627 2 CH$WCHAR (.SEND%8QUOTE%CHR, CH$PTR (SND%MSG, PKT%MSG + P%SI%8QUOTE, CHR%SIZE));
; 4628 2 CH$WCHAR (.INI%CHK%TYPE, CH$PTR (SND%MSG, PKT%MSG + P%SI%CHKTYPE, CHR%SIZE));
; 4629 2 CH$WCHAR (.REPT%CHR, CH$PTR (SND%MSG, PKT%MSG + P%SI%REPEAT, CHR%SIZE));
; 4630 2 SEND%INIT%SIZE = P%SI%LENGTH; ! [108]
; 4631 2 IF .RCV%PKT%SIZE GTR 94 ! [108]
; 4632 2 THEN ! [108]
; 4633 3 BEGIN ! [108]
; 4634 3 CH$WCHAR (CHAR (EXTLEN%CAPAS), CH$PTR (SND%MSG, PKT%MSG + P%SI%CAPAS, CHR%SIZE));
; 4635 3 CH$WCHAR (CHAR (0), CH$PTR (SND%MSG, PKT%MSG + P%SI%WINDO, CHR%SIZE));
; 4636 3 CH$WCHAR (CHAR (.RCV%PKT%SIZE/95), CH$PTR (SND%MSG, PKT%MSG + P%SI%MAXLX1, CHR%SIZE));
; 4637 3 CH$WCHAR (CHAR (.RCV%PKT%SIZE MOD 95), CH$PTR (SND%MSG, PKT%MSG + P%SI%MAXLX2, CHR%SIZE));
; 4638 3 ! [108]
; 4639 3 SEND%INIT%SIZE = P%SI%XLENGTH; ! [108]
; 4640 2 END; ! [108]
; 4641 2
; 4642 1 END; ! End of SET%SEND%INIT
; SET%SEND%INIT
U.20: MOVE AC3,RCV%PKT%SIZE ; 4620
CAIGE AC3,136
SKIPA AC1,AC3
MOVEI AC1,136
ADDI AC1,40
MOVE AC2,C.32 ; 4621
IDPB AC1,AC2 ; 4620
MOVE AC2,RCV%TIMEOUT ; 4622
ADDI AC2,40
MOVE AC1,C.64
IDPB AC2,AC1
MOVE AC2,RCV%NPAD ; 4623
ADDI AC2,40
MOVE AC1,C.65
IDPB AC2,AC1
MOVE AC2,RCV%PADCHAR ; 4624
TRC AC2,100
MOVE AC1,C.66
IDPB AC2,AC1
MOVE AC2,RCV%EOL ; 4625
ADDI AC2,40
MOVE AC1,C.67
IDPB AC2,AC1
MOVE AC2,RCV%QUOTE%CHR ; 4626
MOVE AC1,C.68
IDPB AC2,AC1
MOVE AC2,U.45 ; 4627
MOVE AC1,C.69
IDPB AC2,AC1
MOVE AC2,U.47 ; 4628
MOVE AC1,C.70
IDPB AC2,AC1
MOVE AC2,U.38 ; 4629
MOVE AC1,C.71
IDPB AC2,AC1
MOVEI AC1,11 ; 4630
MOVEM AC1,U.46
CAIG AC3,136 ; 4631
POPJ SP,
MOVEI AC2,42 ; 4634
MOVE AC1,C.72
IDPB AC2,AC1
MOVEI AC2,40 ; 4635
MOVE AC1,C.73
IDPB AC2,AC1
MOVE AC1,AC3 ; 4636
IDIVI AC1,137
ADDI AC1,40
MOVE AC2,C.74
IDPB AC1,AC2
MOVE AC1,AC3 ; 4637
IDIVI AC1,137
ADDI AC2,40
MOVE AC1,C.75
IDPB AC2,AC1
MOVEI AC1,15 ; 4639
MOVEM AC1,U.46
POPJ SP, ; 4581
C.64: POINT 8,U.60+1,7
C.65: POINT 8,U.60+1,15
C.66: POINT 8,U.60+1,23
C.67: POINT 8,U.60+1,31
C.68: POINT 8,U.60+2,7
C.69: POINT 8,U.60+2,15
C.70: POINT 8,U.60+2,23
C.71: POINT 8,U.60+2,31
C.72: POINT 8,U.60+3,7
C.73: POINT 8,U.60+3,15
C.74: POINT 8,U.60+3,23
C.75: POINT 8,U.60+3,31
; Routine Size: 70 words
; 4643 1 %SBTTL 'SEND%PACKET'
; 4644 1 ROUTINE SEND%PACKET (TYPE, LENGTH, MN) =
; 4645 1
; 4646 1 !++
; 4647 1 ! FUNCTIONAL DESCRIPTION:
; 4648 1 !
; 4649 1 ! This routine will cause a packet to be sent over the line
; 4650 1 ! that has been opened by OPEN%TERMINAL.
; 4651 1 !
; 4652 1 ! CALLING SEQUENCE:
; 4653 1 !
; 4654 1 ! SEND%PACKET(Type, Length);
; 4655 1 !
; 4656 1 ! INPUT PARAMETERS:
; 4657 1 !
; 4658 1 ! TYPE - Type of packet to send.
; 4659 1 !
; 4660 1 ! LENGTH - Length of the packet being sent.
; 4661 1 ! [108] Negative length means it's an extended length packet
; 4662 1 !
; 4663 1 ! IMPLICIT INPUTS:
; 4664 1 !
; 4665 1 ! None.
; 4666 1 !
; 4667 1 ! OUTPUT PARAMETERS:
; 4668 1 !
; 4669 1 ! None.
; 4670 1 !
; 4671 1 ! IMPLICIT OUTPUTS:
; 4672 1 !
; 4673 1 ! None.
; 4674 1 !
; 4675 1 ! COMPLETION CODES:
; 4676 1 !
; 4677 1 ! None.
; 4678 1 !
; 4679 1 ! SIDE EFFECTS:
; 4680 1 !
; 4681 1 ! None.
; 4682 1 !
; 4683 1 !--
; 4684 1
; 4685 2 BEGIN
; 4686 2
; 4687 2 LOCAL
; 4688 2 FILLER : VECTOR [CH$ALLOCATION (MAX%MSG, CHR%SIZE)],
; 4689 2 TOT%MSG%LEN, ! Length of message including all characters
; 4690 2 CHKSUM, ! Checksum for the message we calculate
; 4691 2 POINTER; ! Pointer to the information in the message
; 4692 2
; 4693 2 !
; 4694 2 ! Do any filler processing that the remote KERMIT requires.
; 4695 2 !
; 4696 2
; 4697 2 IF .SEND%NPAD NEQ 0
; 4698 2 THEN
; 4699 3 BEGIN
; 4700 3 CH$FILL (.SEND%PADCHAR, MAX%MSG, CH$PTR (FILLER, 0, CHR%SIZE));
; 4701 3 !
; 4702 3 ! Update the send stats
; 4703 3 !
; 4704 3 SMSG%TOTAL%CHARS = .SMSG%TOTAL%CHARS + .SEND%NPAD;
; 4705 3 !
; 4706 3 ! Send the fill
; 4707 3 !
; 4708 3 DO%PARITY (FILLER, .SEND%NPAD + PKT%TOT%OVR%HEAD);
; 4709 3 SEND (FILLER, .SEND%NPAD + PKT%TOT%OVR%HEAD);
; 4710 2 END;
; 4711 2
; 4712 2 !
; 4713 2 ! Store the header information into the message.
; 4714 2 !
; 4715 2 CH$WCHAR (.TYPE, CH$PTR (SND%MSG, PKT%TYPE, CHR%SIZE));
; 4716 2 CH$WCHAR (.SND%SOH, CH$PTR (SND%MSG, PKT%MARK, CHR%SIZE));
; 4717 2 CH$WCHAR (CHAR (IF .MN LSS 0 THEN 0 ELSE .MN), CH$PTR (SND%MSG, PKT%SEQ, CHR%SIZE));
; 4718 2
; 4719 2 IF .LENGTH LSS 0 ! [108]
; 4720 2 THEN ! [108]
; 4721 3 BEGIN ! [108]
; 4722 3 TOT%MSG%LEN = PKT%OVR%HEAD + 3 - .LENGTH; ! [108]
; 4723 3 CH$WCHAR (CHAR (0), CH$PTR (SND%MSG, PKT%COUNT, CHR%SIZE)); ! [108]
; P 4724 3 CH$WCHAR (CHAR ((.TOT%MSG%LEN - PKT%HCHECK + 1 + ! [108]
; 4725 3 (.BLK%CHK%TYPE - CHK%1CHAR)) / 95), ! [108]
; 4726 3 CH$PTR (SND%MSG, PKT%COUNTX1, CHR%SIZE)); ! [108]
; P 4727 3 CH$WCHAR (CHAR ((.TOT%MSG%LEN - PKT%HCHECK + 1 + ! [108]
; 4728 3 (.BLK%CHK%TYPE - CHK%1CHAR)) MOD 95), ! [108]
; 4729 3 CH$PTR (SND%MSG, PKT%COUNTX2, CHR%SIZE)); ! [108]
; 4730 3
; 4731 3 POINTER = CH$PTR(SND%MSG, PKT%SEQ, CHR%SIZE); ! [108]
; 4732 3 CHKSUM = CHAR (0) + CH$RCHAR%A (POINTER); ! [108]
; 4733 3 CHKSUM = .CHKSUM + CH$RCHAR%A (POINTER); ! [108]
; 4734 3 CHKSUM = .CHKSUM + CH$RCHAR%A (POINTER); ! [108]
; 4735 3 CHKSUM = .CHKSUM + CH$RCHAR%A (POINTER); ! [108]
; 4736 3
; 4737 3 CH$WCHAR (CHAR ((.CHKSUM + ((.CHKSUM AND %O'300')/%O'100')) AND %O'77'),
; 4738 3 CH$PTR (SND%MSG, PKT%HCHECK, CHR%SIZE)); ! [108]
; 4739 3 END ! [108]
; 4740 2 ELSE ! [108]
; 4741 3 BEGIN ! [108]
; 4742 3 TOT%MSG%LEN = PKT%OVR%HEAD + .LENGTH; ! [108]
; 4743 3 CH$WCHAR (CHAR (.TOT%MSG%LEN + (.BLK%CHK%TYPE - CHK%1CHAR)), ! [108]
; 4744 3 CH$PTR (SND%MSG, PKT%COUNT, CHR%SIZE));
; 4745 2 END; ! [108]
; 4746 2
; 4747 2 !
; 4748 2 ! Calculate the block check value
; 4749 2 !
; 4750 2 POINTER = CH$PTR (SND%MSG, PKT%MARK + 1, CHR%SIZE);
; 4751 2 CHKSUM = CALC%BLOCK%CHECK (.POINTER, .TOT%MSG%LEN); ! [108]
; 4752 2 !
; 4753 2 ! Store the checksum into the message
; 4754 2 !
; 4755 2 POINTER = CH$PTR (SND%MSG, .TOT%MSG%LEN + 1, CHR%SIZE); ! [108]
; 4756 2
; 4757 2 CASE .BLK%CHK%TYPE FROM CHK%1CHAR TO CHK%CRC OF
; 4758 2 SET
; 4759 2
; 4760 2 [CHK%1CHAR] :
; 4761 2 CH$WCHAR%A (CHAR (.CHKSUM), POINTER);
; 4762 2
; 4763 2 [CHK%2CHAR] :
; 4764 3 BEGIN
; 4765 3 CH$WCHAR%A (CHAR (.CHKSUM<6, 6>), POINTER);
; 4766 3 CH$WCHAR%A (CHAR (.CHKSUM<0, 6>), POINTER);
; 4767 3 TOT%MSG%LEN = .TOT%MSG%LEN + 1;
; 4768 2 END;
; 4769 2
; 4770 2 [CHK%CRC] :
; 4771 3 BEGIN
; 4772 3 CH$WCHAR%A (CHAR (.CHKSUM<12, 4>), POINTER);
; 4773 3 CH$WCHAR%A (CHAR (.CHKSUM<6, 6>), POINTER);
; 4774 3 CH$WCHAR%A (CHAR (.CHKSUM<0, 6>), POINTER);
; 4775 3 TOT%MSG%LEN = .TOT%MSG%LEN + 2;
; 4776 2 END;
; 4777 2 TES;
; 4778 2
; 4779 2 !
; 4780 2 ! Store in the end of line character
; 4781 2 !
; 4782 2 CH$WCHAR%A (.SEND%EOL, POINTER);
; 4783 2 !
; 4784 2 ! If we are debugging then type out the message we are sending.
; 4785 2 !
; 4786 2 DBG%SEND (SND%MSG, (.TOT%MSG%LEN + PKT%TOT%OVR%HEAD - PKT%OVR%HEAD));
; 4787 2 !
; 4788 2 ! Update the stats for total characters and the data characters
; 4789 2 !
; 4790 2 SMSG%TOTAL%CHARS = .SMSG%TOTAL%CHARS + .TOT%MSG%LEN + PKT%TOT%OVR%HEAD - PKT%OVR%HEAD;
; 4791 2 ! Make data characters really be that, not just characters in data field
; 4792 2 ! SMSG%DATA%CHARS = .SMSG%DATA%CHARS + .LENGTH;
; 4793 2
; 4794 2 IF .TYPE EQL MSG%NAK
; 4795 2 THEN
; 4796 3 BEGIN
; 4797 3 SMSG%NAKS = .SMSG%NAKS + 1;
; 4798 3 XFR%STATUS (%C'S', %C'N');
; 4799 3 END
; 4800 2 ELSE
; 4801 3 BEGIN
; 4802 3 SMSG%COUNT = .SMSG%COUNT + 1;
; 4803 3 XFR%STATUS (%C'S', %C'P');
; 4804 2 END;
; 4805 2
; 4806 2 !
; 4807 2 ! Check if we are in IBM mode and need to wait for an XON first
; 4808 2 ! We will not wait if this is a packet which might be going out
; 4809 2 ! without previous traffic (generic commands, init packets).
; 4810 2
; 4811 3 IF (.IBM%CHAR GEQ 0) ! If handshaking on
; 4812 2 THEN
; 4813 2 IF NOT IBM%WAIT () THEN RETURN KER%ABORTED;
; 4814 2
; 4815 2 !
; 4816 2 ! Now call the O/S routine to send the message out to the remote KERMIT
; 4817 2 !
; 4818 2 DO%PARITY (SND%MSG, .TOT%MSG%LEN + PKT%TOT%OVR%HEAD - PKT%OVR%HEAD);
; 4819 2 RETURN SEND (SND%MSG, .TOT%MSG%LEN + PKT%TOT%OVR%HEAD - PKT%OVR%HEAD);
; 4820 1 END; ! End of SEND%PACKET
; SEND%PACKET
U.24: PUSH SP,AC14 ; 4644
PUSH SP,AC16
ADJSP SP,375
MOVE AC3,U.41 ; 4697
JUMPE AC3,L.305
MOVEI AC5,-375(SP) ; 4700
HRLI AC5,41000
SETZB AC1,AC2
MOVEI AC4,1752
MOVEI AC14,-2(SP)
PUSH AC14,C.9
PUSH AC14,U.42
EXTEND AC1,-1(SP)
JFCL
ADDM AC3,SMSG%TOTAL%CHARS ; 4704
MOVEI AC1,-374(SP) ; 4708
PUSH SP,AC1
ADDI AC3,6
PUSH SP,AC3
PUSHJ SP,U.22
MOVEI AC1,-376(SP) ; 4709
PUSH SP,AC1
MOVE AC1,U.41
ADDI AC1,6
PUSH SP,AC1
PUSHJ SP,SEND
ADJSP SP,-4 ; 4699
L.305: MOVE AC2,-402(SP) ; 4715
MOVE AC1,C.80
IDPB AC2,AC1
MOVE AC2,SND%SOH ; 4716
MOVE AC1,C.81
IDPB AC2,AC1
SKIPGE AC1,-400(SP) ; 4717
SETZ AC1,
ADDI AC1,40
MOVE AC2,C.82
IDPB AC1,AC2
MOVE AC3,U.48 ; 4725
SUBI AC3,61
MOVE AC16,-401(SP) ; 4719
JUMPGE AC16,L.306
MOVEI AC14,6 ; 4722
SUB AC14,AC16
MOVEI AC2,40 ; 4723
MOVE AC1,C.83
IDPB AC2,AC1
MOVE AC16,AC14 ; 4725
ADD AC16,AC3
SUBI AC16,5
MOVE AC1,AC16
IDIVI AC1,137
ADDI AC1,40
MOVE AC2,C.32 ; 4726
IDPB AC1,AC2 ; 4725
MOVE AC1,AC16 ; 4728
IDIVI AC1,137
ADDI AC2,40
MOVE AC1,C.64 ; 4729
IDPB AC2,AC1 ; 4728
MOVE AC16,C.82 ; 4731
ILDB AC1,AC16 ; 4732
MOVE AC3,AC1
ADDI AC3,40
ILDB AC1,AC16 ; 4733
ADD AC3,AC1
ILDB AC1,AC16 ; 4734
ADD AC3,AC1
ILDB AC1,AC16 ; 4735
ADD AC3,AC1
MOVE AC1,AC3 ; 4737
ANDI AC1,300
IDIVI AC1,100
ADD AC1,AC3
LDB AC2,C.18
ADDI AC2,40
MOVE AC1,C.65 ; 4738
IDPB AC2,AC1 ; 4737
JRST L.307 ; 4719
L.306: MOVE AC14,AC16 ; 4742
ADDI AC14,3
MOVE AC16,AC14 ; 4743
ADD AC16,AC3
ADDI AC16,40
MOVE AC1,C.83 ; 4744
IDPB AC16,AC1 ; 4743
L.307: MOVE AC16,C.83 ; 4750
PUSH SP,AC16 ; 4751
PUSH SP,AC14
PUSHJ SP,U.19
MOVE AC3,AC1
MOVE AC1,AC14 ; 4755
ADDI AC1,1
MOVE AC2,C.76
ADJBP AC1,AC2
MOVE AC16,AC1
MOVE AC1,U.48 ; 4757
SUBI AC1,61
JRST L.308(AC1)
L.308: JRST L.309
JRST L.310
JRST L.311
L.309: MOVE AC1,AC3 ; 4761
ADDI AC1,40
IDPB AC1,AC16
JRST L.312 ; 4757
L.310: LDB AC1,C.77 ; 4765
ADDI AC1,40
IDPB AC1,AC16
LDB AC1,C.78 ; 4766
ADDI AC1,40
IDPB AC1,AC16
AOJA AC14,L.312 ; 4757
L.311: LDB AC1,C.79 ; 4772
ADDI AC1,40
IDPB AC1,AC16
LDB AC1,C.77 ; 4773
ADDI AC1,40
IDPB AC1,AC16
LDB AC1,C.78 ; 4774
ADDI AC1,40
IDPB AC1,AC16
ADDI AC14,2 ; 4775
L.312: MOVE AC1,U.43 ; 4782
IDPB AC1,AC16
PUSH SP,C.84 ; 4786
MOVE AC16,AC14
ADDI AC16,3
PUSH SP,AC16
PUSHJ SP,U.35
MOVE AC1,SMSG%TOTAL%CHARS ; 4790
ADD AC1,AC14
ADDI AC1,3
MOVEM AC1,SMSG%TOTAL%CHARS
MOVEI AC1,116 ; 4794
CAME AC1,-406(SP)
JRST L.313
AOS SMSG%NAKS ; 4797
PUSH SP,C.8 ; 4798
PUSH SP,C.24
JRST L.314
L.313: AOS SMSG%COUNT ; 4802
PUSH SP,C.8 ; 4803
PUSH SP,C.85
L.314: PUSHJ SP,XFR%STATUS
SKIPGE IBM%CHAR ; 4811
JRST L.315
PUSHJ SP,IBM%WAIT ; 4813
TRNE AC1,1
JRST L.315
ADJSP SP,-6
MOVEI AC1,312
JRST L.316
L.315: PUSH SP,C.84 ; 4818
PUSH SP,AC16
PUSHJ SP,U.22
PUSH SP,C.84 ; 4819
PUSH SP,AC16
PUSHJ SP,SEND
ADJSP SP,-12
L.316: ADJSP SP,-375 ; 4644
POP SP,AC16
POP SP,AC14
POPJ SP,
C.76: POINT 8,U.60,-1
C.77: POINT 6,AC3,29
C.78: POINT 6,AC3,35
C.79: POINT 4,AC3,23
C.80: POINT 8,U.60,23
C.81: POINT 8,U.60-1,31
C.82: POINT 8,U.60,15
C.83: POINT 8,U.60,7
C.84: XWD 0,U.60
C.85: EXP 120
; Routine Size: 174 words
; 4821 1 %SBTTL 'REC%MESSAGE - Receive a message'
; 4822 1 ROUTINE REC%MESSAGE (CHK%ROUTINE) =
; 4823 1
; 4824 1 !++
; 4825 1 ! FUNCTIONAL DESCRIPTION:
; 4826 1 !
; 4827 1 ! This routine will handle the retry processing for the various
; 4828 1 ! messages that can be received.
; 4829 1 !
; 4830 1 ! CALLING SEQUENCE:
; 4831 1 !
; 4832 1 ! INPUT PARAMETERS:
; 4833 1 !
; 4834 1 ! None.
; 4835 1 !
; 4836 1 ! IMPLICIT INPUTS:
; 4837 1 !
; 4838 1 ! None.
; 4839 1 !
; 4840 1 ! OUTPUT PARAMETERS:
; 4841 1 !
; 4842 1 ! None.
; 4843 1 !
; 4844 1 ! IMPLICIT OUTPUTS:
; 4845 1 !
; 4846 1 ! None.
; 4847 1 !
; 4848 1 ! COMPLETION CODES:
; 4849 1 !
; 4850 1 ! KER%NORMAL - Normal return
; 4851 1 ! KER%RETRIES - Too many retries
; 4852 1 ! (What ever REC%PACKET returns).
; 4853 1 !
; 4854 1 ! SIDE EFFECTS:
; 4855 1 !
; 4856 1 ! None.
; 4857 1 !
; 4858 1 !--
; 4859 1
; 4860 2 BEGIN
; 4861 2
; 4862 2 LOCAL
; 4863 2 STATUS; ! Status returned by various routines
; 4864 2
; 4865 2 RETURN
; 4866 2
; 4867 2 WHILE TRUE DO
; 4868 3 BEGIN
; 4869 3
; 4870 3 IF .NUM%RETRIES GTR .PKT%RETRIES
; 4871 3 THEN
; 4872 4 BEGIN
; 4873 4 KRM%ERROR (KER%RETRIES); ! Report the error
; 4874 4 RETURN KER%RETRIES;
; 4875 3 END;
; 4876 3
; 4877 3 NUM%RETRIES = .NUM%RETRIES + 1;
; 4878 3 STATUS = REC%PACKET ();
; 4879 3 ![043] Don't abort on errors which might just be due to noise.
; 4880 3
; 4881 3 IF NOT .STATUS AND .STATUS NEQ KER%CHKSUMERR AND .STATUS NEQ KER%TIMEOUT AND .STATUS NEQ
; 4882 3 KER%ZEROLENMSG
; 4883 3 THEN
; 4884 3 RETURN .STATUS;
; 4885 3
; 4886 3 IF NOT .STATUS
; 4887 3 THEN
; 4888 3 SEND%PACKET (MSG%NAK, 0, .MSG%NUMBER) ![024]
; 4889 3 ELSE
; 4890 4 BEGIN
; 4891 4 ![021]
; 4892 4 ![021] If the packet type is not acceptable by our caller, nak it so the
; 4893 4 ![021] other end tries again, and abort the current operation. This is so
; 4894 4 ![021] we will return to server mode (if we are running that way) quickly
; 4895 4 ![021] when the other Kermit has been aborted and then restarted, and should
; 4896 4 ![021] also make restarting quick, since we will not need to wait for the
; 4897 4 ![021] other Kermit to time this message out before retransmitting.
; 4898 4 ![021]
; 4899 4
; 4900 4 IF NOT (.CHK%ROUTINE) ()
; 4901 4 THEN
; 4902 5 BEGIN
; 4903 5 SEND%PACKET (MSG%NAK, 0, .REC%SEQ);
; 4904 5 RETURN FALSE; ! Just indicate an error
; 4905 5 END
; 4906 4 ELSE
; 4907 4 EXITLOOP KER%NORMAL;
; 4908 4
; 4909 3 END;
; 4910 3
; 4911 2 END;
; 4912 2
; 4913 1 END; ! End of REC%PARSE
; REC%MESSAGE
U.25: PUSH SP,AC16 ; 4822
L.317: MOVE AC1,U.54 ; 4870
CAMG AC1,PKT%RETRIES
JRST L.318
PUSH SP,C.17 ; 4873
PUSHJ SP,KRM%ERROR
ADJSP SP,-1 ; 4874
MOVEI AC1,212 ; 4872
JRST L.322
L.318: AOS U.54 ; 4877
PUSHJ SP,U.26 ; 4878
MOVE AC16,AC1
TRNN AC16,1 ; 4881
CAIN AC16,172
JRST L.319
CAIE AC16,300
CAIN AC16,262
JRST L.319
MOVE AC1,AC16 ; 4884
JRST L.322
L.319: TRNE AC16,1 ; 4886
JRST L.320
PUSH SP,C.24 ; 4888
PUSH SP,C.25
PUSH SP,U.55
PUSHJ SP,U.24
ADJSP SP,-3
JRST L.317 ; 4886
L.320: MOVE AC1,-2(SP) ; 4900
PUSHJ SP,0(AC1)
TRNE AC1,1
JRST L.321
PUSH SP,C.24 ; 4903
PUSH SP,C.25
PUSH SP,U.56
PUSHJ SP,U.24
ADJSP SP,-3 ; 4904
TDZA AC1,AC1 ; 4902
L.321: MOVEI AC1,13 ; 4907
L.322: POP SP,AC16 ; 4822
POPJ SP,
; Routine Size: 41 words
; 4914 1 %SBTTL 'REC%PACKET'
; 4915 1 ROUTINE REC%PACKET =
; 4916 1
; 4917 1 !++
; 4918 1 ! FUNCTIONAL DESCRIPTION:
; 4919 1 !
; 4920 1 ! This routine will do the oppoiste of SEND%PACKET. It will wait
; 4921 1 ! for the message to be read from the remote and then it will
; 4922 1 ! check the message for validity.
; 4923 1 !
; 4924 1 ! CALLING SEQUENCE:
; 4925 1 !
; 4926 1 ! Flag = REC%PACKET();
; 4927 1 !
; 4928 1 ! INPUT PARAMETERS:
; 4929 1 !
; 4930 1 ! None.
; 4931 1 !
; 4932 1 ! IMPLICIT INPUTS:
; 4933 1 !
; 4934 1 ! None.
; 4935 1 !
; 4936 1 ! OUTPUT PARAMETERS:
; 4937 1 !
; 4938 1 ! None.
; 4939 1 !
; 4940 1 ! IMPLICIT OUTPUTS:
; 4941 1 !
; 4942 1 ! REC%MSG - Contains the message received.
; 4943 1 !
; 4944 1 ! COMPLETION CODES:
; 4945 1 !
; 4946 1 ! True - Packet receive ok.
; 4947 1 ! False - Problem occured during the receiving of the packet.
; 4948 1 !
; 4949 1 ! SIDE EFFECTS:
; 4950 1 !
; 4951 1 ! None.
; 4952 1 !
; 4953 1 !--
; 4954 1
; 4955 2 BEGIN
; 4956 2
; 4957 2 BIND
; 4958 2 ATTEMPT%TEXT = UPLIT (%ASCIZ'Attempting to receive');
; 4959 2
; 4960 2 LOCAL
; 4961 2 STATUS, ! Status returned by various routines
; 4962 2 MSG%LENGTH,
; 4963 2 ERR%POINTER, ! Pointer to the error buffer
; 4964 2 POINTER,
; 4965 2 CHKSUM; ! Checksum of the message
; 4966 2
; 4967 2 !
; 4968 2 ! Attempt to read the message from the remote.
; 4969 2 !
; 4970 2 ! DO
; 4971 2 ! BEGIN
; 4972 2
; 4973 2 IF .DEBUG%FLAG
; 4974 2 THEN
; 4975 3 BEGIN
; 4976 3
; 4977 3 LOCAL
; 4978 3 OLD%RTN;
; 4979 3
; 4980 3 OLD%RTN = TT%SET%OUTPUT (DBG%DUMP);
; 4981 3 TT%TEXT (ATTEMPT%TEXT);
; 4982 3 TT%CRLF ();
; 4983 3 TT%SET%OUTPUT (.OLD%RTN);
; 4984 2 END;
; 4985 2
; 4986 2 !
; 4987 2 ! If status type out requested, do it once
; 4988 2 !
; 4989 2
; 4990 2 IF .TYP%STS%FLAG
; 4991 2 THEN
; 4992 3 BEGIN
; 4993 3 STS%OUTPUT ();
; 4994 3 TYP%STS%FLAG = FALSE;
; 4995 2 END;
; 4996 2
; 4997 2 !
; 4998 2 ! Receive the message from the remote Kermit
; 4999 2 !
; 5000 2 STATUS = RECEIVE (REC%MSG, MSG%LENGTH);
; 5001 2 !
; 5002 2 ! Check for timeouts
; 5003 2 !
; 5004 2
; 5005 2 IF .STATUS EQL KER%TIMEOUT THEN XFR%STATUS (%C'R', %C'T');
; 5006 2
; 5007 2 !
; 5008 2 ! If it failed return the status to the upper level
; 5009 2 !
; 5010 2
; 5011 2 IF NOT .STATUS
; 5012 2 THEN
; 5013 3 BEGIN
; 5014 3
; 5015 3 IF .STATUS NEQ KER%ABORTED AND .STATUS NEQ KER%TIMEOUT THEN KRM%ERROR (.STATUS);
; 5016 3
; 5017 3 ! Report error
; 5018 3 RETURN .STATUS;
; 5019 2 END;
; 5020 2
; 5021 2 !
; 5022 2 ! Determine if we got a good message
; 5023 2 !
; 5024 2
; 5025 2 IF .MSG%LENGTH LSS PKT%TOT%OVR%HEAD - 1
; 5026 2 THEN
; 5027 3 BEGIN
; 5028 3 RETURN KER%ZEROLENMSG;
; 5029 2 END;
; 5030 2
; 5031 2 IF UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, PKT%COUNT, CHR%SIZE))) EQL 0 ! [108]
; 5032 2 THEN ! [108]
; 5033 3 BEGIN ! [108]
; 5034 3 IF .MSG%LENGTH LSS PKT%TOT%OVR%HEAD - 1 + 3 ! [108]
; 5035 3 THEN ! [108]
; 5036 4 BEGIN ! [108]
; 5037 4 RETURN KER%ZEROLENMSG; ! [108]
; 5038 3 END; ! [108]
; 5039 2 END; ! [108]
; 5040 2 !
; 5041 2 ! Update the stats on the total number of characters received.
; 5042 2 !
; 5043 2 RMSG%TOTAL%CHARS = .RMSG%TOTAL%CHARS + .MSG%LENGTH;
; 5044 2 !
; 5045 2 ! Initialize the checksum and others
; 5046 2 !
; 5047 2 REC%TYPE = CH$RCHAR (CH$PTR (REC%MSG, PKT%TYPE, CHR%SIZE));
; 5048 2 !
; 5049 2 ! Now break the message apart byte by byte.
; 5050 2 !
; 5051 2 RECV%PKT%MSG = PKT%MSG; ! [108]
; 5052 2 REC%LENGTH = UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, PKT%COUNT, CHR%SIZE)));
; 5053 2 IF .REC%LENGTH EQL 0 ! [108]
; 5054 2 THEN ! [108]
; 5055 3 BEGIN ! [108]
; 5056 3 REC%LENGTH = UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, PKT%COUNTX1, CHR%SIZE))) * 95 +
; 5057 3 UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, PKT%COUNTX2, CHR%SIZE))) +
; 5058 3 PKT%HCHECK - 1; ! [108]
; 5059 3 RECV%PKT%MSG = PKT%MSGX; ! [108]
; 5060 2 END; ! [108]
; 5061 2
; 5062 2 REC%SEQ = UNCHAR (CH$RCHAR (CH$PTR (REC%MSG, PKT%SEQ, CHR%SIZE)));
; 5063 2 !
; 5064 2 ! Typed the packet if we are debugging
; 5065 2 !
; 5066 2 DBG%RECEIVE (REC%MSG);
; 5067 2 !
; 5068 2 ! Now compute the final checksum and make sure that it is identical
; 5069 2 ! to what we received from the remote KERMIT
; 5070 2 !
; 5071 2 POINTER = CH$PTR (REC%MSG, PKT%MARK + 1, CHR%SIZE);
; 5072 2 REC%LENGTH = .REC%LENGTH - (.BLK%CHK%TYPE - CHK%1CHAR); ! [108]
; 5073 2 CHKSUM = CALC%BLOCK%CHECK (.POINTER, .REC%LENGTH); ! [108]
; 5074 2 POINTER = CH$PTR (REC%MSG, .REC%LENGTH + 1, CHR%SIZE); ! [108]
; 5075 2 REC%LENGTH = .REC%LENGTH - .RECV%PKT%MSG + 1; ! [108]
; 5076 2 STATUS = KER%NORMAL; ! Assume good checksum
; 5077 2
; 5078 2 CASE .BLK%CHK%TYPE FROM CHK%1CHAR TO CHK%CRC OF
; 5079 2 SET
; 5080 2
; 5081 2 [CHK%1CHAR] :
; 5082 2
; 5083 2 IF .CHKSUM NEQ UNCHAR (CH$RCHAR%A (POINTER)) THEN STATUS = KER%CHKSUMERR;
; 5084 2
; 5085 2 [CHK%2CHAR] :
; 5086 2
; P 5087 3 IF (.CHKSUM<6, 6> NEQ UNCHAR (CH$RCHAR%A (POINTER))) OR(.CHKSUM<0, 6> NEQ UNCHAR (
; 5088 3 CH$RCHAR%A (POINTER)))
; 5089 2 THEN
; 5090 2 STATUS = KER%CHKSUMERR;
; 5091 2
; 5092 2 [CHK%CRC] :
; 5093 2
; P 5094 3 IF (.CHKSUM<12, 4> NEQ UNCHAR (CH$RCHAR%A (POINTER))) OR(.CHKSUM<6, 6> NEQ UNCHAR (
; 5095 3 CH$RCHAR%A (POINTER))) OR (.CHKSUM<0, 6> NEQ UNCHAR(CH$RCHAR%A (POINTER)))
; 5096 2 THEN
; 5097 2 STATUS = KER%CHKSUMERR;
; 5098 2
; 5099 2 TES;
; 5100 2
; 5101 2 !
; 5102 2 ! If we have a bad checksum, check for the special cases when we might be out
; 5103 2 ! of sync with the sender. This can occur if the sender is retransmitting
; 5104 2 ! a send-init (because our ACK got lost), and we have agreed on multi-char
; 5105 2 ! checksums, or because the sender is a server who has aborted back to being
; 5106 2 ! idle without telling us.
; 5107 2 ! Note that in either case, we return back to using single character checksums
; 5108 2 !
; 5109 2
; 5110 2 IF .STATUS EQL KER%CHKSUMERR
; 5111 2 THEN
; 5112 3 BEGIN
; 5113 3
; 5114 5 IF (.BLK%CHK%TYPE NEQ CHK%1CHAR AND .REC%SEQ EQL 0) AND(.REC%LENGTH LSS 1 - (.BLK%CHK%TYPE
; 5115 4 - CHK%1CHAR) AND .REC%TYPE EQL MSG%NAK) OR (.REC%TYPE EQL MSG%SND%INIT)
; 5116 3 THEN
; 5117 4 BEGIN
; 5118 4
; 5119 4 LOCAL
; 5120 4 SAVE%BLK%CHK%TYPE;
; 5121 4
; 5122 4 SAVE%BLK%CHK%TYPE = .BLK%CHK%TYPE; ! Remember what we are using
; 5123 4 BLK%CHK%TYPE = CHK%1CHAR;
; 5124 4 POINTER = CH$PTR (REC%MSG, PKT%MARK + 1, CHR%SIZE);
; 5125 4 CHKSUM = CALC%BLOCK%CHECK (.POINTER, .REC%LENGTH + .RECV%PKT%MSG - 1); ! [108]
; 5126 4 POINTER = CH$PTR (REC%MSG, .REC%LENGTH + .RECV%PKT%MSG, CHR%SIZE); ! [108]
; 5127 4
; 5128 5 IF .CHKSUM NEQ UNCHAR (CH$RCHAR%A (POINTER))
; 5129 4 THEN
; 5130 5 BEGIN
; 5131 5 BLK%CHK%TYPE = .SAVE%BLK%CHK%TYPE;
; 5132 5 RETURN KER%CHKSUMERR;
; 5133 4 END;
; 5134 4
; 5135 4 END
; 5136 3 ELSE
; 5137 3 RETURN KER%CHKSUMERR;
; 5138 3
; 5139 2 END;
; 5140 2
; 5141 2 !
; 5142 2 ! Update the stats
; 5143 2 !
; 5144 2 ! RMSG%DATA%CHARS = .RMSG%DATA%CHARS + .REC%LENGTH;
; 5145 2
; 5146 2 IF .REC%TYPE EQL MSG%NAK
; 5147 2 THEN
; 5148 3 BEGIN
; 5149 3 RMSG%NAKS = .RMSG%NAKS + 1;
; 5150 3 XFR%STATUS (%C'R', %C'N');
; 5151 3 END
; 5152 2 ELSE
; 5153 3 BEGIN
; 5154 3 RMSG%COUNT = .RMSG%COUNT + 1;
; 5155 3 XFR%STATUS (%C'R', %C'P');
; 5156 2 END;
; 5157 2
; 5158 2 !
; 5159 2 ! Now check to see if we have an E type (Error) packet.
; 5160 2 !
; 5161 2
; 5162 2 IF .REC%TYPE NEQ MSG%ERROR THEN RETURN KER%NORMAL;
; 5163 2
; 5164 2 !
; 5165 2 ! Here to process an error packet. Call the user routine to output the
; 5166 2 ! error message to the terminal.
; 5167 2 !
; 5168 2 !
; 5169 2 ![026] Use decoding routine to fetch the error text
; 5170 2 !
; 5171 2 CH$FILL (CHR%NUL, MAX%MSG + 1, CH$PTR (LAST%ERROR));
; 5172 2 SET%STRING (CH$PTR (LAST%ERROR), MAX%MSG, TRUE);
; 5173 2 BFR%EMPTY ();
; 5174 2 SET%STRING (0, 0, FALSE);
; 5175 2 ![026] ERR%POINTER = CH$PTR (LAST%ERROR);
; 5176 2 ![026] POINTER = CH$PTR (REC%MSG, PKT%MSG, CHR%SIZE);
; 5177 2 ![026]
; 5178 2 ![026] INCR I FROM 1 TO .REC%LENGTH DO
; 5179 2 ![026] CH$WCHAR%A (CH$RCHAR%A (POINTER), ERR%POINTER);
; 5180 2 ![026]
; 5181 2 ![026] CH$WCHAR (CHR%NUL, ERR%POINTER);
; 5182 2 TT%TEXT (LAST%ERROR);
; 5183 2 TT%CRLF ();
; 5184 2 RETURN KER%ERRMSG;
; 5185 1 END; ! End of REC%PACKET
P.AAN: BYTE (7)"A","t","t","e","m"
BYTE (7)"p","t","i","n","g"
BYTE (7)" ","t","o"," ","r"
BYTE (7)"e","c","e","i","v"
BYTE (7)"e",000,000,000,000
; ATTEMPT%TEXT
U.82= P.AAN
; REC%PACKET
U.26: PUSH SP,AC14 ; 4915
PUSH SP,AC16
ADJSP SP,1
MOVEI AC1,1 ; 4973
TDNN AC1,DEBUG%FLAG
JRST L.323
PUSH SP,C.88 ; 4980
PUSHJ SP,TT%SET%OUTPUT
MOVE AC14,AC1
PUSH SP,C.89 ; 4981
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 4982
MOVEM AC14,0(SP) ; 4983
PUSHJ SP,TT%SET%OUTPUT
ADJSP SP,-2 ; 4975
L.323: MOVEI AC1,1 ; 4990
TDNN AC1,TYP%STS%FLAG
JRST L.324
PUSHJ SP,U.33 ; 4993
SETZM TYP%STS%FLAG ; 4994
L.324: PUSH SP,C.90 ; 5000
MOVEI AC1,-1(SP)
PUSH SP,AC1
PUSHJ SP,RECEIVE
MOVE AC14,AC1
CAIE AC14,300 ; 5005
JRST L.325
PUSH SP,C.12
PUSH SP,C.5
PUSHJ SP,XFR%STATUS
ADJSP SP,-2
L.325: TRNE AC14,1 ; 5011
JRST L.327
CAIE AC14,312 ; 5015
CAIN AC14,300
JRST L.326
MOVEM AC14,0(SP)
PUSHJ SP,KRM%ERROR
L.326: ADJSP SP,-2 ; 5018
MOVE AC1,AC14 ; 5013
JRST L.346
L.327: MOVE AC1,-2(SP) ; 5025
CAIGE AC1,5
JRST L.328
MOVE AC2,C.91 ; 5031
ILDB AC2,AC2
CAIN AC2,40
CAIL AC1,10 ; 5034
JRST L.329
L.328: ADJSP SP,-2 ; 5037
MOVEI AC1,262 ; 5036
JRST L.346
L.329: ADDM AC1,RMSG%TOTAL%CHARS ; 5043
MOVE AC1,C.92 ; 5047
ILDB AC1,AC1
MOVEM AC1,U.58
MOVEI AC1,4 ; 5051
MOVEM AC1,U.39
MOVE AC1,C.91 ; 5052
ILDB AC1,AC1
SUBI AC1,40
MOVEM AC1,U.57
JUMPN AC1,L.330 ; 5053
MOVE AC1,C.93 ; 5056
ILDB AC1,AC1
IMULI AC1,137
MOVE AC2,C.94 ; 5057
ILDB AC2,AC2
ADD AC1,AC2 ; 5056
SUBI AC1,5773 ; 5058
MOVEM AC1,U.57
MOVEI AC1,7 ; 5059
MOVEM AC1,U.39
L.330: MOVE AC1,C.95 ; 5062
ILDB AC1,AC1
SUBI AC1,40
MOVEM AC1,U.56
PUSH SP,C.90 ; 5066
PUSHJ SP,U.36
MOVE AC16,C.91 ; 5071
MOVE AC1,U.57 ; 5072
SUB AC1,U.48
ADDI AC1,61
MOVEM AC1,U.57
MOVEM AC16,0(SP) ; 5073
PUSH SP,U.57
PUSHJ SP,U.19
MOVE AC2,U.57 ; 5074
ADDI AC2,1
MOVE AC3,C.27
ADJBP AC2,AC3
MOVE AC16,AC2
MOVE AC2,U.57 ; 5075
SUB AC2,U.39
ADDI AC2,1
MOVEM AC2,U.57
MOVEI AC14,13 ; 5076
MOVE AC3,U.48 ; 5078
MOVE AC2,AC3
SUBI AC2,61
JRST L.331(AC2)
L.331: JRST L.332
JRST L.334
JRST L.333
L.332: ILDB AC2,AC16 ; 5083
SUBI AC2,40
CAMN AC1,AC2
JRST L.336
JRST L.335
L.333: ILDB AC2,AC16 ; 5094
SUBI AC2,40
LDB AC4,C.86
CAME AC4,AC2
JRST L.335
L.334: ILDB AC2,AC16 ; 5095
SUBI AC2,40
LDB AC4,C.87 ; 5094
CAME AC4,AC2
JRST L.335
ILDB AC2,AC16 ; 5095
SUBI AC2,40
LDB AC4,C.18
CAME AC4,AC2
L.335: MOVEI AC14,172 ; 5097
L.336: CAIE AC14,172 ; 5110
JRST L.342
CAIE AC3,61 ; 5114
SKIPE U.56
JRST L.337
MOVE AC2,AC3
SUBI AC2,62
MOVN AC2,AC2
CAMG AC2,U.57
JRST L.337
MOVEI AC2,116 ; 5115
CAMN AC2,U.58
JRST L.338
L.337: MOVEI AC2,123
CAME AC2,U.58
JRST L.340
L.338: MOVE AC14,AC3 ; 5122
MOVEI AC2,61 ; 5123
MOVEM AC2,U.48
MOVE AC16,C.91 ; 5124
MOVEM AC16,0(SP) ; 5125
MOVE AC2,U.57
ADD AC2,U.39
SUBI AC2,1
PUSH SP,AC2
PUSHJ SP,U.19
MOVE AC2,U.57 ; 5126
ADD AC2,U.39
MOVE AC3,C.27
ADJBP AC2,AC3
MOVE AC16,AC2
ILDB AC2,AC16 ; 5128
SUBI AC2,40
CAMN AC1,AC2
JRST L.339
MOVEM AC14,U.48 ; 5131
ADJSP SP,-5 ; 5132
JRST L.341
L.339: ADJSP SP,-1 ; 5117
JRST L.342 ; 5114
L.340: ADJSP SP,-4 ; 5137
L.341: MOVEI AC1,172
JRST L.346
L.342: MOVEI AC1,116 ; 5146
CAME AC1,U.58
JRST L.343
AOS RMSG%NAKS ; 5149
PUSH SP,C.12 ; 5150
PUSH SP,C.24
JRST L.344
L.343: AOS RMSG%COUNT ; 5154
PUSH SP,C.12 ; 5155
PUSH SP,C.85
L.344: PUSHJ SP,XFR%STATUS
MOVEI AC1,105 ; 5162
CAMN AC1,U.58
JRST L.345
ADJSP SP,-6
MOVEI AC1,13
JRST L.346
L.345: SETZB AC1,AC2 ; 5171
MOVEI AC4,1753
MOVE AC5,C.3
EXTEND AC1,C.1
JFCL
PUSH SP,C.3 ; 5172
PUSH SP,C.55
PUSH SP,C.2
PUSHJ SP,U.30
PUSHJ SP,U.28 ; 5173
SETZM -2(SP) ; 5174
SETZM -1(SP)
SETZM 0(SP)
PUSHJ SP,U.30
PUSH SP,C.96 ; 5182
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 5183
ADJSP SP,-12 ; 5184
MOVEI AC1,162 ; 4955
L.346: ADJSP SP,-1 ; 4915
POP SP,AC16
POP SP,AC14
POPJ SP,
C.86: POINT 4,AC1,23
C.87: POINT 6,AC1,29
C.88: XWD 0,DBG%DUMP
C.89: XWD 0,U.82
C.90: XWD 0,U.59
C.91: POINT 8,U.59,7
C.92: POINT 8,U.59,23
C.93: POINT 8,U.59,31
C.94: POINT 8,U.59+1,7
C.95: POINT 8,U.59,15
C.96: XWD 0,LAST%ERROR
; Routine Size: 218 words
; 5186 1 %SBTTL 'CALC%BLOCK%CHECK'
; 5187 1 ROUTINE CALC%BLOCK%CHECK (POINTER, LENGTH) =
; 5188 1
; 5189 1 !++
; 5190 1 ! FUNCTIONAL DESCRIPTION:
; 5191 1 !
; 5192 1 ! This routine will calculate the proper value for the block check
; 5193 1 ! for a given message. The value it returns is dependant upon the
; 5194 1 ! type of block check requested in BLK%CHK%TYPE.
; 5195 1 !
; 5196 1 ! CALLING SEQUENCE:
; 5197 1 !
; 5198 1 ! CHKSUM = CALC%BLOCK%CHECK (.POINTER, .LENGTH);
; 5199 1 !
; 5200 1 ! INPUT PARAMETERS:
; 5201 1 !
; 5202 1 ! POINTER - A character pointer to the first character to be
; 5203 1 ! included in the block check.
; 5204 1 !
; 5205 1 ! LENGTH - The number of characters to be included.
; 5206 1 !
; 5207 1 ! IMPLICIT INPUTS:
; 5208 1 !
; 5209 1 ! BLK%CHK%TYPE - The type of block check to generate.
; 5210 1 !
; 5211 1 ! OUPTUT PARAMETERS:
; 5212 1 !
; 5213 1 ! The value is the block check.
; 5214 1 !
; 5215 1 ! IMPLICIT OUTPUTS:
; 5216 1 !
; 5217 1 ! None.
; 5218 1 !
; 5219 1 ! COMPLETION CODES:
; 5220 1 !
; 5221 1 ! None.
; 5222 1 !
; 5223 1 ! SIDE EFFECTS:
; 5224 1 !
; 5225 1 ! None.
; 5226 1 !
; 5227 1 !--
; 5228 1
; 5229 2 BEGIN
; 5230 2
; 5231 2 LOCAL
; 5232 2 CHAR%MASK, ! Mask for stripping bits
; 5233 2 BLOCK%CHECK; ! To build initial block check value
; 5234 2
; 5235 2 BLOCK%CHECK = 0; ! Start out at 0
; 5236 2 !
; 5237 2 ! Set mask for characters so that we calculate the block check correctly
; 5238 2 !
; 5239 2 CHAR%MASK = (IF .PARITY%TYPE EQL PR%NONE THEN %O'377' ELSE %O'177');
; 5240 2
; 5241 2 CASE .BLK%CHK%TYPE FROM CHK%1CHAR TO CHK%CRC OF
; 5242 2 SET
; 5243 2
; 5244 2 [CHK%1CHAR, CHK%2CHAR] :
; 5245 2
; 5246 2 INCR I FROM 1 TO .LENGTH DO
; 5247 2 BLOCK%CHECK = .BLOCK%CHECK + (CH$RCHAR%A (POINTER) AND .CHAR%MASK);
; 5248 2
; 5249 2 [CHK%CRC] :
; 5250 3 BEGIN
; 5251 3 !
; 5252 3 ! Ensure that the calculation is done with correct type of characters
; 5253 3 !
; 5254 3
; 5255 3 LOCAL
; 5256 3 TMP%PTR; ! Temp pointer for copying chars
; 5257 3
; 5258 3 TMP%PTR = .POINTER;
; 5259 3
; 5260 3 IF .PARITY%TYPE NEQ PR%NONE
; 5261 3 THEN
; 5262 3
; 5263 3 INCR I FROM 1 TO .LENGTH DO
; 5264 3 CH$WCHAR%A ((CH$RCHAR (.TMP%PTR) AND %O'177'), TMP%PTR);
; 5265 3
; 5266 3 BLOCK%CHECK = CRCCLC (.POINTER, .LENGTH);
; 5267 2 END;
; 5268 2 TES;
; 5269 2
; 5270 2 IF .BLK%CHK%TYPE EQL CHK%1CHAR
; 5271 2 THEN
; 5272 2 BLOCK%CHECK = (.BLOCK%CHECK + ((.BLOCK%CHECK AND %O'300')/%O'100')) AND %O'77';
; 5273 2
; 5274 2 RETURN .BLOCK%CHECK; ! Return the correct value
; 5275 1 END; ! End of CALC%BLOCK%CHK
; CALC%BLOCK%CHECK
U.19: SETZ AC5, ; 5235
MOVE AC4,PARITY%TYPE ; 5239
JUMPN AC4,L.347
MOVEI AC3,377
JRST L.348
L.347: MOVEI AC3,177
L.348: MOVE AC1,U.48 ; 5241
SUBI AC1,61
JRST L.349(AC1)
L.349: JRST L.350
JRST L.350
JRST L.353
L.350: SETZ AC2, ; 5246
JRST L.352
L.351: ILDB AC1,-2(SP) ; 5247
AND AC1,AC3
ADD AC5,AC1
L.352: ADDI AC2,1 ; 5246
CAMG AC2,-1(SP)
JRST L.351
JRST L.357 ; 5241
L.353: MOVE AC1,-2(SP) ; 5258
JUMPE AC4,L.356 ; 5260
MOVE AC4,-1(SP) ; 5263
SETZ AC3,
JRST L.355
L.354: MOVE AC2,AC1 ; 5264
ILDB AC2,AC2
ANDI AC2,177
IDPB AC2,AC1
L.355: ADDI AC3,1 ; 5263
CAMG AC3,AC4
JRST L.354
L.356: PUSH SP,-2(SP) ; 5266
PUSH SP,-2(SP)
PUSHJ SP,CRCCLC
MOVE AC5,AC1
ADJSP SP,-2 ; 5250
L.357: MOVEI AC1,61 ; 5270
CAME AC1,U.48
JRST L.358
MOVE AC1,AC5 ; 5272
ANDI AC1,300
IDIVI AC1,100
ADD AC1,AC5
LDB AC5,C.18
L.358: MOVE AC1,AC5 ; 5229
POPJ SP, ; 5187
; Routine Size: 48 words
; 5276 1 %SBTTL 'NORMALIZE%FILE - Put file name into normal form'
; 5277 1 ROUTINE NORMALIZE%FILE (FILE%ADDRESS, FILE%LENGTH, NAME%LENGTH, TYPE%LENGTH) : NOVALUE =
; 5278 1
; 5279 1 !++
; 5280 1 ! FUNCTIONAL DESCRIPTION:
; 5281 1 !
; 5282 1 ! This routine will ensure that a file specification is in normal
; 5283 1 ! form. It does this by replacing all non-alphanumeric characters
; 5284 1 ! (except the first period) with "X". It will also ensure that
; 5285 1 ! the resulting specification (of form name.type) has only
; 5286 1 ! a specified number of characters in the name portion and type portion.
; 5287 1 !
; 5288 1 ! CALLING SEQUENCE:
; 5289 1 !
; 5290 1 ! NORMALIZE%FILE (FILE%ADDRESS, FILE%LENGTH, NAME%LENGTH, TYPE%LENGTH);
; 5291 1 !
; 5292 1 ! INPUT PARAMETERS:
; 5293 1 !
; 5294 1 ! FILE%ADDRESS - Address of file specification string to be normalized
; 5295 1 !
; 5296 1 ! FILE%LENGTH - Length of file specification
; 5297 1 !
; 5298 1 ! NAME%LENGTH - Maximum length desired for "name" portion.
; 5299 1 !
; 5300 1 ! TYPE%LENGTH - Maximum length desired for "type" portion.
; 5301 1 !
; 5302 1 ! With both NAME%LENGTH and TYPE%LENGTH, a negative value indicates
; 5303 1 ! unlimited lenght.
; 5304 1 !
; 5305 1 ! IMPLICIT INPUTS:
; 5306 1 !
; 5307 1 ! None.
; 5308 1 !
; 5309 1 ! OUPTUT PARAMETERS:
; 5310 1 !
; 5311 1 ! FILE%LENGTH - The length of the resulting file spec
; 5312 1 !
; 5313 1 ! NAME%LENGTH - The actual length of the resulting file name
; 5314 1 !
; 5315 1 ! TYPE%LENGTH - The actual length of the resulting file type
; 5316 1 !
; 5317 1 ! IMPLICIT OUTPUTS:
; 5318 1 !
; 5319 1 ! None.
; 5320 1 !
; 5321 1 ! COMPLETION CODES:
; 5322 1 !
; 5323 1 ! None.
; 5324 1 !
; 5325 1 ! SIDE EFFECTS:
; 5326 1 !
; 5327 1 ! None.
; 5328 1 !
; 5329 1 !--
; 5330 1
; 5331 2 BEGIN
; 5332 2
; 5333 2 LOCAL
; 5334 2 CH, ! Character being processed
; 5335 2 POINTER, ! Pointer to file spec
; 5336 2 WRT%POINTER, ! Pointer to write file spec
; 5337 2 WRT%SIZE,
; 5338 2 FIRST%PERIOD, ! Flag we have seen a period
; 5339 2 IGNORE%BAD, ! Flag we should ignore bad characters
; 5340 2 BAD%CHAR, ! Flag this character was bad
; 5341 2 FILE%CTR, ! Counter for overall length
; 5342 2 NAME%CTR, ! Counter for name characters
; 5343 2 TYPE%CTR; ! Counter for type characters
; 5344 2
; 5345 2 FILE%CTR = 0;
; 5346 2 NAME%CTR = 0;
; 5347 2 TYPE%CTR = 0;
; 5348 2 WRT%SIZE = 0;
; 5349 2 FIRST%PERIOD = FALSE; ! No periods yet
; 5350 2 POINTER = CH$PTR (.FILE%ADDRESS); ! Set up pointer to file name
; 5351 2 WRT%POINTER = .POINTER;
; 5352 2
; 5353 2 IF .NAME%LENGTH EQL 0 THEN FIRST%PERIOD = TRUE; ! Pretend we did name already
; 5354 2
; 5355 2 IGNORE%BAD = FALSE;
; 5356 2
; 5357 2 IF .NAME%LENGTH GTR 0
; 5358 2 THEN
; 5359 3 BEGIN
; 5360 3
; 5361 3 DECR I FROM ..FILE%LENGTH TO 0 DO
; 5362 3
; 5363 3 IF CH$RCHAR%A (POINTER) EQL %C'.'
; 5364 3 THEN
; 5365 4 BEGIN
; 5366 4 IGNORE%BAD = TRUE;
; 5367 4 EXITLOOP;
; 5368 3 END;
; 5369 3
; 5370 2 END;
; 5371 2
; 5372 2 POINTER = .WRT%POINTER;
; 5373 2
; 5374 2 WHILE .FILE%CTR LSS ..FILE%LENGTH DO
; 5375 3 BEGIN
; 5376 3 CH = CH$RCHAR%A (POINTER); ! Get a character
; 5377 3 FILE%CTR = .FILE%CTR + 1;
; 5378 3
; 5379 4 IF (.CH LSS %C'0' AND (.CH NEQ %C'.' OR .FIRST%PERIOD)) OR .CH GTR %C'z' OR (.CH GTR %C'9'
; 5380 4 AND .CH LSS %C'A') OR (.CH GTR %C'Z' AND .CH LSS %C'a')
; 5381 3 THEN
; 5382 4 BEGIN
; 5383 4 BAD%CHAR = TRUE;
; 5384 4 CH = %C'X';
; 5385 4 END
; 5386 3 ELSE
; 5387 4 BEGIN
; 5388 4 BAD%CHAR = FALSE;
; 5389 4
; 5390 4 IF .CH GEQ %C'a' THEN CH = .CH - (%C'a' - %C'A');
; 5391 4
; 5392 3 END;
; 5393 3
; 5394 3 IF .CH EQL %C'.'
; 5395 3 THEN
; 5396 4 BEGIN
; 5397 4 FIRST%PERIOD = TRUE;
; 5398 4 CH$WCHAR%A (.CH, WRT%POINTER);
; 5399 4 WRT%SIZE = .WRT%SIZE + 1;
; 5400 4 END
; 5401 3 ELSE
; 5402 3
; 5403 3 IF NOT .BAD%CHAR OR NOT .IGNORE%BAD
; 5404 3 THEN
; 5405 3
; 5406 3 IF NOT .FIRST%PERIOD
; 5407 3 THEN
; 5408 4 BEGIN
; 5409 4
; 5410 4 IF .NAME%LENGTH LSS 0 OR .NAME%CTR LSS .NAME%LENGTH
; 5411 4 THEN
; 5412 5 BEGIN
; 5413 5 NAME%CTR = .NAME%CTR + 1;
; 5414 5 WRT%SIZE = .WRT%SIZE + 1;
; 5415 5 CH$WCHAR%A (.CH, WRT%POINTER);
; 5416 4 END;
; 5417 4
; 5418 4 END
; 5419 3 ELSE
; 5420 3
; 5421 3 IF .TYPE%LENGTH LSS 0 OR .TYPE%CTR LSS .TYPE%LENGTH
; 5422 3 THEN
; 5423 4 BEGIN
; 5424 4 TYPE%CTR = .TYPE%CTR + 1;
; 5425 4 WRT%SIZE = .WRT%SIZE + 1;
; 5426 4 CH$WCHAR%A (.CH, WRT%POINTER);
; 5427 3 END;
; 5428 3
; 5429 2 END;
; 5430 2
; 5431 2 .FILE%LENGTH = .WRT%SIZE;
; 5432 2 CH$WCHAR%A (CHR%NUL, WRT%POINTER);
; 5433 1 END; ! End of NORMALIZE%FILE
; NORMALIZE%FILE
U.27: PUSH SP,AC10 ; 5277
PUSH SP,AC11
PUSH SP,AC12
PUSH SP,AC13
PUSH SP,AC14
PUSH SP,AC16
SETZB AC16,AC11 ; 5345
SETZB AC10,AC12 ; 5347
SETZ AC13, ; 5349
MOVE AC1,-12(SP) ; 5350
MOVEI AC1,-1(AC1)
HRLI AC1,10700
MOVE AC4,AC1 ; 5351
SKIPN AC2,-10(SP) ; 5353
MOVEI AC13,1
SETZ AC14, ; 5355
JUMPLE AC2,L.361 ; 5357
MOVE AC2,-11(SP) ; 5361
MOVE AC3,0(AC2)
AOJA AC3,L.360
L.359: ILDB AC2,AC1 ; 5363
CAIE AC2,56
JRST L.360
MOVEI AC14,1 ; 5366
JRST L.361 ; 5365
L.360: SOJGE AC3,L.359 ; 5361
L.361: MOVE AC1,AC4 ; 5372
L.362: MOVE AC3,-11(SP) ; 5374
CAML AC16,0(AC3)
JRST L.374
ILDB AC2,AC1 ; 5376
ADDI AC16,1 ; 5377
CAIL AC2,60 ; 5379
JRST L.363
CAIN AC2,56
TRNE AC13,1
JRST L.365
L.363: CAILE AC2,172
JRST L.365
CAIG AC2,71
JRST L.364
CAIGE AC2,101 ; 5380
JRST L.365
L.364: CAILE AC2,132
CAIL AC2,141
JRST L.366
L.365: MOVEI AC5,1 ; 5383
MOVEI AC2,130 ; 5384
JRST L.367 ; 5379
L.366: SETZ AC5, ; 5388
CAIL AC2,141 ; 5390
SUBI AC2,40
L.367: CAIE AC2,56 ; 5394
JRST L.368
MOVEI AC13,1 ; 5397
IDPB AC2,AC4 ; 5398
AOJA AC12,L.362 ; 5394
L.368: TRNN AC5,1 ; 5403
JRST L.369
TRNE AC14,1
JRST L.362
L.369: TRNE AC13,1 ; 5406
JRST L.371
MOVE AC3,-10(SP) ; 5410
JUMPL AC3,L.370
CAML AC11,AC3
JRST L.362
L.370: AOJA AC11,L.373 ; 5413
L.371: MOVE AC3,-7(SP) ; 5421
JUMPL AC3,L.372
CAML AC10,AC3
JRST L.362
L.372: ADDI AC10,1 ; 5424
L.373: ADDI AC12,1 ; 5425
IDPB AC2,AC4 ; 5426
JRST L.362 ; 5421
L.374: MOVE AC1,-11(SP) ; 5431
MOVEM AC12,0(AC1)
SETZ AC1, ; 5432
IDPB AC1,AC4
POP SP,AC16 ; 5277
POP SP,AC14
POP SP,AC13
POP SP,AC12
POP SP,AC11
POP SP,AC10
POPJ SP,
; Routine Size: 87 words
; 5434 1 %SBTTL 'Buffer filling -- Main routine'
; 5435 1 ROUTINE BFR%FILL (FIRST%FLAG) =
; 5436 1
; 5437 1 !++
; 5438 1 ! FUNCTIONAL DESCRIPTION:
; 5439 1 !
; 5440 1 ! This routine will fill the buffer with data from the file. It
; 5441 1 ! will do all the quoting that is required.
; 5442 1 !
; 5443 1 ! CALLING SEQUENCE:
; 5444 1 !
; 5445 1 ! EOF%FLAG = BFR%FILL(.FIRST%FLAG);
; 5446 1 !
; 5447 1 ! INPUT PARAMETERS:
; 5448 1 !
; 5449 1 ! FIRST%FLAG - Flag whether first call for this file
; 5450 1 !
; 5451 1 ! IMPLICIT INPUTS:
; 5452 1 !
; 5453 1 ! None.
; 5454 1 !
; 5455 1 ! OUTPUT PARAMETERS:
; 5456 1 !
; 5457 1 ! True - Buffer filled may be at end of file.
; 5458 1 ! False - At end of file.
; 5459 1 !
; 5460 1 ! IMPLICIT OUTPUTS:
; 5461 1 !
; 5462 1 ! Number of characters stored in the buffer.
; 5463 1 !
; 5464 1 ! COMPLETION CODES:
; 5465 1 !
; 5466 1 ! None.
; 5467 1 !
; 5468 1 ! SIDE EFFECTS:
; 5469 1 !
; 5470 1 ! None.
; 5471 1 !
; 5472 1 !--
; 5473 1
; 5474 2 BEGIN
; 5475 2
; 5476 2 LITERAL
; 5477 2 NO%CHAR = -1, ! No character next
; 5478 2 EOF%CHAR = -2; ! EOF seen
; 5479 2
; 5480 2 LOCAL
; 5481 2 I, ! Temp loop index
; 5482 2 MAX%SIZE, ! Maximum size of data
; 5483 2 POINTER; ! Pointer into the message buffer
; 5484 2
; 5485 2 OWN
; 5486 2 NEXT%CHR, ! Saved character
; 5487 2 STATUS, ! Status value
; 5488 2 REPEAT%COUNT, ! Number of times character repeated
; 5489 2 CHAR%8%BIT, ! 8 bit character from file
; 5490 2 CHRS : VECTOR [5], ! String needed to represent character
; 5491 2 CHR%IDX, ! Index into CHRS
; 5492 2 OLD%CHAR%8%BIT, ! Previous 8-bit character
; 5493 2 OLD%CHRS : VECTOR [5], ! String for previous character
; 5494 2 OLD%CHR%IDX; ! Index for previous character
; 5495 2
; 5496 2 ROUTINE GET%QUOTED%CHAR =
; 5497 2 !
; 5498 2 ! This routine gets a character from the file and returns both
; 5499 2 ! the character and the string needed to represent the character
; 5500 2 ! if it needs quoting.
; 5501 2 !
; 5502 3 BEGIN
; 5503 3
; 5504 3 IF .NEXT%CHR GEQ 0
; 5505 3 THEN
; 5506 4 BEGIN
; 5507 4 CHAR%8%BIT = .NEXT%CHR;
; 5508 4 NEXT%CHR = NO%CHAR;
; 5509 4 STATUS = KER%NORMAL;
; 5510 4 END
; 5511 3 ELSE
; 5512 3
; 5513 3 IF .NEXT%CHR EQL NO%CHAR
; 5514 3 THEN
; 5515 3 STATUS = (.GET%CHR%ROUTINE) (CHAR%8%BIT)
; 5516 3 ELSE
; 5517 3 STATUS = KER%EOF;
; 5518 3
; 5519 3 IF .STATUS EQL KER%NORMAL
; 5520 3 THEN
; 5521 4 BEGIN
; 5522 4 !
; 5523 4 ! Determine if we should just quote the character
; 5524 4 ! Either:
; 5525 4 ! Character is a delete (177 octal)
; 5526 4 ! or Character is a control character (less than 40 octal)
; 5527 4 ! or Character is a quote character
; 5528 4 ! or Character is the repeat character and doing repeat compression
; 5529 4 ! or Character is an eight bit quote character and doing eight bit
; 5530 4 ! quoting.
; 5531 4 !
; 5532 4
; 5533 5 IF ((.CHAR%8%BIT AND %O'177') LSS %C' ') OR ((.CHAR%8%BIT AND %O'177') EQL CHR%DEL) OR (
; 5534 7 (.CHAR%8%BIT AND %O'177') EQL .RCV%QUOTE%CHR) OR (.FLAG%REPEAT AND ((.CHAR%8%BIT AND
; 5535 6 %O'177') EQL .REPT%CHR)) OR (.FLAG%8QUOTE AND ((.CHAR%8%BIT AND %O'177') EQL
; 5536 5 .SEND%8QUOTE%CHR))
; 5537 4 THEN
; 5538 5 BEGIN
; 5539 5 !
; 5540 5 ! If the character is a control character or delete we must do a CTL(Character)
; 5541 5 ! so it is something that we can be sure we can send.
; 5542 5 !
; 5543 5
; 5544 6 IF ((.CHAR%8%BIT AND %O'177') LSS %C' ') OR ((.CHAR%8%BIT AND %O'177') EQL CHR%DEL)
; 5545 5 THEN
; 5546 6 CHRS [0] = CTL (.CHAR%8%BIT)
; 5547 5 ELSE
; 5548 5 CHRS [0] = .CHAR%8%BIT;
; 5549 5
; 5550 5 CHR%IDX = 1;
; 5551 5 CHRS [1] = .RCV%QUOTE%CHR; ![035] Use character we said we would send
; 5552 5 END
; 5553 4 ELSE
; 5554 5 BEGIN
; 5555 5 CHR%IDX = 0;
; 5556 5 CHRS [0] = .CHAR%8%BIT;
; 5557 4 END;
; 5558 4
; 5559 4 END
; 5560 3 ELSE
; 5561 3
; 5562 3 IF .STATUS NEQ KER%EOF THEN KRM%ERROR (.STATUS); ! Report error
; 5563 3
; 5564 3 RETURN .STATUS;
; 5565 2 END;
RELOC 1025
; NEXT%CHR
U.83: BLOCK 1
; STATUS
U.84: BLOCK 1
; REPEAT%COUNT
U.85: BLOCK 1
; CHAR%8%BIT
U.86: BLOCK 1
; CHRS
U.87: BLOCK 5
; CHR%IDX
U.88: BLOCK 1
; OLD%CHAR%8%BIT
U.89: BLOCK 1
; OLD%CHRS
U.90: BLOCK 5
; OLD%CHR%IDX
U.91: BLOCK 1
RELOC 405672
; GET%QUOTED%CHAR
U.92: MOVE AC1,U.83 ; 5504
JUMPL AC1,L.375
MOVEM AC1,U.86 ; 5507
SETOM U.83 ; 5508
MOVEI AC1,13 ; 5509
JRST L.377
L.375: CAME AC1,C.36 ; 5513
JRST L.376
MOVE AC1,U.67 ; 5515
PUSH SP,C.98
PUSHJ SP,0(AC1)
MOVEM AC1,U.84
ADJSP SP,-1
JRST L.378 ; 5513
L.376: MOVEI AC1,113 ; 5517
L.377: MOVEM AC1,U.84
L.378: MOVE AC1,U.84 ; 5519
CAIE AC1,13
JRST L.383
MOVE AC2,U.86 ; 5533
LDB AC1,C.97
SETZ AC3,
CAIL AC1,40
JRST L.379
MOVEI AC3,1
JRST L.381
L.379: CAIE AC1,177
CAMN AC1,RCV%QUOTE%CHR
JRST L.381
MOVEI AC4,1 ; 5534
TDNN AC4,U.50
JRST L.380
CAMN AC1,U.38
JRST L.381
L.380: MOVEI AC4,1 ; 5535
TDNE AC4,U.49
CAME AC1,U.45
JRST L.382
L.381: TRNN AC3,1 ; 5544
CAIN AC1,177
TRC AC2,100 ; 5546
MOVEM AC2,U.87 ; 5548
MOVEI AC1,1 ; 5550
MOVEM AC1,U.88
MOVE AC1,RCV%QUOTE%CHR ; 5551
MOVEM AC1,U.87+1
JRST L.384 ; 5533
L.382: SETZM U.88 ; 5555
MOVEM AC2,U.87 ; 5556
JRST L.384 ; 5519
L.383: CAIN AC1,113 ; 5562
JRST L.384
PUSH SP,AC1
PUSHJ SP,KRM%ERROR
ADJSP SP,-1
L.384: MOVE AC1,U.84 ; 5502
POPJ SP, ; 5496
C.97: POINT 7,AC2,35
C.98: XWD 0,U.86
; Routine Size: 59 words
; 5566 2 ROUTINE GET%8%QUOTED%CHAR =
; 5567 2 !
; 5568 2 ! This routine will get the quoted representation of a character
; 5569 2 ! (by calling GET%QUOTED%CHAR), and return the 8th-bit quoted
; 5570 2 ! representation.
; 5571 2 !
; 5572 3 BEGIN
; 5573 3
; 5574 3 IF (STATUS = GET%QUOTED%CHAR ()) EQL KER%NORMAL
; 5575 3 THEN
; 5576 4 BEGIN
; 5577 4 !
; 5578 4 ! Determine if we must quote the eighth bit (parity bit on)
; 5579 4 !
; 5580 4
; 5581 5 IF (((.CHRS [0] AND %O'177') NEQ .CHRS [0]) AND .FLAG%8QUOTE)
; 5582 4 THEN
; 5583 5 BEGIN
; 5584 5 CHRS [0] = .CHRS [0] AND %O'177';
; 5585 5 CHR%IDX = .CHR%IDX + 1;
; 5586 5 CHRS [.CHR%IDX] = .SEND%8QUOTE%CHR;
; 5587 4 END;
; 5588 4
; 5589 3 END;
; 5590 3
; 5591 3 RETURN .STATUS;
; 5592 2 END;
; GET%8%QUOTED%CHAR
U.93: PUSHJ SP,U.92 ; 5574
MOVEM AC1,U.84
CAIE AC1,13
JRST L.385
LDB AC1,C.99 ; 5581
CAMN AC1,U.87
JRST L.385
MOVEI AC1,1
TDNN AC1,U.49
JRST L.385
LDB AC1,C.99 ; 5584
MOVEM AC1,U.87
AOS AC1,U.88 ; 5586
MOVE AC2,U.45
MOVEM AC2,U.87(AC1)
L.385: MOVE AC1,U.84 ; 5572
POPJ SP, ; 5566
C.99: POINT 7,U.87,35
; Routine Size: 18 words
; 5593 2 !
; 5594 2 ! Start of code for BFR%FILL
; 5595 2 !
; 5596 2 ! Initialize pointer and count
; 5597 2 !
; 5598 2 SIZE = 0;
; 5599 2 IF .SEND%PKT%SIZE GTR 94 ! [108]
; 5600 2 THEN ! [108]
; 5601 3 BEGIN ! [108]
; 5602 3 POINTER = CH$PTR (SND%MSG, PKT%MSGX, CHR%SIZE); ! [108]
; 5603 3 MAX%SIZE = .SEND%PKT%SIZE - PKT%MSGX + 1 - (.BLK%CHK%TYPE - CHK%1CHAR);
; 5604 3 END ! [108]
; 5605 2 ELSE ! [108]
; 5606 3 BEGIN ! [108]
; 5607 3 POINTER = CH$PTR (SND%MSG, PKT%MSG, CHR%SIZE); ! [108]
; 5608 3 MAX%SIZE = .SEND%PKT%SIZE - PKT%MSG + 1 - (.BLK%CHK%TYPE - CHK%1CHAR);
; 5609 2 END; ! [108]
; 5610 2 !
; 5611 2 ! If last call got an error or eof, return it now
; 5612 2 !
; 5613 2
; 5614 2 IF NOT .FIRST%FLAG AND (.STATUS NEQ KER%NORMAL) THEN RETURN .STATUS;
; 5615 2
; 5616 2 !
; 5617 2 ! If first time for a file prime the pump with the first character.
; 5618 2 !
; 5619 2
; 5620 2 IF .FIRST%FLAG
; 5621 2 THEN
; 5622 3 BEGIN
; 5623 3 FIRST%FLAG = FALSE;
; 5624 3 NEXT%CHR = -1; ! No backed up character
; 5625 3
; 5626 3 IF .FLAG%8QUOTE THEN STATUS = GET%8%QUOTED%CHAR () ELSE STATUS = GET%QUOTED%CHAR ();
; 5627 3
; 5628 3 IF .STATUS NEQ KER%NORMAL THEN RETURN .STATUS;
; 5629 3
; 5630 3 OLD%CHAR%8%BIT = .CHAR%8%BIT;
; 5631 3
; 5632 3 INCR OLD%CHR%IDX FROM 0 TO .CHR%IDX DO
; 5633 3 OLD%CHRS [.OLD%CHR%IDX] = .CHRS [.OLD%CHR%IDX];
; 5634 3
; 5635 3 OLD%CHR%IDX = .CHR%IDX;
; 5636 3 REPEAT%COUNT = 0; ! Character was not repeated yet
; 5637 3 ! Will always be incremented
; 5638 2 END;
; 5639 2
; 5640 2 !
; 5641 2 ! Otherwise, loop until we fill buffer
; 5642 2 !
; 5643 2
; 5644 2 WHILE .SIZE LSS .MAX%SIZE DO ! Normal exit is via an EXITLOOP
; 5645 3 BEGIN
; 5646 3 !
; 5647 3 ! Check if we are doing run compression
; 5648 3 !
; 5649 3
; 5650 3 IF .FLAG%REPEAT
; 5651 3 THEN
; 5652 4 BEGIN
; 5653 4 !
; 5654 4 ! Here with previous character in OLD%xxx. As long as we
; 5655 4 ! are getting the same character, just count the run.
; 5656 4 !
; 5657 4
; 5658 4 WHILE (.CHAR%8%BIT EQL .OLD%CHAR%8%BIT) AND (.REPEAT%COUNT LSS 94) DO
; 5659 5 BEGIN
; 5660 5 REPEAT%COUNT = .REPEAT%COUNT + 1;
; 5661 5
; 5662 5 IF .FLAG%8QUOTE THEN STATUS = GET%8%QUOTED%CHAR () ELSE STATUS = GET%QUOTED%CHAR ();
; 5663 5
; 5664 5 IF .STATUS NEQ KER%NORMAL
; 5665 5 THEN
; 5666 5
; 5667 5 IF .STATUS NEQ KER%EOF
; 5668 5 THEN
; 5669 5 CHAR%8%BIT = NO%CHAR
; 5670 5 ELSE
; 5671 6 BEGIN
; 5672 6 CHAR%8%BIT = EOF%CHAR;
; 5673 6 CHR%IDX = -1;
; 5674 5 END;
; 5675 5
; 5676 4 END;
; 5677 4
; 5678 5 IF .OLD%CHR%IDX + 1 + 2 LSS ((.OLD%CHR%IDX + 1)*.REPEAT%COUNT)
; 5679 4 THEN
; 5680 5 BEGIN
; 5681 5
; 5682 5 IF .SIZE + .OLD%CHR%IDX + 1 + 2 GTR .MAX%SIZE
; 5683 5 THEN
; 5684 6 BEGIN
; 5685 6
; 5686 6 IF .CHAR%8%BIT EQL .OLD%CHAR%8%BIT
; 5687 6 THEN
; 5688 7 BEGIN
; 5689 7 NEXT%CHR = .CHAR%8%BIT;
; 5690 7 REPEAT%COUNT = .REPEAT%COUNT - 1;
; 5691 6 END;
; 5692 6
; 5693 6 IF .CHAR%8%BIT EQL EOF%CHAR
; 5694 6 THEN
; 5695 7 BEGIN
; 5696 7 NEXT%CHR = EOF%CHAR; ! Remember EOF for next time
; 5697 7 STATUS = KER%NORMAL; ! And give good return now
; 5698 6 END;
; 5699 6
; 5700 6 EXITLOOP;
; 5701 5 END;
; 5702 5
; 5703 5 OLD%CHRS [.OLD%CHR%IDX + 1] = CHAR (.REPEAT%COUNT);
; 5704 5 OLD%CHRS [.OLD%CHR%IDX + 2] = .REPT%CHR;
; 5705 5 OLD%CHR%IDX = .OLD%CHR%IDX + 2;
; 5706 5 !
; 5707 5 ! Count the number of file characters this represents
; 5708 5 !
; 5709 5 SMSG%DATA%CHARS = .SMSG%DATA%CHARS + .REPEAT%COUNT - 1;
; 5710 5 FILE%CHARS = .FILE%CHARS + .REPEAT%COUNT - 1;
; 5711 5 REPEAT%COUNT = 1; ! Only one time for this string
; 5712 4 END;
; 5713 4
; 5714 4 !
; 5715 4 ! If we don't have enough room for this character, wait till next
; 5716 4 ! time.
; 5717 4 !
; 5718 4
; 5719 4 IF .SIZE + (.OLD%CHR%IDX + 1)*.REPEAT%COUNT GTR .MAX%SIZE
; 5720 4 THEN
; 5721 5 BEGIN
; 5722 5 ! If the next character is the same, the count will get incremented
; 5723 5 ! next time we enter, so back it off now.
; 5724 5
; 5725 5 IF .CHAR%8%BIT EQL .OLD%CHAR%8%BIT
; 5726 5 THEN
; 5727 6 BEGIN
; 5728 6 NEXT%CHR = .CHAR%8%BIT;
; 5729 6 REPEAT%COUNT = .REPEAT%COUNT - 1;
; 5730 5 END;
; 5731 5 !
; 5732 5 ! If this is the last character of the file,
; 5733 5 ! remember that for next time, but give good return now.
; 5734 5 !
; 5735 5 IF .CHAR%8%BIT EQL EOF%CHAR
; 5736 5 THEN
; 5737 6 BEGIN
; 5738 6 NEXT%CHR = EOF%CHAR;
; 5739 6 STATUS = KER%NORMAL
; 5740 5 END;
; 5741 5
; 5742 5 EXITLOOP;
; 5743 4 END;
; 5744 4
; 5745 4 SMSG%DATA%CHARS = .SMSG%DATA%CHARS + .REPEAT%COUNT;
; 5746 4 FILE%CHARS = .FILE%CHARS + .REPEAT%COUNT;
; 5747 4
; 5748 4 DECR REPEAT%COUNT FROM .REPEAT%COUNT TO 1 DO
; 5749 4
; 5750 4 DECR I FROM .OLD%CHR%IDX TO 0 DO
; 5751 5 BEGIN
; 5752 5 CH$WCHAR%A (.OLD%CHRS [.I], POINTER);
; 5753 5 SIZE = .SIZE + 1;
; 5754 4 END;
; 5755 4
; 5756 4 !
; 5757 4 ! If we had to defer EOF condition, reactivate it now.
; 5758 4 !
; 5759 4 IF (.CHAR%8%BIT EQL EOF%CHAR) THEN STATUS = KER%EOF;
; 5760 4 !
; 5761 4 ! If we got an error (or EOF) then exit
; 5762 4 !
; 5763 4
; 5764 4 IF (.STATUS NEQ KER%NORMAL) THEN EXITLOOP;
; 5765 4
; 5766 4 !
; 5767 4 ! Otherwise, copy the character which broke the run
; 5768 4 !
; 5769 4 OLD%CHAR%8%BIT = .CHAR%8%BIT;
; 5770 4
; 5771 4 INCR OLD%CHR%IDX FROM 0 TO .CHR%IDX DO
; 5772 4 OLD%CHRS [.OLD%CHR%IDX] = .CHRS [.OLD%CHR%IDX];
; 5773 4
; 5774 4 OLD%CHR%IDX = .CHR%IDX;
; 5775 4 REPEAT%COUNT = 0;
; 5776 4 END
; 5777 3 ELSE
; 5778 3 !
; 5779 3 ! Here if we are not doing run compression. We can do things much
; 5780 3 ! easier.
; 5781 3 !
; 5782 4 BEGIN
; 5783 4
; 5784 4 IF (.SIZE + .CHR%IDX + 1) GTR .MAX%SIZE THEN EXITLOOP;
; 5785 4
; 5786 4 SMSG%DATA%CHARS = .SMSG%DATA%CHARS + 1;
; 5787 4 FILE%CHARS = .FILE%CHARS + 1;
; 5788 4
; 5789 4 DECR CHR%IDX FROM .CHR%IDX TO 0 DO
; 5790 5 BEGIN
; 5791 5 CH$WCHAR%A (.CHRS [.CHR%IDX], POINTER);
; 5792 5 SIZE = .SIZE + 1;
; 5793 4 END;
; 5794 4
; 5795 4 IF .FLAG%8QUOTE THEN STATUS = GET%8%QUOTED%CHAR () ELSE STATUS = GET%QUOTED%CHAR ();
; 5796 4
; 5797 4 IF (.STATUS NEQ KER%NORMAL) THEN EXITLOOP;
; 5798 4
; 5799 3 END;
; 5800 3
; 5801 2 END;
; 5802 2
; 5803 2 ! [108] Return negative size if we use extend packet format
; 5804 2
; 5805 2 IF .SEND%PKT%SIZE GTR 94 ! [108]
; 5806 2 THEN ! [108]
; 5807 2 SIZE = -.SIZE; ! [108]
; 5808 2
; 5809 2 !
; 5810 2 ! Determine if we really stored anything into the buffer.
; 5811 2 !
; 5812 2
; 5813 2 IF .SIZE NEQ 0 THEN RETURN KER%NORMAL ELSE RETURN .STATUS;
; 5814 2
; 5815 1 END; ! End of BFR%FILL
; BFR%FILL
U.29: PUSH SP,AC14 ; 5435
PUSH SP,AC16
SETZM U.52 ; 5598
MOVE AC2,U.48 ; 5603
SUBI AC2,61
MOVE AC16,U.40 ; 5599
CAIG AC16,136
JRST L.386
MOVE AC14,C.66 ; 5602
MOVE AC1,AC16 ; 5603
SUB AC1,AC2
MOVE AC16,AC1
SUBI AC16,6
JRST L.387 ; 5599
L.386: MOVE AC14,C.32 ; 5607
SUB AC16,AC2 ; 5608
SUBI AC16,3
L.387: MOVE AC1,-3(SP) ; 5614
TRNE AC1,1
JRST L.388
MOVEI AC2,13
CAME AC2,U.84
JRST L.418
L.388: TRNN AC1,1 ; 5620
JRST L.394
SETZM -3(SP) ; 5623
SETOM U.83 ; 5624
MOVEI AC1,1 ; 5626
TDNN AC1,U.49
JRST L.389
PUSHJ SP,U.93
JRST L.390
L.389: PUSHJ SP,U.92
L.390: MOVEM AC1,U.84
CAIE AC1,13 ; 5628
JRST L.419
MOVE AC1,U.86 ; 5630
MOVEM AC1,U.89
SETO AC1, ; 5632
JRST L.392
L.391: MOVE AC2,U.87(AC1) ; 5633
MOVEM AC2,U.90(AC1)
L.392: ADDI AC1,1 ; 5632
CAMG AC1,U.88
JRST L.391
L.393: MOVE AC1,U.88 ; 5635
MOVEM AC1,U.91
SETZM U.85 ; 5636
L.394: CAMG AC16,U.52 ; 5644
JRST L.417
MOVEI AC1,1 ; 5650
TDNN AC1,U.50
JRST L.412
L.395: MOVE AC1,U.86 ; 5658
CAME AC1,U.89
JRST L.399
MOVEI AC1,136
CAMG AC1,U.85
JRST L.399
AOS U.85 ; 5660
MOVEI AC1,1 ; 5662
TDNN AC1,U.49
JRST L.396
PUSHJ SP,U.93
JRST L.397
L.396: PUSHJ SP,U.92
L.397: MOVEM AC1,U.84
CAIN AC1,13 ; 5664
JRST L.395
CAIN AC1,113 ; 5667
JRST L.398
SETOM U.86 ; 5669
JRST L.395 ; 5667
L.398: HRROI AC1,-2 ; 5672
MOVEM AC1,U.86
SETOM U.88 ; 5673
JRST L.395 ; 5664
L.399: MOVE AC2,U.91 ; 5678
MOVE AC4,AC2
ADDI AC4,3
MOVE AC1,AC2
AOS AC3,AC1
IMUL AC3,U.85
CAML AC4,AC3
JRST L.402
MOVE AC3,U.52 ; 5682
ADD AC3,AC2
ADDI AC3,3
CAMG AC3,AC16
JRST L.401
MOVE AC3,U.86 ; 5686
CAME AC3,U.89
JRST L.400
MOVE AC3,U.86 ; 5689
MOVEM AC3,U.83
SOS U.85 ; 5690
L.400: HRROI AC3,-2 ; 5693
CAME AC3,U.86
JRST L.417
HRROI AC3,-2 ; 5696
MOVEM AC3,U.83
MOVEI AC3,13 ; 5697
MOVEM AC3,U.84
JRST L.417 ; 5693
L.401: MOVE AC3,U.85 ; 5703
ADDI AC3,40
MOVEM AC3,U.90(AC1)
MOVE AC1,U.38 ; 5704
MOVEM AC1,U.90+2(AC2)
MOVEI AC1,2 ; 5705
ADDM AC1,U.91
MOVE AC1,SMSG%DATA%CHARS ; 5709
ADD AC1,U.85
SUBI AC1,1
MOVEM AC1,SMSG%DATA%CHARS
MOVE AC1,U.61 ; 5710
ADD AC1,U.85
SUBI AC1,1
MOVEM AC1,U.61
MOVEI AC1,1 ; 5711
MOVEM AC1,U.85
L.402: MOVE AC1,U.91 ; 5719
ADDI AC1,1
IMUL AC1,U.85
ADD AC1,U.52
CAMG AC1,AC16
JRST L.404
MOVE AC1,U.86 ; 5725
CAME AC1,U.89
JRST L.403
MOVE AC1,U.86 ; 5728
MOVEM AC1,U.83
SOS U.85 ; 5729
L.403: HRROI AC1,-2 ; 5735
CAME AC1,U.86
JRST L.417
HRROI AC1,-2 ; 5738
MOVEM AC1,U.83
MOVEI AC1,13 ; 5739
MOVEM AC1,U.84
JRST L.417 ; 5735
L.404: MOVE AC1,U.85 ; 5745
ADDM AC1,SMSG%DATA%CHARS
MOVE AC1,U.85 ; 5746
ADDM AC1,U.61
MOVE AC3,U.85 ; 5748
AOJA AC3,L.408
L.405: MOVE AC1,U.91 ; 5750
AOJA AC1,L.407
L.406: MOVE AC2,U.90(AC1) ; 5752
IDPB AC2,AC14
AOS U.52 ; 5753
L.407: SOJGE AC1,L.406 ; 5750
L.408: SOJG AC3,L.405 ; 5748
HRROI AC1,-2 ; 5759
CAME AC1,U.86
JRST L.409
MOVEI AC1,113
MOVEM AC1,U.84
L.409: MOVEI AC1,13 ; 5764
CAME AC1,U.84
JRST L.417
MOVE AC1,U.86 ; 5769
MOVEM AC1,U.89
SETO AC1, ; 5771
JRST L.411
L.410: MOVE AC2,U.87(AC1) ; 5772
MOVEM AC2,U.90(AC1)
L.411: ADDI AC1,1 ; 5771
CAMG AC1,U.88
JRST L.410
JRST L.393
L.412: MOVE AC1,U.52 ; 5784
ADD AC1,U.88
ADDI AC1,1
CAMLE AC1,AC16
JRST L.417
AOS SMSG%DATA%CHARS ; 5786
AOS U.61 ; 5787
MOVE AC1,U.88 ; 5789
AOJA AC1,L.414
L.413: MOVE AC2,U.87(AC1) ; 5791
IDPB AC2,AC14
AOS U.52 ; 5792
L.414: SOJGE AC1,L.413 ; 5789
MOVEI AC1,1 ; 5795
TDNN AC1,U.49
JRST L.415
PUSHJ SP,U.93
JRST L.416
L.415: PUSHJ SP,U.92
L.416: MOVEM AC1,U.84
MOVEI AC1,13 ; 5797
CAMN AC1,U.84
JRST L.394 ; 5644
L.417: MOVEI AC1,136 ; 5805
CAMGE AC1,U.40
MOVNS U.52 ; 5807
SKIPN U.52 ; 5813
JRST L.418
MOVEI AC1,13
JRST L.419
L.418: MOVE AC1,U.84
L.419: POP SP,AC16 ; 5435
POP SP,AC14
POPJ SP,
; Routine Size: 206 words
; 5816 1 %SBTTL 'BFR%EMPTY'
; 5817 1 ROUTINE BFR%EMPTY =
; 5818 1
; 5819 1 !++
; 5820 1 ! FUNCTIONAL DESCRIPTION:
; 5821 1 !
; 5822 1 ! This routine will empty the data from the REC%MSG message buffer
; 5823 1 ! to the file. It will process quoting characters.
; 5824 1 !
; 5825 1 ! CALLING SEQUENCE:
; 5826 1 !
; 5827 1 ! Flag = BFR%EMPTY();
; 5828 1 !
; 5829 1 ! INPUT PARAMETERS:
; 5830 1 !
; 5831 1 ! None.
; 5832 1 !
; 5833 1 ! IMPLICIT INPUTS:
; 5834 1 !
; 5835 1 ! None.
; 5836 1 !
; 5837 1 ! OUTPUT PARAMETERS:
; 5838 1 !
; 5839 1 ! True - No problems writing the file.
; 5840 1 ! False - I/O error writing the file.
; 5841 1 !
; 5842 1 ! IMPLICIT OUTPUTS:
; 5843 1 !
; 5844 1 ! None.
; 5845 1 !
; 5846 1 ! COMPLETION CODES:
; 5847 1 !
; 5848 1 ! None.
; 5849 1 !
; 5850 1 ! SIDE EFFECTS:
; 5851 1 !
; 5852 1 ! None.
; 5853 1 !
; 5854 1 !--
; 5855 1
; 5856 2 BEGIN
; 5857 2
; 5858 2 LOCAL
; 5859 2 STATUS, ! Status returned by various routines
; 5860 2 REPEAT%COUNT, ! Count of times to repeat character
; 5861 2 TURN%BIT%8%ON, ! If eight bit quoting
; 5862 2 COUNTER, ! Count of the characters left
; 5863 2 CHARACTER, ! Character we are processing
; 5864 2 POINTER; ! Pointer to the data
; 5865 2
; 5866 2 POINTER = CH$PTR (REC%MSG, .RECV%PKT%MSG, CHR%SIZE); ! [108]
; 5867 2 COUNTER = 0;
; 5868 2
; 5869 2 WHILE (.COUNTER LSS .REC%LENGTH) DO
; 5870 3 BEGIN
; 5871 3 CHARACTER = CH$RCHAR%A (POINTER);
; 5872 3 COUNTER = .COUNTER + 1;
; 5873 3 !
; 5874 3 ! If the character is the repeat character (and we are doing repeat
; 5875 3 ! compression), then get the count.
; 5876 3 !
; 5877 3
; 5878 4 IF ((.CHARACTER EQL .REPT%CHR) AND .FLAG%REPEAT)
; 5879 3 THEN
; 5880 4 BEGIN
; 5881 4 REPEAT%COUNT = UNCHAR (CH$RCHAR%A (POINTER) AND %O'177');
; 5882 4 CHARACTER = CH$RCHAR%A (POINTER);
; 5883 4 COUNTER = .COUNTER + 2;
; 5884 4 END
; 5885 3 ELSE
; 5886 3 REPEAT%COUNT = 1;
; 5887 3
; 5888 3 !
; 5889 3 ! If the character is an eight bit quoting character and we are doing eight
; 5890 3 ! bit quoting then turn on the flag so we turn the eighth bit on when we
; 5891 3 ! get the real character.
; 5892 3 !
; 5893 3
; 5894 4 IF ((.CHARACTER EQL .SEND%8QUOTE%CHR) AND .FLAG%8QUOTE)
; 5895 3 THEN
; 5896 4 BEGIN
; 5897 4 TURN%BIT%8%ON = TRUE;
; 5898 4 COUNTER = .COUNTER + 1;
; 5899 4 CHARACTER = CH$RCHAR%A (POINTER);
; 5900 4 END
; 5901 3 ELSE
; 5902 3 TURN%BIT%8%ON = FALSE;
; 5903 3
; 5904 3 !
; 5905 3 ! Now determine if we are quoting the character. If so then we must eat
; 5906 3 ! the quoting character and get the real character.
; 5907 3 !
; 5908 3
; 5909 3 IF .CHARACTER EQL .SEND%QUOTE%CHR
; 5910 3 ![035] Is this character other Kermit sends as quote?
; 5911 3 THEN
; 5912 4 BEGIN
; 5913 4 CHARACTER = CH$RCHAR%A (POINTER);
; 5914 4 COUNTER = .COUNTER + 1;
; 5915 4 !
; 5916 4 ! Determine if we must undo what someone else has done to the character
; 5917 4 !
; 5918 4
; P 5919 5 IF ((.CHARACTER AND %O'177') GEQ CTL (CHR%DEL)) AND ((.CHARACTER AND %O'177') LEQ CTL (
; 5920 5 CHR%DEL) + %O'40')
; 5921 4 THEN
; 5922 4 CHARACTER = CTL (.CHARACTER);
; 5923 4
; 5924 3 END;
; 5925 3
; 5926 3 !
; 5927 3 ! Turn on the eight bit if needed and then write the character out
; 5928 3 !
; 5929 3
; 5930 3 IF .TURN%BIT%8%ON THEN CHARACTER = .CHARACTER OR %O'200';
; 5931 3
; 5932 3 RMSG%DATA%CHARS = .RMSG%DATA%CHARS + .REPEAT%COUNT;
; 5933 3 FILE%CHARS = .FILE%CHARS + .REPEAT%COUNT;
; 5934 3
; 5935 3 DECR REPEAT%COUNT FROM .REPEAT%COUNT TO 1 DO
; 5936 4 BEGIN
; 5937 4 STATUS = (.PUT%CHR%ROUTINE) (.CHARACTER);
; 5938 4
; 5939 4 IF NOT .STATUS THEN RETURN .STATUS;
; 5940 4
; 5941 3 END;
; 5942 3
; 5943 2 END;
; 5944 2
; 5945 2 RETURN KER%NORMAL;
; 5946 1 END; ! End of BFR%EMPTY
; BFR%EMPTY
U.28: PUSH SP,AC10 ; 5817
PUSH SP,AC11
PUSH SP,AC12
PUSH SP,AC13
PUSH SP,AC14
PUSH SP,AC16
MOVE AC1,C.27 ; 5866
MOVE AC14,U.39
ADJBP AC14,AC1
SETZ AC11, ; 5867
L.420: CAML AC11,U.57 ; 5869
JRST L.429
ILDB AC12,AC14 ; 5871
ADDI AC11,1 ; 5872
CAME AC12,U.38 ; 5878
JRST L.421
MOVEI AC2,1
TDNN AC2,U.50
JRST L.421
ILDB AC2,AC14 ; 5881
LDB AC13,C.97
SUBI AC13,40
ILDB AC12,AC14 ; 5882
ADDI AC11,2 ; 5883
JRST L.422 ; 5878
L.421: MOVEI AC13,1 ; 5886
L.422: CAME AC12,U.45 ; 5894
JRST L.423
MOVEI AC2,1
TDNN AC2,U.49
JRST L.423
MOVEI AC10,1 ; 5897
ADDI AC11,1 ; 5898
ILDB AC12,AC14 ; 5899
JRST L.424 ; 5894
L.423: SETZ AC10, ; 5902
L.424: CAME AC12,U.44 ; 5909
JRST L.425
ILDB AC12,AC14 ; 5913
ADDI AC11,1 ; 5914
LDB AC2,C.100 ; 5919
CAIL AC2,77
CAILE AC2,137
JRST L.425
TRC AC12,100 ; 5922
L.425: TRNE AC10,1 ; 5930
TRO AC12,200
ADDM AC13,RMSG%DATA%CHARS ; 5932
ADDM AC13,U.61 ; 5933
MOVE AC16,AC13 ; 5935
AOJA AC16,L.428
L.426: MOVE AC2,U.68 ; 5937
PUSH SP,AC12
PUSHJ SP,0(AC2)
TRNE AC1,1 ; 5939
JRST L.427
ADJSP SP,-1
JRST L.430
L.427: ADJSP SP,-1 ; 5936
L.428: SOJG AC16,L.426 ; 5935
JRST L.420 ; 5869
L.429: MOVEI AC1,13 ; 5856
L.430: POP SP,AC16 ; 5817
POP SP,AC14
POP SP,AC13
POP SP,AC12
POP SP,AC11
POP SP,AC10
POPJ SP,
C.100: POINT 7,AC12,35
; Routine Size: 70 words
; 5947 1 %SBTTL 'Buffer filling and emptying subroutines'
; 5948 1 ROUTINE SET%STRING (POINTER, LENGTH, START) =
; 5949 1
; 5950 1 !++
; 5951 1 ! FUNCTIONAL DESCRIPTION:
; 5952 1 !
; 5953 1 ! This routine is used to set up the buffer filling and emptying
; 5954 1 ! routines to use a string for input (or output) rather than
; 5955 1 ! the file I/O routines.
; 5956 1 !
; 5957 1 ! CALLING SEQUENCE:
; 5958 1 !
; 5959 1 ! SET%STRING (.POINTER, .LENGTH, .START)
; 5960 1 !
; 5961 1 ! INPUT PARAMETERS:
; 5962 1 !
; 5963 1 ! POINTER - Character pointer to string
; 5964 1 !
; 5965 1 ! LENGTH - Number of characters in string
; 5966 1 !
; 5967 1 ! START - True to start string, false to end it
; 5968 1 !
; 5969 1 ! IMPLICIT INPUTS:
; 5970 1 !
; 5971 1 ! None.
; 5972 1 !
; 5973 1 ! OUPTUT PARAMETERS:
; 5974 1 !
; 5975 1 ! Returns 0 if START = TRUE, actual number of characters used
; 5976 1 ! by last string if START = FALSE.
; 5977 1 !
; 5978 1 ! IMPLICIT OUTPUTS:
; 5979 1 !
; 5980 1 ! GET%CHR%ROUTINE and PUT%CHR%ROUTINE modifed so that string
; 5981 1 ! routines are called instead of file I/O.
; 5982 1 !
; 5983 1 ! COMPLETION CODES:
; 5984 1 !
; 5985 1 ! None.
; 5986 1 !
; 5987 1 ! SIDE EFFECTS:
; 5988 1 !
; 5989 1 ! None.
; 5990 1 !
; 5991 1 !--
; 5992 1
; 5993 2 BEGIN
; 5994 2
; 5995 2 OWN
; 5996 2 STR%POINTER, ! Pointer to string
; 5997 2 STR%LENGTH, ! Length of string
; 5998 2 STR%ORG%LENGTH, ! Original length of string
; 5999 2 OLD%GET%CHR, ! Old get-char routine
; 6000 2 OLD%PUT%CHR; ! Old put-char routine
; 6001 2
; 6002 2 !
; 6003 2 ! Routine to get a character from the string
; 6004 2 !
; 6005 2 ROUTINE GET%STRING (CHAR%ADDRESS) =
; 6006 3 BEGIN
; 6007 3 !
; 6008 3 ! If some characters are left, count down the length and get next character
; 6009 3 ! Otherwise return and end of file indication.
; 6010 3 !
; 6011 3
; 6012 3 IF .STR%LENGTH GTR 0
; 6013 3 THEN
; 6014 4 BEGIN
; 6015 4 STR%LENGTH = .STR%LENGTH - 1;
; 6016 4 .CHAR%ADDRESS = CH$RCHAR%A (STR%POINTER);
; 6017 4 RETURN KER%NORMAL;
; 6018 4 END
; 6019 3 ELSE
; 6020 3 RETURN KER%EOF;
; 6021 3
; 6022 2 END; ! End of GET%STRING
RELOC 1046
; STR%POINTER
U.94: BLOCK 1
; STR%LENGTH
U.95: BLOCK 1
; STR%ORG%LENGTH
U.96: BLOCK 1
; OLD%GET%CHR
U.97: BLOCK 1
; OLD%PUT%CHR
U.98: BLOCK 1
RELOC 406433
; GET%STRING
U.99: SKIPG U.95 ; 6012
JRST L.431
SOS U.95 ; 6015
MOVE AC2,-1(SP) ; 6016
ILDB AC1,U.94
MOVEM AC1,0(AC2)
MOVEI AC1,13 ; 6020
POPJ SP,
L.431: MOVEI AC1,113
POPJ SP, ; 6005
; Routine Size: 10 words
; 6023 2 ROUTINE PUT%STRING (CHAR%VALUE) =
; 6024 3 BEGIN
; 6025 3 !
; 6026 3 ! If there is enough room to store another character, store the character
; 6027 3 ! and count it. Otherwise return a line too long indication.
; 6028 3 !
; 6029 3
; 6030 3 IF .STR%LENGTH GTR 0
; 6031 3 THEN
; 6032 4 BEGIN
; 6033 4 STR%LENGTH = .STR%LENGTH - 1;
; 6034 4 CH$WCHAR%A (.CHAR%VALUE, STR%POINTER);
; 6035 4 RETURN KER%NORMAL;
; 6036 4 END
; 6037 3 ELSE
; 6038 3 RETURN KER%LINTOOLNG;
; 6039 3
; 6040 2 END; ! End of PUT%STRING
; PUT%STRING
U.100: SKIPG U.95 ; 6030
JRST L.432
SOS U.95 ; 6033
MOVE AC1,-1(SP) ; 6034
IDPB AC1,U.94
MOVEI AC1,13 ; 6038
POPJ SP,
L.432: MOVEI AC1,102
POPJ SP, ; 6023
; Routine Size: 9 words
; 6041 2 !
; 6042 2 ! If we have a request to start a string (input or output), save the old
; 6043 2 ! routines and set up ours. Also save the string pointer and length for
; 6044 2 ! use by our get/put routines.
; 6045 2 ! Otherwise this is a request to stop using the string routines, so reset
; 6046 2 ! the old routines and return the actual number of characters read or
; 6047 2 ! written
; 6048 2 !
; 6049 2
; 6050 2 IF .START
; 6051 2 THEN
; 6052 3 BEGIN
; 6053 3 STR%POINTER = .POINTER;
; 6054 3 STR%ORG%LENGTH = .LENGTH;
; 6055 3 STR%LENGTH = .LENGTH;
; 6056 3 OLD%GET%CHR = .GET%CHR%ROUTINE;
; 6057 3 OLD%PUT%CHR = .PUT%CHR%ROUTINE;
; 6058 3 GET%CHR%ROUTINE = GET%STRING;
; 6059 3 PUT%CHR%ROUTINE = PUT%STRING;
; 6060 3 RETURN 0;
; 6061 3 END
; 6062 2 ELSE
; 6063 3 BEGIN
; 6064 3 GET%CHR%ROUTINE = .OLD%GET%CHR;
; 6065 3 PUT%CHR%ROUTINE = .OLD%PUT%CHR;
; 6066 3 RETURN .STR%ORG%LENGTH - .STR%LENGTH;
; 6067 2 END;
; 6068 2
; 6069 1 END; ! End of SET%STRING
; SET%STRING
U.30: MOVEI AC1,1 ; 6050
TDNN AC1,-1(SP)
JRST L.433
MOVE AC1,-3(SP) ; 6053
MOVEM AC1,U.94
MOVE AC1,-2(SP) ; 6054
MOVEM AC1,U.96
MOVE AC1,-2(SP) ; 6055
MOVEM AC1,U.95
MOVE AC1,U.67 ; 6056
MOVEM AC1,U.97
MOVE AC1,U.68 ; 6057
MOVEM AC1,U.98
MOVEI AC1,U.99 ; 6058
MOVEM AC1,U.67
MOVEI AC1,U.100 ; 6059
MOVEM AC1,U.68
SETZ AC1, ; 6063
POPJ SP,
L.433: MOVE AC1,U.97 ; 6064
MOVEM AC1,U.67
MOVE AC1,U.98 ; 6065
MOVEM AC1,U.68
MOVE AC1,U.96 ; 6066
SUB AC1,U.95
POPJ SP, ; 5948
; Routine Size: 26 words
; 6070 1 %SBTTL 'Add parity routine'
; 6071 1 ROUTINE DO%PARITY (MESSAGE, LENGTH) : NOVALUE =
; 6072 1
; 6073 1 !++
; 6074 1 ! FUNCTIONAL DESCRIPTION:
; 6075 1 !
; 6076 1 ! This routine will add parity for a complete message that is to be
; 6077 1 ! sent to the remote Kermit.
; 6078 1 !
; 6079 1 ! CALLING SEQUENCE:
; 6080 1 !
; 6081 1 ! DO%PARITY (Message%address, Message%length);
; 6082 1 !
; 6083 1 ! INPUT PARAMETERS:
; 6084 1 !
; 6085 1 ! Message%address - Address of the message to put parity on.
; 6086 1 ! Message%length - Lengtho of the message.
; 6087 1 !
; 6088 1 ! IMPLICIT INPUTS:
; 6089 1 !
; 6090 1 ! None.
; 6091 1 !
; 6092 1 ! OUTPUT PARAMETERS:
; 6093 1 !
; 6094 1 ! None.
; 6095 1 !
; 6096 1 ! IMPLICIT OUTPUTS:
; 6097 1 !
; 6098 1 ! None.
; 6099 1 !
; 6100 1 ! COMPLETION CODES:
; 6101 1 !
; 6102 1 ! None.
; 6103 1 !
; 6104 1 ! SIDE EFFECTS:
; 6105 1 !
; 6106 1 ! None.
; 6107 1 !
; 6108 1 !--
; 6109 1
; 6110 2 BEGIN
; 6111 2
; 6112 2 MAP
; 6113 2 MESSAGE : REF VECTOR [CH$ALLOCATION (MAX%MSG, CHR%SIZE)];
; 6114 2
; 6115 2 LOCAL
; 6116 2 POINTER; ! Point into the message
; 6117 2
; 6118 2 IF NOT .DEV%PARITY%FLAG
; 6119 2 THEN
; 6120 3 BEGIN
; 6121 3 POINTER = CH$PTR (.MESSAGE,, CHR%SIZE);
; 6122 3
; 6123 3 INCR I FROM 1 TO .LENGTH DO
; 6124 3 CH$WCHAR%A (GEN%PARITY (CH$RCHAR (.POINTER)), POINTER);
; 6125 3
; 6126 2 END;
; 6127 2
; 6128 1 END; ! End of DO%PARITY
; DO%PARITY
U.22: PUSH SP,AC13 ; 6071
PUSH SP,AC14
PUSH SP,AC16
MOVEI AC1,1 ; 6118
TDNE AC1,DEV%PARITY%FLAG
JRST L.436
MOVE AC1,-5(SP) ; 6121
MOVEI AC16,-1(AC1)
HRLI AC16,41000
MOVE AC13,-4(SP) ; 6123
SETZ AC14,
JRST L.435
L.434: MOVE AC1,AC16 ; 6124
ILDB AC1,AC1
PUSH SP,AC1
PUSHJ SP,U.23
IDPB AC1,AC16
ADJSP SP,-1
L.435: ADDI AC14,1 ; 6123
CAMG AC14,AC13
JRST L.434
L.436: POP SP,AC16 ; 6071
POP SP,AC14
POP SP,AC13
POPJ SP,
; Routine Size: 25 words
; 6129 1 %SBTTL 'Parity routine'
; 6130 1
; 6131 1 GLOBAL ROUTINE GEN%PARITY (CHARACTER) =
; 6132 1
; 6133 1 !++
; 6134 1 ! FUNCTIONAL DESCRIPTION:
; 6135 1 !
; 6136 1 ! This routine will add parity to the character that is supplied.
; 6137 1 !
; 6138 1 ! CALLING SEQUENCE:
; 6139 1 !
; 6140 1 ! CHARACTER = GEN%PARITY(CHARACTER)
; 6141 1 !
; 6142 1 ! INPUT PARAMETERS:
; 6143 1 !
; 6144 1 ! CHARACTER - Produce the parity for this character depending on the
; 6145 1 ! setting of the SET PARITY switch.
; 6146 1 !
; 6147 1 ! IMPLICIT INPUTS:
; 6148 1 !
; 6149 1 ! None.
; 6150 1 !
; 6151 1 ! OUTPUT PARAMETERS:
; 6152 1 !
; 6153 1 ! None.
; 6154 1 !
; 6155 1 ! IMPLICIT OUTPUTS:
; 6156 1 !
; 6157 1 ! None.
; 6158 1 !
; 6159 1 ! COMPLETION CODES:
; 6160 1 !
; 6161 1 ! None.
; 6162 1 !
; 6163 1 ! SIDE EFFECTS:
; 6164 1 !
; 6165 1 ! None.
; 6166 1 !
; 6167 1 !--
; 6168 1
; 6169 2 BEGIN
; 6170 2
; 6171 2 LOCAL
; 6172 2 TEMP%CHAR;
; 6173 2
; 6174 2
; 6175 2 CASE .PARITY%TYPE FROM PR%MIN TO PR%MAX OF
; 6176 2 SET
; 6177 2
; 6178 2 [PR%NONE] :
; 6179 2 RETURN .CHARACTER;
; 6180 2
; 6181 2 [PR%SPACE] :
; 6182 2 RETURN .CHARACTER AND %O'177';
; 6183 2
; 6184 2 [PR%MARK] :
; 6185 2 RETURN .CHARACTER OR %O'200';
; 6186 2
; 6187 2 [PR%ODD] :
; 6188 2 TEMP%CHAR = .CHARACTER AND %O'177' OR %O'200';
; 6189 2
; 6190 2 [PR%EVEN] :
; 6191 2 TEMP%CHAR = .CHARACTER AND %O'177';
; 6192 2 TES;
; 6193 2
; 6194 2 TEMP%CHAR = .TEMP%CHAR XOR (.TEMP%CHAR^-4);
; 6195 2 TEMP%CHAR = .TEMP%CHAR XOR (.TEMP%CHAR^-2);
; 6196 2
; 6197 2 IF .TEMP%CHAR<0, 2> EQL %B'01' OR .TEMP%CHAR<0, 2> EQL %B'10'
; 6198 2 THEN
; 6199 2 RETURN .CHARACTER AND %O'177' OR %O'200'
; 6200 2 ELSE
; 6201 2 RETURN .CHARACTER AND %O'177';
; 6202 2
; 6203 1 END; ! End of GEN%PARITY
U.23:
GEN%PARITY::
MOVE AC3,-1(SP) ; 6179
MOVE AC1,PARITY%TYPE ; 6175
JRST L.437(AC1)
L.437: JRST L.438
JRST L.439
JRST L.441
JRST L.440
JRST L.444
L.438: MOVE AC1,AC3 ; 6179
POPJ SP,
L.439: MOVE AC1,AC3 ; 6185
JRST L.443
L.440: LDB AC1,C.101 ; 6188
TROA AC1,200
L.441: LDB AC1,C.101 ; 6191
MOVE AC2,AC1 ; 6194
ASH AC2,-4
XOR AC1,AC2
MOVE AC2,AC1 ; 6195
ASH AC2,-2
XOR AC1,AC2
ANDI AC1,3 ; 6197
CAIN AC1,1
JRST L.442
CAIE AC1,2
JRST L.444
L.442: LDB AC1,C.101 ; 6199
L.443: TROA AC1,200
L.444: LDB AC1,C.101 ; 6201
POPJ SP, ; 6131
C.101: POINT 7,AC3,35
; Routine Size: 31 words
; 6204 1
; 6205 1 %SBTTL 'Per transfer -- Initialization'
; 6206 1 ROUTINE INIT%XFR : NOVALUE =
; 6207 1
; 6208 1 !++
; 6209 1 ! FUNCTIONAL DESCRIPTION:
; 6210 1 !
; 6211 1 ! This routine will initialize the various locations that the
; 6212 1 ! send and receive statistics are kept.
; 6213 1 !
; 6214 1 ! CALLING SEQUENCE:
; 6215 1 !
; 6216 1 ! INIT%XFR();
; 6217 1 !
; 6218 1 ! INPUT PARAMETERS:
; 6219 1 !
; 6220 1 ! None.
; 6221 1 !
; 6222 1 ! IMPLICIT INPUTS:
; 6223 1 !
; 6224 1 ! None.
; 6225 1 !
; 6226 1 ! OUTPUT PARAMETERS:
; 6227 1 !
; 6228 1 ! None.
; 6229 1 !
; 6230 1 ! IMPLICIT OUTPUTS:
; 6231 1 !
; 6232 1 ! None.
; 6233 1 !
; 6234 1 ! COMPLETION CODES:
; 6235 1 !
; 6236 1 ! None.
; 6237 1 !
; 6238 1 ! SIDE EFFECTS:
; 6239 1 !
; 6240 1 ! None.
; 6241 1 !
; 6242 1 !--
; 6243 1
; 6244 2 BEGIN
; 6245 2 !
; 6246 2 ! Determine if we should do 8 bit quoting
; 6247 2 !
; 6248 2
; 6249 2 IF .PARITY%TYPE NEQ PR%NONE
; 6250 2 THEN
; 6251 3 BEGIN
; 6252 3 RECV%8QUOTE%CHR = .RCV%8QUOTE%CHR;
; 6253 3 END
; 6254 2 ELSE
; 6255 3 BEGIN
; 6256 3 RECV%8QUOTE%CHR = %C'Y';
; 6257 2 END;
; 6258 2
; 6259 2 NUM%RETRIES = 0;
; 6260 2 SEND%8QUOTE%CHR = .RECV%8QUOTE%CHR;
; 6261 2 !
; 6262 2 ! Send parameters that may not get set before we need them for the first
; 6263 2 ! time.
; 6264 2 !
; 6265 2 SEND%PKT%SIZE = ABS (.SND%PKT%SIZE);
; 6266 2 SEND%NPAD = ABS (.SND%NPAD);
; 6267 2 SEND%PADCHAR = ABS (.SND%PADCHAR);
; 6268 2 SEND%TIMEOUT = ABS (.SND%TIMEOUT);
; 6269 2 SEND%EOL = ABS (.SND%EOL);
; 6270 2 SEND%QUOTE%CHR = ABS (.SND%QUOTE%CHR);
; 6271 2 !
; 6272 2 ! For initialization messages, we must use single character checksum
; 6273 2 ! When the send-init/ack sequence has been done, we will switch to the
; 6274 2 ! desired form
; 6275 2 !
; 6276 2 BLK%CHK%TYPE = CHK%1CHAR;
; 6277 2 INI%CHK%TYPE = .CHKTYPE; ! Send desired type
; 6278 2 !
; 6279 2 ! Set desired repeat character for use in we are doing send-init
; 6280 2 ! Will be overwritten by other ends desired character if it sends
; 6281 2 ! the send-init.
; 6282 2 !
; 6283 2 REPT%CHR = .SET%REPT%CHR;
; 6284 2 !
; 6285 2 ! Assume packet assembly/disassembly uses characters from a file
; 6286 2 !
; 6287 2 GET%CHR%ROUTINE = GET%FILE; ! Initialize the get-a-char routine
; 6288 2 PUT%CHR%ROUTINE = PUT%FILE; ! And the put-a-char
; 6289 2 TEXT%HEAD%FLAG = FALSE; ! And assume we will get an File header
; 6290 2 NO%FILE%NEEDED = FALSE; ! Assume will do file ops
; 6291 2 INIT%PKT%SENT = FALSE; ! And no server-init sent
; 6292 2 !
; 6293 2 ! Always start with packet number 0
; 6294 2 !
; 6295 2 MSG%NUMBER = 0; ! Initial message number
; 6296 2 !
; 6297 2 ! Stats information
; 6298 2 !
; 6299 2 SMSG%TOTAL%CHARS = 0;
; 6300 2 RMSG%TOTAL%CHARS = 0;
; 6301 2 SMSG%DATA%CHARS = 0;
; 6302 2 RMSG%DATA%CHARS = 0;
; 6303 2 SMSG%COUNT = 0;
; 6304 2 RMSG%COUNT = 0;
; 6305 2 RMSG%NAKS = 0;
; 6306 2 SMSG%NAKS = 0;
; 6307 2 XFR%TIME = SY%TIME ();
; 6308 1 END; ! End of INIT%XFR
; INIT%XFR
U.32: SKIPE PARITY%TYPE ; 6249
SKIPA AC1,RCV%8QUOTE%CHR ; 6252
MOVEI AC1,131 ; 6256
MOVEM AC1,U.37
SETZM U.54 ; 6259
MOVE AC1,U.37 ; 6260
MOVEM AC1,U.45
MOVE AC1,SND%PKT%SIZE ; 6265
MOVMM AC1,U.40
MOVE AC1,SND%NPAD ; 6266
MOVMM AC1,U.41
MOVE AC1,SND%PADCHAR ; 6267
MOVMM AC1,U.42
MOVE AC1,SND%TIMEOUT ; 6268
MOVMM AC1,SEND%TIMEOUT
MOVE AC1,SND%EOL ; 6269
MOVMM AC1,U.43
MOVE AC1,SND%QUOTE%CHR ; 6270
MOVMM AC1,U.44
MOVEI AC1,61 ; 6276
MOVEM AC1,U.48
MOVE AC1,CHKTYPE ; 6277
MOVEM AC1,U.47
MOVE AC1,SET%REPT%CHR ; 6283
MOVEM AC1,U.38
MOVEI AC1,GET%FILE ; 6287
MOVEM AC1,U.67
MOVEI AC1,PUT%FILE ; 6288
MOVEM AC1,U.68
SETZM U.62 ; 6289
SETZM U.63 ; 6290
SETZM U.64 ; 6291
SETZM U.55 ; 6295
SETZM SMSG%TOTAL%CHARS ; 6299
SETZM RMSG%TOTAL%CHARS ; 6300
SETZM SMSG%DATA%CHARS ; 6301
SETZM RMSG%DATA%CHARS ; 6302
SETZM SMSG%COUNT ; 6303
SETZM RMSG%COUNT ; 6304
SETZM RMSG%NAKS ; 6305
SETZM SMSG%NAKS ; 6306
PUSHJ SP,SY%TIME ; 6307
MOVEM AC1,XFR%TIME
POPJ SP, ; 6206
; Routine Size: 44 words
; 6309 1 %SBTTL 'Statistics -- Finish message transfer'
; 6310 1 ROUTINE END%STATS : NOVALUE =
; 6311 1
; 6312 1 !++
; 6313 1 ! FUNCTIONAL DESCRIPTION:
; 6314 1 !
; 6315 1 ! This routine will end the collection of the statistices. It will
; 6316 1 ! update the various overall statistic parameters.
; 6317 1 !
; 6318 1 ! CALLING SEQUENCE:
; 6319 1 !
; 6320 1 ! END%STATS ();
; 6321 1 !
; 6322 1 ! INPUT PARAMETERS:
; 6323 1 !
; 6324 1 ! None.
; 6325 1 !
; 6326 1 ! IMPLICIT INPUTS:
; 6327 1 !
; 6328 1 ! None.
; 6329 1 !
; 6330 1 ! OUTPUT PARAMETERS:
; 6331 1 !
; 6332 1 ! None.
; 6333 1 !
; 6334 1 ! IMPLICIT OUTPUTS:
; 6335 1 !
; 6336 1 ! None.
; 6337 1 !
; 6338 1 ! COMPLETION CODES:
; 6339 1 !
; 6340 1 ! None.
; 6341 1 !
; 6342 1 ! SIDE EFFECTS:
; 6343 1 !
; 6344 1 ! None.
; 6345 1 !
; 6346 1 !--
; 6347 1
; 6348 2 BEGIN
; 6349 2 SND%COUNT = .SND%COUNT + .SMSG%COUNT;
; 6350 2 RCV%COUNT = .RCV%COUNT + .RMSG%COUNT;
; 6351 2 SND%TOTAL%CHARS = .SND%TOTAL%CHARS + .SMSG%TOTAL%CHARS;
; 6352 2 SND%DATA%CHARS = .SND%DATA%CHARS + .SMSG%DATA%CHARS;
; 6353 2 RCV%TOTAL%CHARS = .RCV%TOTAL%CHARS + .RMSG%TOTAL%CHARS;
; 6354 2 RCV%DATA%CHARS = .RCV%DATA%CHARS + .RMSG%DATA%CHARS;
; 6355 2 SND%NAKS = .SND%NAKS + .SMSG%NAKS;
; 6356 2 RCV%NAKS = .RCV%NAKS + .RMSG%NAKS;
; 6357 2 XFR%TIME = SY%TIME () - .XFR%TIME;
; 6358 2 TOTAL%TIME = .TOTAL%TIME + .XFR%TIME;
; 6359 1 END; ! End of END%STATS
; END%STATS
U.18: MOVE AC1,SMSG%COUNT ; 6349
ADDM AC1,SND%COUNT
MOVE AC1,RMSG%COUNT ; 6350
ADDM AC1,RCV%COUNT
MOVE AC1,SMSG%TOTAL%CHARS ; 6351
ADDM AC1,SND%TOTAL%CHARS
MOVE AC1,SMSG%DATA%CHARS ; 6352
ADDM AC1,SND%DATA%CHARS
MOVE AC1,RMSG%TOTAL%CHARS ; 6353
ADDM AC1,RCV%TOTAL%CHARS
MOVE AC1,RMSG%DATA%CHARS ; 6354
ADDM AC1,RCV%DATA%CHARS
MOVE AC1,SMSG%NAKS ; 6355
ADDM AC1,SND%NAKS
MOVE AC1,RMSG%NAKS ; 6356
ADDM AC1,RCV%NAKS
PUSHJ SP,SY%TIME ; 6357
SUBB AC1,XFR%TIME
ADDM AC1,TOTAL%TIME ; 6358
POPJ SP, ; 6310
; Routine Size: 20 words
; 6360 1 %SBTTL 'Status type out -- STS%OUTPUT'
; 6361 1 ROUTINE STS%OUTPUT : NOVALUE =
; 6362 1
; 6363 1 !++
; 6364 1 ! FUNCTIONAL DESCRIPTION:
; 6365 1 !
; 6366 1 ! This routine will output the current status of a transfer.
; 6367 1 ! This is used when the user types a ^A during a transfer.
; 6368 1 !
; 6369 1 ! CALLING SEQUENCE:
; 6370 1 !
; 6371 1 ! STS%OUTPUT ()
; 6372 1 !
; 6373 1 ! INPUT PARAMETERS:
; 6374 1 !
; 6375 1 ! None.
; 6376 1 !
; 6377 1 ! IMPLICIT INPUTS:
; 6378 1 !
; 6379 1 ! Statistics blocks, file names, etc.
; 6380 1 !
; 6381 1 ! OUPTUT PARAMETERS:
; 6382 1 !
; 6383 1 ! None.
; 6384 1 !
; 6385 1 ! IMPLICIT OUTPUTS:
; 6386 1 !
; 6387 1 ! None.
; 6388 1 !
; 6389 1 ! COMPLETION CODES:
; 6390 1 !
; 6391 1 ! None.
; 6392 1 !
; 6393 1 ! SIDE EFFECTS:
; 6394 1 !
; 6395 1 ! None.
; 6396 1 !
; 6397 1 !--
; 6398 1
; 6399 2 BEGIN
; 6400 2 TT%CHAR (%C'['); ! Start the message
; 6401 2
; 6402 2 CASE .STATE FROM STATE%MIN TO STATE%MAX OF
; 6403 2 SET
; 6404 2
; 6405 2 [STATE%ID, STATE%II] :
; 6406 2 TT%TEXT (UPLIT (%ASCIZ'Idle in server mode'));
; 6407 2
; 6408 2 [STATE%S, STATE%SF] :
; 6409 3 BEGIN
; 6410 3 TT%TEXT (UPLIT (%ASCIZ'Initializing for sending file '));
; 6411 3 TT%TEXT (FILE%NAME);
; 6412 2 END;
; 6413 2
; 6414 2 [STATE%SI] :
; 6415 2 TT%TEXT (UPLIT (%ASCIZ'Initializing for remote command'));
; 6416 2
; 6417 2 [STATE%SG] :
; 6418 2 TT%TEXT (UPLIT (%ASCIZ'Waiting for response to remote command'));
; 6419 2
; 6420 2 [STATE%SD] :
; 6421 3 BEGIN
; 6422 3 TT%NUMBER (.FILE%CHARS);
; 6423 3 TT%TEXT (UPLIT (%ASCIZ' characters sent for file '));
; 6424 3 TT%TEXT (FILE%NAME);
; 6425 2 END;
; 6426 2
; 6427 2 [STATE%SZ] :
; 6428 3 BEGIN
; 6429 3 TT%TEXT (UPLIT (%ASCIZ'At end of file '));
; 6430 3 TT%TEXT (FILE%NAME);
; 6431 2 END;
; 6432 2
; 6433 2 [STATE%SB] :
; 6434 2 TT%TEXT (UPLIT (%ASCIZ'Finishing transfer session'));
; 6435 2
; 6436 2 [STATE%R] :
; 6437 2 TT%TEXT (UPLIT (%ASCIZ'Waiting for initialization'));
; 6438 2
; 6439 2 [STATE%RF] :
; 6440 2 TT%TEXT (UPLIT (%ASCIZ'Waiting for next file or end of session'));
; 6441 2
; 6442 2 [STATE%RD] :
; 6443 3 BEGIN
; 6444 3 TT%NUMBER (.FILE%CHARS);
; 6445 3 TT%TEXT (UPLIT (%ASCIZ' characters received for file '));
; 6446 3 TT%TEXT (FILE%NAME);
; 6447 2 END;
; 6448 2
; 6449 2 [STATE%C] :
; 6450 2 TT%TEXT (UPLIT (%ASCIZ' Session complete'));
; 6451 2
; 6452 2 [STATE%A] :
; 6453 2 TT%TEXT (UPLIT (%ASCIZ' Session aborted'));
; 6454 2
; 6455 2 [INRANGE, OUTRANGE] :
; 6456 2 TT%TEXT (UPLIT (%ASCIZ' Unknown state'));
; 6457 2 TES;
; 6458 2
; 6459 2 SELECTONE .STATE OF
; 6460 2 SET
; 6461 2
; 6462 2 [STATE%S, STATE%SF, STATE%SD, STATE%SZ, STATE%SB] :
; 6463 3 BEGIN
; 6464 3
; 6465 3 IF .RMSG%NAKS GTR 0
; 6466 3 THEN
; 6467 4 BEGIN
; 6468 4 TT%TEXT (UPLIT (%ASCIZ', '));
; 6469 4 TT%NUMBER (.RMSG%NAKS);
; 6470 4 TT%TEXT (UPLIT (%ASCIZ' NAKs received'));
; 6471 3 END;
; 6472 3
; 6473 2 END;
; 6474 2
; 6475 2 [STATE%R, STATE%RF, STATE%RD] :
; 6476 3 BEGIN
; 6477 3
; 6478 3 IF .SMSG%NAKS GTR 0
; 6479 3 THEN
; 6480 4 BEGIN
; 6481 4 TT%TEXT (UPLIT (%ASCIZ', '));
; 6482 4 TT%NUMBER (.SMSG%NAKS);
; 6483 4 TT%TEXT (UPLIT (%ASCIZ' NAKs sent'));
; 6484 3 END;
; 6485 3
; 6486 2 END;
; 6487 2 TES;
; 6488 2
; 6489 2 TT%CHAR (%C']'); ! End the line
; 6490 2 TT%CRLF (); ! with a CRLF
; 6491 1 END; ! End of STS%OUTPUT
P.AAO: BYTE (7)"I","d","l","e"," "
BYTE (7)"i","n"," ","s","e"
BYTE (7)"r","v","e","r"," "
BYTE (7)"m","o","d","e",000
P.AAP: BYTE (7)"I","n","i","t","i"
BYTE (7)"a","l","i","z","i"
BYTE (7)"n","g"," ","f","o"
BYTE (7)"r"," ","s","e","n"
BYTE (7)"d","i","n","g"," "
BYTE (7)"f","i","l","e"," "
BYTE (7)000,000,000,000,000
P.AAQ: BYTE (7)"I","n","i","t","i"
BYTE (7)"a","l","i","z","i"
BYTE (7)"n","g"," ","f","o"
BYTE (7)"r"," ","r","e","m"
BYTE (7)"o","t","e"," ","c"
BYTE (7)"o","m","m","a","n"
BYTE (7)"d",000,000,000,000
P.AAR: BYTE (7)"W","a","i","t","i"
BYTE (7)"n","g"," ","f","o"
BYTE (7)"r"," ","r","e","s"
BYTE (7)"p","o","n","s","e"
BYTE (7)" ","t","o"," ","r"
BYTE (7)"e","m","o","t","e"
BYTE (7)" ","c","o","m","m"
BYTE (7)"a","n","d",000,000
P.AAS: BYTE (7)" ","c","h","a","r"
BYTE (7)"a","c","t","e","r"
BYTE (7)"s"," ","s","e","n"
BYTE (7)"t"," ","f","o","r"
BYTE (7)" ","f","i","l","e"
BYTE (7)" ",000,000,000,000
P.AAT: BYTE (7)"A","t"," ","e","n"
BYTE (7)"d"," ","o","f"," "
BYTE (7)"f","i","l","e"," "
BYTE (7)000,000,000,000,000
P.AAU: BYTE (7)"F","i","n","i","s"
BYTE (7)"h","i","n","g"," "
BYTE (7)"t","r","a","n","s"
BYTE (7)"f","e","r"," ","s"
BYTE (7)"e","s","s","i","o"
BYTE (7)"n",000,000,000,000
P.AAV: BYTE (7)"W","a","i","t","i"
BYTE (7)"n","g"," ","f","o"
BYTE (7)"r"," ","i","n","i"
BYTE (7)"t","i","a","l","i"
BYTE (7)"z","a","t","i","o"
BYTE (7)"n",000,000,000,000
P.AAW: BYTE (7)"W","a","i","t","i"
BYTE (7)"n","g"," ","f","o"
BYTE (7)"r"," ","n","e","x"
BYTE (7)"t"," ","f","i","l"
BYTE (7)"e"," ","o","r"," "
BYTE (7)"e","n","d"," ","o"
BYTE (7)"f"," ","s","e","s"
BYTE (7)"s","i","o","n",000
P.AAX: BYTE (7)" ","c","h","a","r"
BYTE (7)"a","c","t","e","r"
BYTE (7)"s"," ","r","e","c"
BYTE (7)"e","i","v","e","d"
BYTE (7)" ","f","o","r"," "
BYTE (7)"f","i","l","e"," "
BYTE (7)000,000,000,000,000
P.AAY: BYTE (7)" ","S","e","s","s"
BYTE (7)"i","o","n"," ","c"
BYTE (7)"o","m","p","l","e"
BYTE (7)"t","e",000,000,000
P.AAZ: BYTE (7)" ","S","e","s","s"
BYTE (7)"i","o","n"," ","a"
BYTE (7)"b","o","r","t","e"
BYTE (7)"d",000,000,000,000
P.ABA: BYTE (7)" ","U","n","k","n"
BYTE (7)"o","w","n"," ","s"
BYTE (7)"t","a","t","e",000
P.ABB: BYTE (7)","," ",000,000,000
P.ABC: BYTE (7)" ","N","A","K","s"
BYTE (7)" ","r","e","c","e"
BYTE (7)"i","v","e","d",000
P.ABD: BYTE (7)","," ",000,000,000
P.ABE: BYTE (7)" ","N","A","K","s"
BYTE (7)" ","s","e","n","t"
BYTE (7)000,000,000,000,000
; STS%OUTPUT
U.33: PUSH SP,C.102 ; 6400
PUSHJ SP,TT%CHAR
MOVE AC1,U.51 ; 6402
SOJL AC1,L.446
CAIGE AC1,24
JRST L.445(AC1)
JRST L.446
L.445: JRST L.448
JRST L.448
JRST L.451
JRST L.452
JRST L.454
JRST L.455
JRST L.456
JRST L.457
JRST L.459
JRST L.460
JRST L.446
JRST L.450
JRST L.449
JRST L.447
JRST L.447
JRST L.446
JRST L.446
JRST L.446
JRST L.446
JRST L.446
L.446: PUSH SP,C.103 ; 6456
JRST L.461
L.447: PUSH SP,C.104 ; 6406
JRST L.461
L.448: PUSH SP,C.105 ; 6410
JRST L.453
L.449: PUSH SP,C.106 ; 6415
JRST L.461
L.450: PUSH SP,C.107 ; 6418
JRST L.461
L.451: PUSH SP,U.61 ; 6422
PUSHJ SP,TT%NUMBER
PUSH SP,C.108 ; 6423
JRST L.458
L.452: PUSH SP,C.109 ; 6429
L.453: PUSHJ SP,TT%TEXT
PUSH SP,C.34 ; 6430
PUSHJ SP,TT%TEXT
ADJSP SP,-1 ; 6428
JRST L.462 ; 6402
L.454: PUSH SP,C.110 ; 6434
JRST L.461
L.455: PUSH SP,C.111 ; 6437
JRST L.461
L.456: PUSH SP,C.112 ; 6440
JRST L.461
L.457: PUSH SP,U.61 ; 6444
PUSHJ SP,TT%NUMBER
PUSH SP,C.113 ; 6445
L.458: PUSHJ SP,TT%TEXT
PUSH SP,C.34 ; 6446
PUSHJ SP,TT%TEXT
ADJSP SP,-2 ; 6443
JRST L.462 ; 6402
L.459: PUSH SP,C.114 ; 6450
JRST L.461
L.460: PUSH SP,C.115 ; 6453
L.461: PUSHJ SP,TT%TEXT
L.462: MOVE AC1,U.51 ; 6459
JUMPLE AC1,L.463 ; 6462
CAILE AC1,5
JRST L.463
SKIPG RMSG%NAKS ; 6465
JRST L.465
PUSH SP,C.116 ; 6468
PUSHJ SP,TT%TEXT
PUSH SP,RMSG%NAKS ; 6469
PUSHJ SP,TT%NUMBER
PUSH SP,C.117 ; 6470
JRST L.464
L.463: CAIL AC1,6 ; 6475
CAILE AC1,10
JRST L.465
SKIPG SMSG%NAKS ; 6478
JRST L.465
PUSH SP,C.118 ; 6481
PUSHJ SP,TT%TEXT
PUSH SP,SMSG%NAKS ; 6482
PUSHJ SP,TT%NUMBER
PUSH SP,C.119 ; 6483
L.464: PUSHJ SP,TT%TEXT
ADJSP SP,-3 ; 6480
L.465: PUSH SP,C.120 ; 6489
PUSHJ SP,TT%CHAR
PUSHJ SP,TT%CRLF ; 6490
ADJSP SP,-3 ; 6399
POPJ SP, ; 6361
C.102: EXP 133
C.103: XWD 0,P.ABA
C.104: XWD 0,P.AAO
C.105: XWD 0,P.AAP
C.106: XWD 0,P.AAQ
C.107: XWD 0,P.AAR
C.108: XWD 0,P.AAS
C.109: XWD 0,P.AAT
C.110: XWD 0,P.AAU
C.111: XWD 0,P.AAV
C.112: XWD 0,P.AAW
C.113: XWD 0,P.AAX
C.114: XWD 0,P.AAY
C.115: XWD 0,P.AAZ
C.116: XWD 0,P.ABB
C.117: XWD 0,P.ABC
C.118: XWD 0,P.ABD
C.119: XWD 0,P.ABE
C.120: EXP 135
; Routine Size: 113 words
; 6492 1 %SBTTL 'TYPE%CHAR - Type out a character'
; 6493 1 ROUTINE TYPE%CHAR (CHARACTER) =
; 6494 1
; 6495 1 !++
; 6496 1 ! FUNCTIONAL DESCRIPTION:
; 6497 1 !
; 6498 1 ! This routine is used as an alternate output routine for BFR%EMPTY.
; 6499 1 ! It will type the character on the terminal, and always return a
; 6500 1 ! true status.
; 6501 1 !
; 6502 1 ! CALLING SEQUENCE:
; 6503 1 !
; 6504 1 ! STATUS = TYPE%CHAR (.CHARACTER);
; 6505 1 !
; 6506 1 ! INPUT PARAMETERS:
; 6507 1 !
; 6508 1 ! CHARACTER - The character to type
; 6509 1 !
; 6510 1 ! IMPLICIT INPUTS:
; 6511 1 !
; 6512 1 ! None.
; 6513 1 !
; 6514 1 ! OUPTUT PARAMETERS:
; 6515 1 !
; 6516 1 ! None.
; 6517 1 !
; 6518 1 ! IMPLICIT OUTPUTS:
; 6519 1 !
; 6520 1 ! None.
; 6521 1 !
; 6522 1 ! COMPLETION CODES:
; 6523 1 !
; 6524 1 ! None.
; 6525 1 !
; 6526 1 ! SIDE EFFECTS:
; 6527 1 !
; 6528 1 ! None.
; 6529 1 !
; 6530 1 !--
; 6531 1
; 6532 2 BEGIN
; 6533 2 TT%CHAR (.CHARACTER); ! Type the character
; 6534 2 RETURN KER%NORMAL; ! And return OK
; 6535 1 END; ! End of TYPE%CHAR
; TYPE%CHAR
U.31: PUSH SP,-1(SP) ; 6533
PUSHJ SP,TT%CHAR
ADJSP SP,-1 ; 6534
MOVEI AC1,13 ; 6532
POPJ SP, ; 6493
; Routine Size: 5 words
; 6536 1 %SBTTL 'Debugging -- DBG%SEND'
; 6537 1 ROUTINE DBG%SEND (ADDRESS, LENGTH) : NOVALUE =
; 6538 1
; 6539 1 !++
; 6540 1 ! FUNCTIONAL DESCRIPTION:
; 6541 1 !
; 6542 1 ! This routine will output the message that is going to be sent
; 6543 1 ! as part of the debugging information that is turned on in the
; 6544 1 ! SET DEBUG command.
; 6545 1 !
; 6546 1 ! CALLING SEQUENCE:
; 6547 1 !
; 6548 1 ! DBG%SEND(MSG%ADDRESS, MSG%LENGTH);
; 6549 1 !
; 6550 1 ! INPUT PARAMETERS:
; 6551 1 !
; 6552 1 ! MSG%ADDRESS - Address of the message that is going to be sent
; 6553 1 ! to the remote KERMIT. The bytes are CHR%SIZE.
; 6554 1 ! MSG%LENGTH - Length of the message.
; 6555 1 !
; 6556 1 ! IMPLICIT INPUTS:
; 6557 1 !
; 6558 1 ! None.
; 6559 1 !
; 6560 1 ! OUTPUT PARAMETERS:
; 6561 1 !
; 6562 1 ! None.
; 6563 1 !
; 6564 1 ! IMPLICIT OUTPUTS:
; 6565 1 !
; 6566 1 ! None.
; 6567 1 !
; 6568 1 ! COMPLETION CODES:
; 6569 1 !
; 6570 1 ! None.
; 6571 1 !
; 6572 1 ! SIDE EFFECTS:
; 6573 1 !
; 6574 1 ! None.
; 6575 1 !
; 6576 1 !--
; 6577 1
; 6578 2 BEGIN
; 6579 2
; 6580 2 BIND
; 6581 2 SEND%TEXT = UPLIT (%ASCIZ'Sending...');
; 6582 2
; 6583 2 IF .DEBUG%FLAG
; 6584 2 THEN
; 6585 3 BEGIN
; 6586 3
; 6587 3 LOCAL
; 6588 3 OLD%RTN;
; 6589 3
; 6590 3 OLD%RTN = TT%SET%OUTPUT (DBG%DUMP);
; 6591 3 TT%TEXT (SEND%TEXT);
; 6592 3 DBG%MESSAGE (.ADDRESS, .LENGTH);
; 6593 3 TT%SET%OUTPUT (.OLD%RTN);
; 6594 2 END;
; 6595 2
; 6596 1 END; ! End of DBG%SEND
P.ABF: BYTE (7)"S","e","n","d","i"
BYTE (7)"n","g",".",".","."
BYTE (7)000,000,000,000,000
; SEND%TEXT
U.102= P.ABF
; DBG%SEND
U.35: PUSH SP,AC16 ; 6537
MOVEI AC1,1 ; 6583
TDNN AC1,DEBUG%FLAG
JRST L.466
PUSH SP,C.88 ; 6590
PUSHJ SP,TT%SET%OUTPUT
MOVE AC16,AC1
PUSH SP,C.121 ; 6591
PUSHJ SP,TT%TEXT
PUSH SP,-5(SP) ; 6592
PUSH SP,-5(SP)
PUSHJ SP,U.34
MOVEM AC16,0(SP) ; 6593
PUSHJ SP,TT%SET%OUTPUT
ADJSP SP,-4 ; 6585
L.466: POP SP,AC16 ; 6537
POPJ SP,
C.121: XWD 0,U.102
; Routine Size: 18 words
; 6597 1 %SBTTL 'Debugging -- DBG%RECEIVE'
; 6598 1 ROUTINE DBG%RECEIVE (ADDRESS) : NOVALUE =
; 6599 1
; 6600 1 !++
; 6601 1 ! FUNCTIONAL DESCRIPTION:
; 6602 1 !
; 6603 1 ! This routine will output the message that was received from
; 6604 1 ! the remote KERMIT. This routine is called only if the DEBUG%FLAG
; 6605 1 ! is true.
; 6606 1 !
; 6607 1 ! CALLING SEQUENCE:
; 6608 1 !
; 6609 1 ! DBG%RECEIVE(MSG%ADDRESS);
; 6610 1 !
; 6611 1 ! INPUT PARAMETERS:
; 6612 1 !
; 6613 1 ! MSG%ADDRESS - Address of the message received by the remote KERMIT.
; 6614 1 !
; 6615 1 ! IMPLICIT INPUTS:
; 6616 1 !
; 6617 1 ! None.
; 6618 1 !
; 6619 1 ! OUTPUT PARAMETERS:
; 6620 1 !
; 6621 1 ! None.
; 6622 1 !
; 6623 1 ! IMPLICIT OUTPUTS:
; 6624 1 !
; 6625 1 ! None.
; 6626 1 !
; 6627 1 ! COMPLETION CODES:
; 6628 1 !
; 6629 1 ! None.
; 6630 1 !
; 6631 1 ! SIDE EFFECTS:
; 6632 1 !
; 6633 1 ! None.
; 6634 1 !
; 6635 1 !--
; 6636 1
; 6637 2 BEGIN
; 6638 2
; 6639 2 BIND
; 6640 2 RECEIVE%TEXT = UPLIT (%ASCIZ'Received...');
; 6641 2
; 6642 2 IF .DEBUG%FLAG
; 6643 2 THEN
; 6644 3 BEGIN
; 6645 3
; 6646 3 LOCAL
; 6647 3 OLD%RTN;
; 6648 3
; 6649 3 OLD%RTN = TT%SET%OUTPUT (DBG%DUMP);
; 6650 3 TT%TEXT (RECEIVE%TEXT);
; 6651 3 DBG%MESSAGE (.ADDRESS, .REC%LENGTH);
; 6652 3 TT%SET%OUTPUT (.OLD%RTN);
; 6653 2 END;
; 6654 2
; 6655 1 END; ! End of DBG%RECEIVE
P.ABG: BYTE (7)"R","e","c","e","i"
BYTE (7)"v","e","d",".","."
BYTE (7)".",000,000,000,000
; RECEIVE%TEXT
U.103= P.ABG
; DBG%RECEIVE
U.36: PUSH SP,AC16 ; 6598
MOVEI AC1,1 ; 6642
TDNN AC1,DEBUG%FLAG
JRST L.467
PUSH SP,C.88 ; 6649
PUSHJ SP,TT%SET%OUTPUT
MOVE AC16,AC1
PUSH SP,C.122 ; 6650
PUSHJ SP,TT%TEXT
PUSH SP,-4(SP) ; 6651
PUSH SP,U.57
PUSHJ SP,U.34
MOVEM AC16,0(SP) ; 6652
PUSHJ SP,TT%SET%OUTPUT
ADJSP SP,-4 ; 6644
L.467: POP SP,AC16 ; 6598
POPJ SP,
C.122: XWD 0,U.103
; Routine Size: 18 words
; 6656 1 %SBTTL 'Debugging -- DBG%MESSAGE'
; 6657 1 ROUTINE DBG%MESSAGE (MSG%ADDRESS, MSG%LENGTH) : NOVALUE =
; 6658 1
; 6659 1 !++
; 6660 1 ! FUNCTIONAL DESCRIPTION:
; 6661 1 !
; 6662 1 ! This routine will display a message that is either being sent
; 6663 1 ! or received on the user's terminal.
; 6664 1 !
; 6665 1 ! CALLING SEQUENCE:
; 6666 1 !
; 6667 1 ! DBG%MESSAGE(MSG%ADDRESS, MSG%LENGTH);
; 6668 1 !
; 6669 1 ! INPUT PARAMETERS:
; 6670 1 !
; 6671 1 ! MSG%ADDRESS - Address of the message to be output
; 6672 1 ! MSG%LENGTH - Length of the message to be output.
; 6673 1 !
; 6674 1 ! IMPLICIT INPUTS:
; 6675 1 !
; 6676 1 ! None.
; 6677 1 !
; 6678 1 ! OUTPUT PARAMETERS:
; 6679 1 !
; 6680 1 ! None.
; 6681 1 !
; 6682 1 ! IMPLICIT OUTPUTS:
; 6683 1 !
; 6684 1 ! None.
; 6685 1 !
; 6686 1 ! COMPLETION CODES:
; 6687 1 !
; 6688 1 ! None.
; 6689 1 !
; 6690 1 ! SIDE EFFECTS:
; 6691 1 !
; 6692 1 ! None.
; 6693 1 !
; 6694 1 !--
; 6695 1
; 6696 2 BEGIN
; 6697 2
; 6698 2 MAP
; 6699 2 MSG%ADDRESS : REF VECTOR [CH$ALLOCATION (MAX%MSG, CHR%SIZE)]; ! Point to the vector
; 6700 2
; 6701 2 LOCAL
; 6702 2 OLD%RTN, ! Old type out routine
; 6703 2 CHKSUM, ! Numeric value of block check
; 6704 2 TEMP%POINTER, ! Temporary character pointer
; 6705 2 MSG%MSG, ! [108] ! Starting point for data
; 6706 2 MSG%LEN;
; 6707 2
; 6708 2 !
; 6709 2 ! Message type text
; 6710 2 !
; 6711 2
; 6712 2 BIND
; 6713 2 DATA%TEXT = UPLIT (%ASCIZ' (Data)'),
; 6714 2 ACK%TEXT = UPLIT (%ASCIZ' (ACK)'),
; 6715 2 NAK%TEXT = UPLIT (%ASCIZ' (NAK)'),
; 6716 2 SND%INIT%TEXT = UPLIT (%ASCIZ' (Send init)'),
; 6717 2 BREAK%TEXT = UPLIT (%ASCIZ' (Break)'),
; 6718 2 TEXT%TEXT = UPLIT (%ASCIZ' (Text header)'),
; 6719 2 FILE%TEXT = UPLIT (%ASCIZ' (File header)'),
; 6720 2 EOF%TEXT = UPLIT (%ASCIZ' (EOF)'),
; 6721 2 ERROR%TEXT = UPLIT (%ASCIZ' (Error)'),
; 6722 2 RCV%INIT%TEXT = UPLIT (%ASCIZ' (Receive initiate)'),
; 6723 2 COMMAND%TEXT = UPLIT (%ASCIZ' (Command)'),
; 6724 2 KERMIT%TEXT = UPLIT (%ASCIZ' (Generic KERMIT command)');
; 6725 2
; 6726 2 !
; 6727 2 ! Header information
; 6728 2 !
; 6729 2
; 6730 2 BIND
; 6731 2 MN%TEXT = UPLIT (%ASCIZ'Message number: '),
; 6732 2 LENGTH%TEXT = UPLIT (%ASCIZ' Length: '),
; 6733 2 DEC%TEXT = UPLIT (%ASCIZ' (dec)'),
; 6734 2 MSG%TYP%TEXT = UPLIT (%ASCIZ'Message type: '),
; 6735 2 CHKSUM%TEXT = UPLIT (%ASCIZ'Checksum: '),
; 6736 2 CHKSUM%NUM%TEXT = UPLIT (%ASCIZ' = '),
; 6737 2 OPT%DATA%TEXT = UPLIT (%ASCIZ'Optional data: '),
; 6738 2 PRE%CHAR%TEXT = UPLIT (%ASCIZ' "');
; 6739 2
; 6740 2 !
; 6741 2 ! Ensure that the type out will go to the debugging location
; 6742 2 !
; 6743 2 OLD%RTN = TT%SET%OUTPUT (DBG%DUMP);
; 6744 2 !
; 6745 2 ! Preliminary calculations
; 6746 2 !
; 6747 2 MSG%LEN = UNCHAR (CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%COUNT, CHR%SIZE)));
; 6748 2 MSG%MSG = PKT%MSG; ! [108]
; 6749 2 IF .MSG%LEN EQL 0 ! [108]
; 6750 2 THEN ! [108]
; 6751 3 BEGIN ! [108]
; 6752 3 MSG%LEN = UNCHAR (CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%COUNTX1, CHR%SIZE))) * 95 +
; 6753 3 UNCHAR (CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%COUNTX2, CHR%SIZE))) +
; 6754 3 PKT%HCHECK - 1; ! [108]
; 6755 3 MSG%MSG = PKT%MSGX; ! [108]
; 6756 2 END; ! [108]
; 6757 2
; 6758 2 !
; 6759 2 ! First output some header information for the packet.
; 6760 2 !
; 6761 2 TT%CRLF ();
; 6762 2 TT%TEXT (MN%TEXT);
; 6763 2 TT%NUMBER (UNCHAR (CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%SEQ, CHR%SIZE))));
; 6764 2 TT%TEXT (DEC%TEXT);
; 6765 2 TT%TEXT (LENGTH%TEXT);
; 6766 2 TT%NUMBER (.MSG%LEN);
; 6767 2 TT%TEXT (DEC%TEXT);
; 6768 2 TT%CRLF ();
; 6769 2 !
; 6770 2 ! Now output the message type and dependent information
; 6771 2 !
; 6772 2 TT%TEXT (MSG%TYP%TEXT);
; 6773 2 TT%CHAR (CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%TYPE, CHR%SIZE)));
; 6774 2
; 6775 2 SELECTONE CH$RCHAR (CH$PTR (.MSG%ADDRESS, PKT%TYPE, CHR%SIZE)) OF
; 6776 2 SET
; 6777 2
; 6778 2 [MSG%DATA] :
; 6779 2 TT%TEXT (DATA%TEXT);
; 6780 2
; 6781 2 [MSG%ACK] :
; 6782 2 TT%TEXT (ACK%TEXT);
; 6783 2
; 6784 2 [MSG%NAK] :
; 6785 2 TT%TEXT (NAK%TEXT);
; 6786 2
; 6787 2 [MSG%SND%INIT] :
; 6788 2 TT%TEXT (SND%INIT%TEXT);
; 6789 2
; 6790 2 [MSG%BREAK] :
; 6791 2 TT%TEXT (BREAK%TEXT);
; 6792 2
; 6793 2 [MSG%FILE] :
; 6794 2 TT%TEXT (FILE%TEXT);
; 6795 2
; 6796 2 [MSG%TEXT] :
; 6797 2 TT%TEXT (TEXT%TEXT);
; 6798 2
; 6799 2 [MSG%EOF] :
; 6800 2 TT%TEXT (EOF%TEXT);
; 6801 2
; 6802 2 [MSG%ERROR] :
; 6803 2 TT%TEXT (ERROR%TEXT);
; 6804 2
; 6805 2 [MSG%GENERIC] :
; 6806 2 TT%TEXT (KERMIT%TEXT);
; 6807 2
; 6808 2 [MSG%COMMAND] :
; 6809 2 TT%TEXT (COMMAND%TEXT);
; 6810 2 TES;
; 6811 2
; 6812 2 TT%CRLF ();
; 6813 2 !
; 6814 2 ! Now output any of the optional data.
; 6815 2 !
; 6816 2
; 6817 2 IF .MSG%LEN - .MSG%MSG + 1 - (.BLK%CHK%TYPE - CHK%1CHAR) NEQ 0 ! [108]
; 6818 2 THEN
; 6819 3 BEGIN
; 6820 3 TT%TEXT (OPT%DATA%TEXT);
; 6821 3 TT%CRLF ();
; 6822 3 TEMP%POINTER = CH$PTR (.MSG%ADDRESS, .MSG%MSG, CHR%SIZE); ! [108]
; 6823 3
; 6824 3 INCR I FROM 1 TO .MSG%LEN - .MSG%MSG + 1 - (.BLK%CHK%TYPE - CHK%1CHAR) DO ! [108]
; 6825 4 BEGIN
; 6826 4
; 6827 4 IF (.I MOD 10) EQL 1
; 6828 4 THEN
; 6829 5 BEGIN
; 6830 5 TT%CRLF ();
; 6831 5 TT%CHAR (CHR%TAB);
; 6832 4 END;
; 6833 4
; 6834 4 TT%TEXT (PRE%CHAR%TEXT);
; 6835 4 TT%CHAR (CH$RCHAR%A (TEMP%POINTER));
; 6836 4 TT%CHAR (%C'"');
; 6837 3 END;
; 6838 3
; 6839 3 IF ((.MSG%LEN - .MSG%MSG + 1 - (.BLK%CHK%TYPE - CHK%1CHAR)) MOD 10) EQL 1 THEN TT%CRLF (); ! [108]
; 6840 3
; 6841 3 TT%CRLF ();
; 6842 2 END;
; 6843 2
; 6844 2 !
; 6845 2 ! Now output the checksum for the message that we received
; 6846 2 !
; 6847 2 ! This could be either 1 two or three characters.
; 6848 2 TT%TEXT (CHKSUM%TEXT);
; 6849 2 TEMP%POINTER = CH$PTR (.MSG%ADDRESS,
; 6850 2 .MSG%LEN + PKT%CHKSUM + 1 - (.BLK%CHK%TYPE - CHK%1CHAR), CHR%SIZE); ! [108]
; 6851 2
; 6852 2 CASE .BLK%CHK%TYPE FROM CHK%1CHAR TO CHK%CRC OF
; 6853 2 SET
; 6854 2
; 6855 2 [CHK%1CHAR] :
; 6856 3 BEGIN
; 6857 3 TT%TEXT (PRE%CHAR%TEXT);
; 6858 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6859 3 TT%CHAR (%C'"');
; 6860 3 CHKSUM = UNCHAR (CH$RCHAR (.TEMP%POINTER));
; 6861 2 END;
; 6862 2
; 6863 2 [CHK%2CHAR] :
; 6864 3 BEGIN
; 6865 3 CHKSUM = 0;
; 6866 3 TT%TEXT (PRE%CHAR%TEXT);
; 6867 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6868 3 TT%CHAR (%C'"');
; 6869 3 CHKSUM<6, 6> = UNCHAR (CH$RCHAR%A (TEMP%POINTER));
; 6870 3 TT%TEXT (PRE%CHAR%TEXT);
; 6871 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6872 3 TT%CHAR (%C'"');
; 6873 3 CHKSUM<0, 6> = UNCHAR (CH$RCHAR (.TEMP%POINTER));
; 6874 2 END;
; 6875 2
; 6876 2 [CHK%CRC] :
; 6877 3 BEGIN
; 6878 3 CHKSUM = 0;
; 6879 3 TT%TEXT (PRE%CHAR%TEXT);
; 6880 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6881 3 TT%CHAR (%C'"');
; 6882 3 CHKSUM<12, 4> = UNCHAR (CH$RCHAR%A (TEMP%POINTER));
; 6883 3 TT%TEXT (PRE%CHAR%TEXT);
; 6884 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6885 3 TT%CHAR (%C'"');
; 6886 3 CHKSUM<6, 6> = UNCHAR (CH$RCHAR%A (TEMP%POINTER));
; 6887 3 TT%TEXT (PRE%CHAR%TEXT);
; 6888 3 TT%CHAR (CH$RCHAR (.TEMP%POINTER));
; 6889 3 TT%CHAR (%C'"');
; 6890 3 CHKSUM<0, 6> = UNCHAR (CH$RCHAR (.TEMP%POINTER));
; 6891 2 END;
; 6892 2 TES;
; 6893 2
; 6894 2 TT%TEXT (CHKSUM%NUM%TEXT);
; 6895 2 TT%NUMBER (.CHKSUM);
; 6896 2 TT%TEXT (DEC%TEXT);
; 6897 2 TT%CRLF ();
; 6898 2 TT%SET%OUTPUT (.OLD%RTN); ! Reset output destination
; 6899 1 END; ! End of DBG%MESSAGE
P.ABH: BYTE (7)" ","(","D","a","t"
BYTE (7)"a",")",000,000,000
P.ABI: BYTE (7)" ","(","A","C","K"
BYTE (7)")",000,000,000,000
P.ABJ: BYTE (7)" ","(","N","A","K"
BYTE (7)")",000,000,000,000
P.ABK: BYTE (7)" ","(","S","e","n"
BYTE (7)"d"," ","i","n","i"
BYTE (7)"t",")",000,000,000
P.ABL: BYTE (7)" ","(","B","r","e"
BYTE (7)"a","k",")",000,000
P.ABM: BYTE (7)" ","(","T","e","x"
BYTE (7)"t"," ","h","e","a"
BYTE (7)"d","e","r",")",000
P.ABN: BYTE (7)" ","(","F","i","l"
BYTE (7)"e"," ","h","e","a"
BYTE (7)"d","e","r",")",000
P.ABO: BYTE (7)" ","(","E","O","F"
BYTE (7)")",000,000,000,000
P.ABP: BYTE (7)" ","(","E","r","r"
BYTE (7)"o","r",")",000,000
P.ABQ: BYTE (7)" ","(","R","e","c"
BYTE (7)"e","i","v","e"," "
BYTE (7)"i","n","i","t","i"
BYTE (7)"a","t","e",")",000
P.ABR: BYTE (7)" ","(","C","o","m"
BYTE (7)"m","a","n","d",")"
BYTE (7)000,000,000,000,000
P.ABS: BYTE (7)" ","(","G","e","n"
BYTE (7)"e","r","i","c"," "
BYTE (7)"K","E","R","M","I"
BYTE (7)"T"," ","c","o","m"
BYTE (7)"m","a","n","d",")"
BYTE (7)000,000,000,000,000
P.ABT: BYTE (7)"M","e","s","s","a"
BYTE (7)"g","e"," ","n","u"
BYTE (7)"m","b","e","r",":"
BYTE (7)" ",000,000,000,000
P.ABU: BYTE (7)011,"L","e","n","g"
BYTE (7)"t","h",":"," ",000
P.ABV: BYTE (7)" ","(","d","e","c"
BYTE (7)")",000,000,000,000
P.ABW: BYTE (7)"M","e","s","s","a"
BYTE (7)"g","e"," ","t","y"
BYTE (7)"p","e",":"," ",000
P.ABX: BYTE (7)"C","h","e","c","k"
BYTE (7)"s","u","m",":"," "
BYTE (7)000,000,000,000,000
P.ABY: BYTE (7)" ","="," ",000,000
P.ABZ: BYTE (7)"O","p","t","i","o"
BYTE (7)"n","a","l"," ","d"
BYTE (7)"a","t","a",":"," "
BYTE (7)000,000,000,000,000
P.ACA: BYTE (7)" ",042,000,000,000
; DATA%TEXT
U.105= P.ABH
; ACK%TEXT
U.106= P.ABI
; NAK%TEXT
U.107= P.ABJ
; SND%INIT%TEXT
U.108= P.ABK
; BREAK%TEXT
U.109= P.ABL
; TEXT%TEXT
U.110= P.ABM
; FILE%TEXT
U.111= P.ABN
; EOF%TEXT
U.112= P.ABO
; ERROR%TEXT
U.113= P.ABP
; RCV%INIT%TEXT
U.114= P.ABQ
; COMMAND%TEXT
U.115= P.ABR
; KERMIT%TEXT
U.116= P.ABS
; MN%TEXT
U.117= P.ABT
; LENGTH%TEXT
U.118= P.ABU
; DEC%TEXT
U.119= P.ABV
; MSG%TYP%TEXT
U.120= P.ABW
; CHKSUM%TEXT
U.121= P.ABX
; CHKSUM%NUM%TEXT
U.122= P.ABY
; OPT%DATA%TEXT
U.123= P.ABZ
; PRE%CHAR%TEXT
U.124= P.ACA
; DBG%MESSAGE
U.34: PUSH SP,AC0 ; 6657
PUSH SP,AC10
PUSH SP,AC11
PUSH SP,AC12
PUSH SP,AC13
PUSH SP,AC14
PUSH SP,AC16
PUSH SP,C.88 ; 6743
PUSHJ SP,TT%SET%OUTPUT
MOVE AC0,AC1
MOVE AC12,-12(SP) ; 6747
MOVEI AC1,0(AC12)
HRLI AC1,341000
ILDB AC2,AC1
MOVE AC14,AC2
SUBI AC14,40
MOVEI AC16,4 ; 6748
JUMPN AC14,L.468 ; 6749
MOVEI AC1,0(AC12) ; 6752
HRLI AC1,41000
ILDB AC2,AC1
IMULI AC2,137
MOVEI AC1,1(AC12) ; 6753
HRLI AC1,341000
ILDB AC1,AC1
ADD AC2,AC1 ; 6752
MOVE AC14,AC2 ; 6754
SUBI AC14,5773
MOVEI AC16,7 ; 6755
L.468: PUSHJ SP,TT%CRLF ; 6761
PUSH SP,C.126 ; 6762
PUSHJ SP,TT%TEXT
MOVEI AC1,0(AC12) ; 6763
HRLI AC1,241000
ILDB AC1,AC1
SUBI AC1,40
PUSH SP,AC1
PUSHJ SP,TT%NUMBER
PUSH SP,C.127 ; 6764
PUSHJ SP,TT%TEXT
PUSH SP,C.128 ; 6765
PUSHJ SP,TT%TEXT
MOVEM AC14,0(SP) ; 6766
PUSHJ SP,TT%NUMBER
PUSH SP,C.127 ; 6767
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 6768
PUSH SP,C.129 ; 6772
PUSHJ SP,TT%TEXT
MOVEI AC1,0(AC12) ; 6773
HRLI AC1,141000
ILDB AC1,AC1
PUSH SP,AC1
PUSHJ SP,TT%CHAR
MOVEI AC1,0(AC12) ; 6775
HRLI AC1,141000
ILDB AC13,AC1
CAIE AC13,104 ; 6778
JRST L.469
PUSH SP,C.130 ; 6779
JRST L.479
L.469: CAIE AC13,131 ; 6781
JRST L.470
PUSH SP,C.131 ; 6782
JRST L.479
L.470: CAIE AC13,116 ; 6784
JRST L.471
PUSH SP,C.132 ; 6785
JRST L.479
L.471: CAIE AC13,123 ; 6787
JRST L.472
PUSH SP,C.133 ; 6788
JRST L.479
L.472: CAIE AC13,102 ; 6790
JRST L.473
PUSH SP,C.134 ; 6791
JRST L.479
L.473: CAIE AC13,106 ; 6793
JRST L.474
PUSH SP,C.135 ; 6794
JRST L.479
L.474: CAIE AC13,130 ; 6796
JRST L.475
PUSH SP,C.136 ; 6797
JRST L.479
L.475: CAIE AC13,132 ; 6799
JRST L.476
PUSH SP,C.137 ; 6800
JRST L.479
L.476: CAIE AC13,105 ; 6802
JRST L.477
PUSH SP,C.138 ; 6803
JRST L.479
L.477: CAIE AC13,107 ; 6805
JRST L.478
PUSH SP,C.139 ; 6806
JRST L.479
L.478: CAIE AC13,103 ; 6808
JRST L.480
PUSH SP,C.140 ; 6809
L.479: PUSHJ SP,TT%TEXT
ADJSP SP,-1
L.480: PUSHJ SP,TT%CRLF ; 6812
MOVE AC2,AC14 ; 6817
SUB AC2,AC16
MOVE AC11,AC2
ADDI AC11,1
MOVE AC1,U.48
SUBI AC1,61
CAMN AC11,AC1
JRST L.484
PUSH SP,C.141 ; 6820
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 6821
MOVEI AC1,0(AC12) ; 6822
HRLI AC1,-337000
ADJBP AC16,AC1
MOVE AC2,AC11 ; 6824
SUB AC2,U.48
MOVE AC10,AC2
ADDI AC10,61
SETZ AC13,
JRST L.483
L.481: MOVE AC1,AC13 ; 6827
IDIVI AC1,12
CAIE AC2,1
JRST L.482
PUSHJ SP,TT%CRLF ; 6830
PUSH SP,C.47 ; 6831
PUSHJ SP,TT%CHAR
ADJSP SP,-1 ; 6829
L.482: PUSH SP,C.142 ; 6834
PUSHJ SP,TT%TEXT
ILDB AC1,AC16 ; 6835
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6836
PUSHJ SP,TT%CHAR
ADJSP SP,-3 ; 6825
L.483: ADDI AC13,1 ; 6824
CAMG AC13,AC10
JRST L.481
MOVE AC2,AC11 ; 6839
SUB AC2,U.48
ADDI AC2,61
MOVE AC1,AC2
IDIVI AC1,12
CAIN AC2,1
PUSHJ SP,TT%CRLF
PUSHJ SP,TT%CRLF ; 6841
ADJSP SP,-1 ; 6819
L.484: PUSH SP,C.144 ; 6848
PUSHJ SP,TT%TEXT
MOVE AC1,U.48 ; 6850
SUB AC14,AC1
ADDI AC14,62
MOVEI AC2,0(AC12)
HRLI AC2,-337000
ADJBP AC14,AC2
MOVE AC16,AC14
SUBI AC1,61 ; 6852
JRST L.485(AC1)
L.485: JRST L.486
JRST L.487
JRST L.488
L.486: PUSH SP,C.142 ; 6857
PUSHJ SP,TT%TEXT
MOVE AC14,AC16 ; 6858
ILDB AC1,AC14
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6859
PUSHJ SP,TT%CHAR
MOVE AC14,AC16 ; 6860
ILDB AC14,AC14
SUBI AC14,40
JRST L.489 ; 6852
L.487: SETZ AC14, ; 6865
PUSH SP,C.142 ; 6866
PUSHJ SP,TT%TEXT
MOVE AC2,AC16 ; 6867
ILDB AC1,AC2
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6868
PUSHJ SP,TT%CHAR
ILDB AC1,AC16 ; 6869
SUBI AC1,40
DPB AC1,C.123
PUSH SP,C.142 ; 6870
PUSHJ SP,TT%TEXT
MOVE AC2,AC16 ; 6871
ILDB AC1,AC2
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6872
PUSHJ SP,TT%CHAR
MOVE AC2,AC16 ; 6873
ILDB AC1,AC2
SUBI AC1,40
DPB AC1,C.124
ADJSP SP,-3 ; 6864
JRST L.489 ; 6852
L.488: SETZ AC14, ; 6878
PUSH SP,C.142 ; 6879
PUSHJ SP,TT%TEXT
MOVE AC2,AC16 ; 6880
ILDB AC1,AC2
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6881
PUSHJ SP,TT%CHAR
ILDB AC1,AC16 ; 6882
SUBI AC1,40
DPB AC1,C.125
PUSH SP,C.142 ; 6883
PUSHJ SP,TT%TEXT
MOVE AC2,AC16 ; 6884
ILDB AC1,AC2
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6885
PUSHJ SP,TT%CHAR
ILDB AC1,AC16 ; 6886
SUBI AC1,40
DPB AC1,C.123
PUSH SP,C.142 ; 6887
PUSHJ SP,TT%TEXT
MOVE AC2,AC16 ; 6888
ILDB AC1,AC2
PUSH SP,AC1
PUSHJ SP,TT%CHAR
PUSH SP,C.143 ; 6889
PUSHJ SP,TT%CHAR
ILDB AC1,AC16 ; 6890
SUBI AC1,40
DPB AC1,C.124
ADJSP SP,-6 ; 6877
L.489: PUSH SP,C.145 ; 6894
PUSHJ SP,TT%TEXT
MOVEM AC14,0(SP) ; 6895
PUSHJ SP,TT%NUMBER
PUSH SP,C.127 ; 6896
PUSHJ SP,TT%TEXT
PUSHJ SP,TT%CRLF ; 6897
MOVEM AC0,0(SP) ; 6898
PUSHJ SP,TT%SET%OUTPUT
ADJSP SP,-16 ; 6696
POP SP,AC16 ; 6657
POP SP,AC14
POP SP,AC13
POP SP,AC12
POP SP,AC11
POP SP,AC10
POP SP,AC0
POPJ SP,
C.123: POINT 6,AC14,29
C.124: POINT 6,AC14,35
C.125: POINT 4,AC14,23
C.126: XWD 0,U.117
C.127: XWD 0,U.119
C.128: XWD 0,U.118
C.129: XWD 0,U.120
C.130: XWD 0,U.105
C.131: XWD 0,U.106
C.132: XWD 0,U.107
C.133: XWD 0,U.108
C.134: XWD 0,U.109
C.135: XWD 0,U.111
C.136: XWD 0,U.110
C.137: XWD 0,U.112
C.138: XWD 0,U.113
C.139: XWD 0,U.116
C.140: XWD 0,U.115
C.141: XWD 0,U.123
C.142: XWD 0,U.124
C.143: EXP 42
C.144: XWD 0,U.121
C.145: XWD 0,U.122
; Routine Size: 279 words
; 6900 1 %SBTTL 'End of KERMSG'
; 6901 1 END
; 6902 1
; 6903 0 ELUDOM
; Low segment length: 555 words
; High segment length: 4095 words
; Compilation Complete
END