******************************************************************************* * * Kermit for BBC Micros version 1.45 * ---------------------------------- * * This file is a concatenation of the separate source file for BBC Kermit. In * order to assemble the source, you will need to split it into its separate * files: the split points are marked in this file with lines of the form * * ****** File ******************* * * See file BBCKERMIT.DOC for details of how to arrange the separate files on * disc ready for assembly. * * This release can be assembled with either the commercially available ADE * assembler, or, for preference, the free assembler supplied with BBC Kermit. * See file BBCASM.ANN for details of this. * ***************************************************************************** ****** File BBCMIT ************************************************************* SKP H * BBCMIT: Updated 24/02/87 @ 1200 OFF EQU 0 ;these are defined in case the Lancaster 65C02 ON EQU 1 ;assembler is used rather than ADE MARK EQU 1 ;mark number VERSION EQU 45 ;version number LEVEL EQU -1 ;development level (-1 for release version) LST OFF Y EQU -1 ;flags for IF N EQU 0 D EQU -1 G EQU -1 S EQU 0 ADE QUERY 'Using ADE (Y/N)' IF ~ADE SFCOND FI ROM QUERY 'Build ROM version (Y/N)' RAM EQU ~ROM ONEDRV QUERY 'All files on one disc surface (Y/N)' IF ~ONEDRV DSDRIV QUERY '1 D/S drive (D) or 2 S/S (S)' FI LIST QUERY 'Listing required (Y/N)' IF LIST LFULL QUERY 'Global or selective (G/S)' LST ON IF ADE PAGE 88 ELSE PAGE 88,132 FI SYSVDU 1,15,1,27,1,48 IF ROM TTL 'BBC Kermit (ROM)' ELSE TTL 'BBC Kermit (RAM)' FI ELSE LFULL EQU N FI IF ~LFULL LST OFF FI ******************************************************************************* * * KERMIT FOR BBC MICRO * ==================== * * This program implements the KERMIT protocol for an Acorn BBC microcomputer, * and is compatible with models B, B+, B+128, Master 128 and Master Compact. * It is not Tube compatible, and any second processor attached must be turned * off. * * The source is written to be assembled with the Lancaster 65C02 Assembler, * supplied free with the Kermit files on disc or from the Lancaster Distribution * service. It can also be assembled with the commercially-available ADE system * (version 2.02 or later) which can be bought from SYSTEM, Collegiate Crescent, * Sheffield, UK (See Acorn User magazine for adverts). The User Guide gives * full details of the assembly process for both assemblers. * * This implementation, begun in February 1985, is by Alan Phillips of the * Department of Computing, Lancaster University. Copyright is retained on the * program, but it is of course freely available under the standard terms for * distributing Kermit. You are encouraged to pass the source and compiled forms * on to others, but they must not be sold (other than to cover media and moderate * handling charges) * * We are always pleased to receive comments, suggestions and bug reports, and * we will produce bug-fix releases when necessary. The contact addresses are * given below. * * Lancaster University Computing Department also run the UK Kermit Distribution * Service, through which you can obtain copies of Kermit for over 200 different * machine/system combinations. Enquiries are welcome, but please note that, * apart from this BBC implementation, we do not supply any Kermits outside the * UK and Eire. * * Postal Address : Kermit Distribution, * Department of Computing, * Computer Centre, * Lancaster University, * Lancaster LA1 4YW * * Telephone : (0524) 65201 x 4881 * * Electronic mail : SYSKERMIT @ LANCS.VAX1 * (JANET address 000010404000.FTP.MAIL, * PSS address 234252400101.000010404000.FTP.MAIL) * * (Note that these addresses use Grey Book X25 mail: we * have no Telecom Gold or Prestel mailboxes. We also * cannot respond to Telex messages) * * * Thanks are due to: * * Dave Osborne University of Nottingham * Derek Dongray University of Manchester * Alwyn Breame AFRC Computer Centre * Bertil Schou Loughborough University * Peter O'Kane University College, Galway * Dave Morriss Heriot-Watt University * Colin Allison * Mike Whitehead Dundee University * Mario Palencia * Chris Kennington University College London * Brian Robinson * Dan Shapiro * Barry Forde Lancaster University * Neil Mercer Lancaster ITEC * Andrew Cole Leeds University * Tim Green Warwick University * John Linn Aberdeen University * Tom Wilson UMRCC * Peter Hearne Online Computer Supplies Ltd * Thomas Sippel-Dau Imperial College * Icarus Sparry Bath University * Ian O'Brien Central London Polytechnic * Bob Dixon Beaumont Hospital Lancaster * Peter Vince BBC Telesoftware * Alan Baker Viewfax Ramlink * Peter Vince BBC Telesoftware * Mike Brudenell Newcastle University * * and others for comments, contributions and suggestions. Apologies to those * whose names I have omitted. * * The KERMIT protocol is Copyright (C) The Trustees of Columbia University 1987 * * * VERSION HISTORY * --------------- * * 1.45 Bug fixed to allow talking to servers when 8-bit-prefix is not in use * ASCII version number placed in ROM header * 1.44 B7 stripped before terminal mode bytes displayed * 8th-bit-prefixing and quoting done correctly in C and G packets * Wildcard search no longer sends sub-directories as files * Command screen banner title altered to "BBC Micro Kermit" * Password sent correctly in REM CWD * 1.43 Handles quote char correctly on 8 bit data path * 1.42 RAM version uses shadow mode on B+ and Master * VT52 supported in RAM version on B+ and Master as default * Master 128 keypad used in VT52 mode * Code added for support of Terminal Extension ROM * RAM version ORG moved to $1F00 for ADFS on B and B+ * DFS 2.24 "close all files" bug avoided * VT52 graphics chars set with VDU 23 rather than block move * File renaming adjusted for ADFS compatibility * ROM header adjusted to be correct on Master * Parallel printer no longer forced * SET TERMINAL replaces SET VT52 and SET VDU-WIDTH * Entry no longer closes all files, allowing !BOOT usage * CLOSE command now closes all open files * C introduced as explicit synonym for CONNECT * Code adjusted to allow *EXEC files to be used cleanly * User vectors removed * Minor code corrections and compactions made * CONTROL-BREAK now exits RAM version * RAM version changes restart mode to 7 to stop self-corruption * Received EOF(D) and ACK(X/Z) packets correctly handled * File name generation uses length to suit current FS * OSHWM set to point above RAM version image * File name sent by remote can be used untranslated * *HELP handling tidied up * Code for sending line break rewritten * TRANSMIT command allows raw upload of files to host * Default timeouts changed to 15 seconds for MULTICS sites * Long break function added in terminal mode * Talks to servers that don't support I packets * Table-size bug in FIX command cleared * Sources made compatible with Lancaster 65C02 Assembler * OSBYTE 3 calls for printer select/deselect corrected * 1.33 OS1.20 bug in reverse screen scroll circumvented * VT52 ESCAPE codes echoed correctly in half-duplex mode * Function keys reset correctly on OS command or EXIT * Pad chars ignored before end-of-packet marker * 1.30 Conditionals added to build RAM-based version * All VT52 keypad keys correctly emulated * WIDTH command selects 40/80 byte command screen * Status line added in 80 character teminal modes * Function keys generate strings in terminal and command mode * Cursor editing allowed in command mode * Compilation facilities enhanced * Messages tokenised and improved * Command analyser error handling improved * Pause key added in terminal mode * Cursor edit mode added in terminal handler * Code for talking to servers rewritten * Init-info packets sent to servers * REMOTE command added * SET HANDSHAKE added to allow use with IBM systems * Code extensively tidied up * VT52 graphics characters supported * SET RETRIES command added * SET LOCAL-ESCAPE removed as obsolete * Timer code rewritten * File transfers can now be routed to printer * Local filenames no longer forced to upper case * Printmaster interaction with events catered for * Non-shadow mode selected if run on a B+ * 1.02 CTS/RTS flow control now works * FIX command added to save defaults in sideways RAM * Help trigger character configurable with SET HELP-TRIGGER * SET MUX-WAIT command added * Comms routines directed via vectors * VDU mode may ignore one specified character * LF in terminal mode correctly sent to printer * Terminal mode redesigned to use lower 24 lines for VT52 * *TV done before entering terminal mode, configurably * VT52 escape handling tidied up * Command tables re-ordered for neater autohelp display * Wait-for-XON now does not stop IRQ * Wildcard file search now works with NFS * Error trapping changed in initialisation phase * WAIT and DISPLAY commands added * Text colour configurable for terminal mode * Improved ways out of TAKE files * Number of timeouts displayed * Comms not lost when ESCAPE in OS command * 0.53 Initial release * * For up-to-the-minute news on BBC KERMIT see the bulletin files on the * Lancaster VAX 11/780. Bug reports and news of further releases will * be maintained there, as well as a total set of all * known KERMIT implementations. Contact the above for details. * **************************************************************************** *************************************** * * MACRO DEFINITIONS * ================= * *************************************** * Macro to build entries in command/parameter tables IF ADE CMD MACRO DFB @1 ASC @2 ENDM ELSE CMD MACRO DFB @1 ASC '@2' ENDM FI * Macro to chain to next source. Note that ADE bugs cause the * filename to be shown twice when this is used, * and the technique to fail if NOT in a macro! * It's OK on the Lancaster assembler. NEXT MACRO IF ONEDRV CHN @1 ELSE IF DSDRIVE CHN :2.@1 ELSE CHN :1.@1 FI FI ENDM * Macro to start each file and set list level up * First parameter must be the last 3 characters of the filename START MACRO IF LFULL!LST@1&LIST LST ON SKP H ELSE LST OFF FI ENDM * Macro to build table for the high bytes * of message addresses. This exists as a * list of message numbers, each being the * first message in a new page, relative to * the page message 0 starts in. For * message n the call will be * MTHE n-1,n MTHE MACRO IF (( LDA #32 ;select help text JSR GETMPAR ;get the parameter JMP SND280 FI * * Source is FILE here, so param 1 is mandatory local name * SND020 LDA #33 ;select help text JSR GETMFN ;get param and check size * * We have a name, so copy it to a buffer and add a CR to the end, watching for wildcards * SND060 LDY #0 STY WCLEN ;assume no wildcards SND100 LDA (CURPAR),Y ;get a byte STA LFNAME,Y ;note it INY CMP #'*' ;is it a multichar wildcard? BEQ SND110 ;j if it is CMP #'#' ;is it a singlechar wildcard? BNE SND120 ;j if not SND110 STY WCLEN ;else note position SND120 CPY CURLEN ;have we reached end? BNE SND100 ;j if not LDA #$0D ;else add a CR STA LFNAME,Y * * Note the length for later use * LDA CURLEN STA LFNLEN * * If name was wildcarded, we'll take another copy for the catalog scanning * later on * LDY WCLEN BEQ SND250 ;j if no wildcards SND190 STA WCLEN ;else save length of name LDY #0 SND200 LDA LFNAME,Y ;else copy over STA WCNAME,Y INY CPY WCLEN BNE SND200 * * Then set up the control block for the OSGBPB call to scan the * catalog * LDA #0 STA GNXBLK STA GNXBLK+9 STA GNXBLK+10 STA GNXBLK+11 STA GNXBLK+12 * * And see if we can find at least one file to match the wildcard name * JSR GNXTFIL BCS SND920 ;j if none - can't do a send * * Parameter 2 is optional and is the remote filename * SND250 LDA #32 ;select help text JSR GETFN ;get param and check size BCS SND400 ;j if absent * * Here the user has supplied a remote filename. Copy to our buffer and add a CR * SND280 LDY #0 SND300 LDA (CURPAR),Y ;get a byte STA RFNAME,Y ;store it INY CPY CURLEN BNE SND300 LDA #$0D ;and add a CR STA RFNAME,Y * * Then we go to do the display * JSR CONFIRM ;no more parameters JMP SND500 * * Here user didn't give a remote name, so we generate one. * SND400 LDY LFNLEN ;offset to final CR JSR MKRNAME * * Now put up the status screen and display the local filename * SND500 JSR STATUS ;also clears counts LDA #50 JSR MESS ;option is 'send' JSR DISLFN ;display local file name SND520 JSR DISRFN ;display remote filename * * Now mark no files are open, and delay for the specified period * to let user set up the other end * LDA #0 STA FHAND ;no file open LDA #59 JSR PRTSST ;set status to 'pausing' LDA DELAY JSR WAIT ;and wait a bit * * All ready, so off to the state switcher * JSR SENDSW ;into state switcher JMP REPORT ;report the result * * Here no files satisfied the wildcard name * SND920 BRK DFB 0 ASC 'No matches' DFB 0 *************************************** * * LOGGING * ======= * * Starts/stops logging of terminal * session * *************************************** LOG EQU * * * First parameter must be ON or OFF * JSR ONOFPAR ;get it in CMP #1 BEQ LOG500 ;j if it's ON * * It's logging OFF, so tidy file if it's open * JSR CONFIRM ;check no more parameters given LOG200 LDY LHAND ;get handle of file BEQ LOG900 ;j if not open - null call * * Make sure the buffer is written to the file * LDA LOGCNT ;get count of bytes in it BEQ LOG400 ;j if buffer empty JSR WLOGB ;else write to disc * * Then close the file * LOG400 LDA #0 LDY LHAND ;else get the handle STA LHAND ;clear it out STA LOGON ;clear toggle too JMP OSFIND ;close the file * * Here it's logging ON. Check not already logging * LOG500 LDY LHAND ;get handle of log file BEQ LOG600 ;j if not logging BRK ;else error DFB 0 ASC 'Already on' DFB 0 * * Not logging yet. Next parameter must be the file name * LOG600 LDA #107 ;select help text JSR LSTMPAR ;get param and check no more * * And open the file * LDA #0 STA LOGON ;clear toggle so don't log just yet STA LOGCNT ;mark buffer empty LDA #$80 ;write mode please JSR OPNCUR ;open file STA LHAND ;note the handle LOG900 RTS *************************************** * * SAVE * ==== * * Writes current SET values to file * *************************************** SAVE EQU * * * First param is file name * LDA #113 ;select help text JSR LSTMPAR ;get param and check no more LDA #$80 JSR OPNCUR ;open file for writing * * File is open. Write our ID string first * TAY ;handle into Y LDX #0 SAV200 LDA SAVID,X ;get byte JSR OSBPUT ;write it INX CPX #4 BNE SAV200 ;j till all done * * Then write the parameter block * LDX #0 SAV300 LDA DFBASE,X ;get byte JSR OSBPUT ;write it INX CPX #DFSIZE BNE SAV300 ;j till all done * * Then close the file and finish * JMP CLOSEY ;handle in Y here SAVID ASC 'KMT' ;id string for file DFB $00 *************************************** * * LOAD * ==== * * Loads SET params from file produced by * SAVE * *************************************** LOAD EQU * * * First parameter is file name * LDA #113 ;select help text JSR LSTMPAR ;get param and check no more LDA #$40 JSR OPNCUR ;open file for reading * * File is open. read id to check it's a KERMIT parameter file * TAY ;handle into Y STY CPTMP0 ;save for later, too LDX #0 LOD200 JSR OSBGET ;read byte BCS LOD900 ;j if EOF hit CMP SAVID,X ;is it what we expect? BNE LOD900 ;j if not INX CPX #4 BNE LOD200 ;j till 4 bytes checked * * File seems OK. Set current values to standard default * in case we don't like it * JSR DEFAULT ;default params * * Then read values into the param block * LDX #0 LDY CPTMP0 ;get file handle LOD300 JSR OSBGET ;get a byte BCS LOD600 ;j if EOF STA DFBASE,X ;save in the table INX CPX #DFSIZE ;this version's table full? BCC LOD300 ;j if not - carry on * * Read complete, so close file * LOD600 JSR CLOSEY ;handle in Y here IF RAM * * We're the RAM version, so eliminate any nasty values written from * the ROM version * LDA DESTIN ;get data destination CMP #1 ;is it MEMORY? BNE LOD610 ;j if not LDA #0 STA DESTIN ;else change to FILE LOD610 EQU * FI * * Then process the new params to set up dependent values * JMP DEF500 * * Here the file isn't a KERMIT parameter file * LOD900 JSR CLOSEY ;close the file BRK ;and error DFB 0 ASC 'Not parameter file' DFB 0 *************************************** * * TAKE * ==== * * Switches command input to be a file * *************************************** TAKE EQU * * * Check TAKE file not already open * LDA TKHAND ;is TAKE file open? BEQ TAK100 ;j if not BRK ;else error DFB 0 ASC 'Already TAKEing' DFB 0 * * No TAKE file open. Next parameter is mandatory filename * TAK100 LDA #117 ;select help text JSR LSTMPAR ;get param and check no more * * Then open file and set up the handle * LDA #$40 ;read mode JSR OPNCUR ;open it STA TKHAND ;note the handle STA CSOURCE ;and set it as command source RTS *************************************** * * EXIT * ==== * * Quits KERMIT for BASIC * *************************************** EXIT JSR CONFIRM ;check no parameters * * First we'll put the screen back to normal * BIT SHADOW ;do we have shadow capability? BPL EXI200 ;j if not LDA #114 LDX ENTSHAD JSR OBX0 ;else put it back as it was on entry EXI200 LDA #22 JSR OSWRCH ;then change mode... LDA #7 JSR OSWRCH ;...back to mode 7 * * Then we'll reset all the other bits and pieces * JSR ESCON ;turn ESCAPE on JSR LOSEACIA ;return 6850 to system JSR LOSESYS ;reset vectors IF RAM JSR NOBINT ;lose BREAK intercept LDA #$B4 LDX OLDHWM JSR OBX0 ;restore original OSHWM value FI * * And then we can go back to BASIC * LDX #>BASIC ;point to command LDY #CMDBUF ;get start address CLC ADC CMDPTR STA CURPAR LDA #CMOTB1 ;point F key base values list LDY #MAINCMD LDY #CMDBUF ;point to the line LDY #$90 STOP '*** Too much in page 0 ***' FI DEND *************************************** * * KERMIT DEFINES * ============== * *************************************** MAXPAK EQU 92 ;max size of packet DATA part KOSBYT EQU 70 ;OSBYTE call used to talk to TXR *************************************** * * MISCELLANEOUS DEFINES * ===================== * *************************************** XON EQU $11 XOFF EQU $13 CTRLD EQU $04 CTRLE EQU $05 CTRLN EQU $0E CTRLO EQU $0F CTRLU EQU $15 CTRLX EQU $18 CTRLZ EQU $1A FKEY EQU 128 ;base codes for function keys SFKEY EQU FKEY+16 CFKEY EQU SFKEY+16 CSFKEY EQU CFKEY+16 CHN BBCWKS ****** File BBCFIL ************************************************************* START FIL * BBCFIL : Updated 10/01/87 @ 1730 *************************************** * * FOPEN * ===== * * Opens a file for read or write * *************************************** FOPEN PHA ;save opening mode IF ROM * * See if this is a dummy call, with real data being MEMORY * CMP #$80 BEQ FOP100 ;j if writing LDA SOURCE ;reading, so check source BPL FOP110 FOP100 LDA DESTIN ;writing, so check destination FOP110 BEQ FOP120 ;j if FILE PLA ;else tidy stack RTS ;and do noting FI * * This is a real call. Set status display to 'opening file' * FOP120 LDA #52 JSR PRTSST * * Turn on ESCAPE so user can interrupt wait for drive ready (if he's on * DNFS, of course) * JSR ESCON * * Now we try to open the file * PLA ;reget opening mode LDX #>LFNAME ;point to filename LDY #GBPBLK LDY #GBPBLK LDY #LFNAME ;point to name LDY #LFNAME ;just set up name pointer STA GBPBLK LDA #LFNLEN ;address STA GNXBLK+1 LDA #GNXBLK LDY #GBPBLK ;point control block LDY #LFNAME STA GBPBLK LDA #GBPBLK ;pointer to block LDY #REMOPT ;point to option table LDY #CMDBUF ;set up start of parameter string STA CURPAR LDA #MAI900 STA BRKV LDA #BREAK JSR OBX0 LDA #$F9 LDX #DFBASE STA DEFPTR LDA #") * and we will always have space available * for it. * *************************************** BUFILL EQU * * * Do we need to read data into the buffer first? * IF ROM LDA SOURCE ;is source MEMORY BNE BUF020 ;j if so - no file to read FI LDA EOB ;look at buffer state flag BEQ BUF020 ;j if not empty JSR FREAD ;else read some in * * Set up pointers to the transmit packet data buffer * BUF020 LDA #0 STA TXPTR * * Is a byte pending from last time round? * BUF050 BIT PENDFLG BPL BUF060 ;j if not INC PENDFLG ;else clear flag to 0 LDA PENDCHR ;get the pended character STA WORK9 ;pretend we read it normally JMP BUF300 ;and inject it * * OK, we need to get a byte * BUF060 EQU * * * Gets bytes from the buffer. Have we exhausted it? * LDA FBPTR CMP FBTOP BNE BUF115 ;j if not LDA FBPTR+1 CMP FBTOP+1 BNE BUF115 ;j if not * * Buffer is exhausted, so read some more from the file (if we have one) * LDA #40 JSR DMESS ;log this IF ROM LDA SOURCE BNE BUF100 ;j if source is MEMORY FI LDA EOF ;are we at EOF here? BNE BUF100 ;j if so - no more data JSR FREAD ;else read the file JMP BUF060 ;and process what we got, if anything * * EOF hit. Was last char we saw the star of an EOR sequence? * BUF100 INC EORSEQ BEQ BUF240 ;j if so - write it to packet * * Now back to caller, setting up length of the packet we've built * BUF105 LDY TXPTR ;get packet pointer BEQ BUF110 ;j if packet empty STY TXDLEN CLC ;return 'packet built' RTS * * Here packet is empty, so tell caller * BUF110 SEC RTS * * Here we've not exhausted the buffer, so get a byte * BUF115 JSR COUNTB ;count the byte LDY #0 LDA (FBPTR),Y ;get the byte * * Make a note of the byte jusr obtained * BUF118 STA WORK9 ;save it STY WORK8 ;assume B7 clear at the end INC FBPTR ;move the pointer BNE BUF120 INC FBPTR+1 * * Do we need to watch for end-of-record? * BUF120 LDY FTYPE ;get type of file BNE BUF300 ;j if binary - no action * * Yes we do. Is this char the first in the EOR sequence? * CMP EOR BNE BUF220 ;j if not LDY EOR+1 ;else is ther a second byte too? BEQ BUF200 ;j if not - EOR is CR or LF DEC EORSEQ ;else set flag to $FF BNE BUF060 ;and look at next byte * * We've found end of record, so send a CRLF * BUF200 LDA #$0D STA WORK9 ;change char to send to be a CR DEC PENDFLG ;set pending flag to $FF LDA #$0A STA PENDCHR ;and pend an LF JMP BUF500 ;and output the CR * * Byte wasn't the first in the EOR sequence. Are we looking for the second? * BUF220 BIT EORSEQ BPL BUF300 ;j if not - send the byte INC EORSEQ ;else clear the flag to 0 CMP EOR+1 ;is it the byte looked for? BEQ BUF200 ;j if so - output CRLF * * We saw byte 0 of the EOR sequence, but not byte 1. Write the first byte to the * packet and pend the current data byte * BUF240 STA PENDCHR ;pend the data in now DEC PENDFLG ;set pend flag to $FF LDA EOR STA WORK9 ;inject first byte of EOR sequence BNE BUF500 ;j always * * Does the character need special treatment? * BUF300 LDA WORK9 ;get it back BMI BUF400 ;j if B7 is on BUF320 CMP SQUOTE BEQ BUF550 ;j if it's the quote character BUF325 CMP #32 BCC BUF500 ;j if it's a control char CMP #127 BEQ BUF500 ;j if it's DEL BIT EBQFLG ;are we 8 bit prefixing? BPL BUF380 ;j if not - char isn't special CMP EBQCHR ;else is it the prefix in use? BEQ BUF700 ;j if it is * * Character is non-controversial, so stuff it up the buffer * BUF380 ORA WORK8 ;put B7 into it JSR BUF800 ;into the buffer * * Is the packet buffer now full? * BCS BUF105 ;j if it is JMP BUF050 ;j if not * * Character has B7 set, so we might 8-bit quote it * BUF400 BIT EBQFLG BMI BUF480 ;j if 8 bit prefix in use LDY PARITY ;else look at our parity CPY #4 BEQ BUF490 ;j if NONE - can send 8 bits * * We can't send 8 bits and can't prefix, so warn user of loss * BIT BINWRN ;warned already? BMI BUF450 ;j if so DEC BINWRN ;else set flag to $FF LDA #11 JSR MESS ;and write warning out * * Now strip off B7 and packet the byte * BUF450 LDA WORK9 ;get data back and lose B7 BUF455 AND #%01111111 STA WORK9 BPL BUF320 ;and put into packet * * Here data is 8 bit, but we can prefix it * BUF480 LDA EBQCHR ;get prefix char JSR BUF800 ;packet the prefix JMP BUF450 ;send data character as 7 bits * * Here data is 8 bit, and we can send it all (parity none) * BUF490 LDY #$80 STY WORK8 ;note B7 on at the end BMI BUF455 ;check ls 7 bits for specials * * Here the character is a control character, so quote it * BUF500 LDA SQUOTE JSR BUF800 ;output a quote LDA WORK9 ;get the character back EOR #%01000000 ;flip control bit JMP BUF380 ;and put into buffer * * Here it's the quote character. Put it in the buffer twice * BUF550 JSR BUF800 JMP BUF380 * * Here char is the 8 bit prefix in use, so quote it * BUF700 PHA ;save char LDA SQUOTE JSR BUF800 ;put a quote in the buffer PLA ;reget character BNE BUF380 ;and output it itself * * * * Routine to put character into packet data buffer * BUF800 LDY TXPTR STA TXBUFF,Y ;put char away INY STY TXPTR ;move pointer on CPY SMAXD ;see if past end point RTS *************************************** * * INPARS * ====== * * Analyses remote's init params sent in * response to ours * *************************************** INPARS SEC ;note we've sent ours JSR RPAR ;extract host's parameters * * Host may have defaulted some values, so check them * LDA XSEOLN BNE IPR200 ;j if he gave his EOLN LDA SEOLN ;else get the SET value STA XSEOLN ;and use this IPR200 LDA RQUOTE BNE IPR900 ;j if he gave his quote LDA #'#' STA RQUOTE ;else set to "#" IPR900 RTS ;and finish NEXT BBCPM2 ****** File BBCPM2 ************************************************************* START PM2 * BBCPM2: Updated 28/01/87 @ 2030 *************************************** * * RPACK * ===== * * Receives a packet * *************************************** RPACK EQU * * * Send a diagnostic header if necessary * LDA #1 JSR DMESS * * Set status on screen to 'waiting' * LDA #23 JSR PRTSST * Read data until we find start-of-packet * RPA100 JSR RXBYTE BCC RPA110 ;j if not keyboard CR or timeout JMP RPA900 RPA110 CMP RSOP BNE RPA100 ;j if not SOP * * SOP seen, so set state on the screen to 'receiving' * LDA #25 JSR PRTSST * * Now we'll read the packet length byte in * RPA120 JSR RXBYTE BCC RPA130 ;j if not keyboard CR or timeout JMP RPA900 RPA130 JSR DBYTE ;log the byte CMP RSOP BNE RPA140 ;j if byte is not SOP again JMP RPA800 RPA140 CMP REOLN BNE RPA150 ;j if it's not sender's EOLN JMP RPA820 RPA150 STA CHKSUM ;else start the checksum JSR UNCHAR ;de-char it STA DATLEN ;and save it * * Next comes the packet sequence number * JSR RXBYTE BCC RPA200 ;j if not keyboard CR or timeout JMP RPA900 RPA200 JSR DBYTE ;log it CMP RSOP BNE RPA220 ;j if it's not SOP again JMP RPA800 RPA220 CMP REOLN BNE RPA240 ;j if not sender's EOLN JMP RPA820 RPA240 PHA ;else save it CLC ADC CHKSUM STA CHKSUM ;and update checksum PLA ;get byte back JSR UNCHAR ;de-char it STA PACNUM ;and note the value * * Next comes the packet type * JSR RXBYTE BCC RPA260 ;j if not keyboard CR or timeout JMP RPA900 RPA260 JSR DBYTE ;log it CMP RSOP BNE RPA280 ;j if it's not SOP again JMP RPA800 RPA280 CMP REOLN BNE RPA290 ;j if not sender's EOLN JMP RPA820 RPA290 STA PACTYPE ;else save it CLC ADC CHKSUM STA CHKSUM ;and update checksum * * Now we read data until we hit the EOLN character * LDY #0 ;buffer pointer RPA300 JSR RXBYTE ;read a byte in BCC RPA320 ;j if not keyboard CR or timeout JMP RPA900 RPA320 JSR DBYTE ;log it CMP RSOP BNE RPA330 ;j if not SOP again JMP RPA800 ;else resync and start again RPA330 CMP REOLN BEQ RPA400 ;j if it's sender's EOLN * * If there's still room in the receive buffer we note the byte, * and if not we ignore it * CPY #MAXPAK+1 BEQ RPA300 ;j if buffer is full STA RXBUFF,Y ;else note the byte CLC ADC CHKSUM STA CHKSUM ;update the checksum INY ;step packet buffer pointer BNE RPA300 ;get next character * * We've had sender's EOLN in. Do we wait on a handshake byte now? * RPA400 LDX HSHAKE ;get handshake type in use BEQ RPA500 ;j if NONE RPA410 JSR RXBYTE ;else read a byte in BCC RPA420 ;j if had one from sender JMP RPA900 ;else it was keyboard/timeout RPA420 CMP RSOP ;was it SOP again? BNE RPA430 ;j if not JMP RPA800 RPA430 CMP SKTAB2,X ;was it the handshake byte? BNE RPA410 ;j if not - ignore it * * Packet is now complete. Check we had at least one byte in (the checksum) * RPA500 JSR DCLRLN ;clear debug line CPY #0 BEQ RPA830 ;j if short packet * * We added the checksum into the checksum just now, so we'll * have to remove it * LDA CHKSUM SEC SBC RXBUFF-1,Y * * Convert the value into a characterised checksum * JSR CSUM * * Does this now match the checksum we actually received? * CMP RXBUFF-1,Y BNE RPA840 ;j if it doesn't * * Checksum is OK. Make sure packet isn't shorter than expected * INY INY CPY DATLEN BCC RPA850 ;j if it is * * Adjust DATLEN so it realy is length of th DATA part only * DEC DATLEN DEC DATLEN DEC DATLEN * * Count the packet, then wait for PAUSE seconds in case other end's comms is a bit * nadgered at high speed * RPA700 JSR COUNTP ;count packet LDA PAUSE JSR WAIT ;and wait * * Now look at the packet type. If it's the same as the one we just * sent, we've read an echo which we ignore * LDA PACTYPE CMP LPTYPE ;compare packet types BNE RPA750 ;j if not same - all OK LDA #116 JSR DMESS ;else log this is an echo JMP RPACK ;and wait for next one to come along * * Not an echo, so pass packet type back to caller * RPA750 PHA ;save packet type LDA #208 JSR DMESS ;print diagnostic text LDA DATLEN JSR DPRHEX ;print packet data length PLA ;reload packet type JSR DBYTE ;log it JSR DCLRLN ;clear diagnostic line CLC ;note packet read OK RTS * * Here we hit an unexpected SOP * RPA800 LDA #2 JSR DMESS ;log it JSR FLUSH ;clear comms buffer JMP RPA120 ;restart * * Here we met sender's EOLN too early * RPA820 LDA #3 RPA825 JSR DMESS ;log it JSR FLUSH ;clear comms buffer JMP RPA900 * * Here packet ended after the red tape bytes * RPA830 LDA #4 BNE RPA825 * * Here the checksum was wrong * RPA840 LDA #6 BNE RPA825 * * Here the length in PACLEN doesn't match the actual data * RPA850 LDA #5 BNE RPA825 * * Here user hit CR on the keyboard, or reception failed * RPA900 SEC RTS *************************************** * * SPACK * ===== * * Transmits a packet * *************************************** SPACK STA PACTYPE ;set packet type STX PACNUM ;and number * * First output the debug text * LDA #35 JSR DMESS * * Set status on screen to 'sending' * LDA #24 JSR PRTSST * * Then we send any pad characters the other end wants * LDY XSNPAD ;get number to send BEQ SPA200 ;j if none wanted LDA XSPADC ;else get the character SPA100 JSR TXBYTE ;send it DEY BNE SPA100 ;j till all pads sent * * Start packet off with a start-of-packet * SPA200 LDA SSOP JSR TXBYTE * * First send the packet length and start the checksum up * LDA DATLEN ;get length of DATA portion CLC ADC #3 ;form total packet length JSR TOCHAR ;characterise it JSR DBYTE ;log the byte JSR TXBYTE ;send it STA CHKSUM ;start checksum * * Now send the packet sequence number * LDA PACNUM JSR TOCHAR ;characterise it JSR DBYTE ;log it JSR TXBYTE ;send it CLC ADC CHKSUM STA CHKSUM ;update checksum * * Now send and note the packet type letter * LDA PACTYPE JSR DBYTE ;log it STA LPTYPE ;record it for receiver JSR TXBYTE ;and send it CLC ADC CHKSUM STA CHKSUM ;update checksum * * Now prepare to send the data part * LDA DATLEN ;get length of data part BEQ SPA800 ;j if none TAX ;else prepare counter * * Send the next data byte * LDY #0 ;TXBUFF pointer SPA600 LDA TXBUFF,Y ;get next byte JSR DBYTE ;log it JSR TXBYTE ;send it CLC ADC CHKSUM STA CHKSUM ;update checksum * * Any more data to send? * INY ;step buffer pointer DEX BNE SPA600 ;j if more to go * * All data sent, so now send the checksum value * SPA800 LDA CHKSUM JSR CSUM ;form character value JSR DBYTE ;log it JSR TXBYTE ;and send it * * Then send the EOLN character * LDA XSEOLN JSR DBYTE ;log it JSR TXBYTE ;send it * * Finally clear the debug line and count the packet * SPA900 JSR DCLRLN JMP COUNTP *************************************** * * PAKPAR/PAKPRL * ============= * * Puts current parameter into a packet * for a server command with a field length * (PAKPRL) or without one (PAKPAR). This * routine may be called several times to * build one packet: on entry TXPTR holds * current place in SCBUFF where we're * building the command and TXDLEN holds * the current size of the command * *************************************** PAKPRL EQU * * * Start with the parameter length * LDA CURLEN ;get the length JSR TOCHAR ;characterise it JSR PPR800 ;put into the packet * * Then the bulk of the parameter * PAKPAR EQU * PPR100 LDA CURLEN BEQ PPR700 ;j if zero length parameter LDY #0 ;else start pointer to take from paramete * * Process next character * PPR200 STY WORK0 ;save pointe LDA (CURPAR),Y ;get character JSR PPR800 ;output it LDY WORK0 ;reload pointer INY ;step parameter pointer on CPY CURLEN ;got to the end? BNE PPR200 ;j if not * * All done * PPR700 RTS * * Routine to put character into buffer * PPR800 LDY TXPTR ;ge buffer pointe CPY #MAXPAK+1 ;is buffer full? BEQ PPR890 ;j if so STA SCBUFF,Y ;else put character in INC TXPTR ;step buffer pointer INC TXDLEN ;step data size RTS * * Here packet is full. As we've not yet sent an I packet, we don't want to send an E packet * to the server * PPR890 LDA #0 STA MODE ;fake 'command mode' to inhibit E packet * * And do a "long command" break * PPR900 BRK DFB 0 ASC 'Command too long' DFB 0 *************************************** * * INIRPK * ====== * * Initialise to process received packet * *************************************** INIRPK LDA #0 STA RXPTR ;start pointer to buffer LDX DATLEN ;and length of data portion RTS NEXT BBCPM3 ****** File BBCPM3 ************************************************************* START PM3 * BBCPM3 : Updated 11/06/86 @ 1110 *************************************** * * STDPAK * ====== * * Sends a standard packet with no data * *************************************** STDPAK LDY #0 ;data size is 0 SPK100 STY DATLEN JMP SPACK ;send it *************************************** * * STDPKD * ====== * * Sends a standard packet with one data * byte * *************************************** STDPKD STY TXBUFF ;set data byte LDY #1 ;data size is 1 BNE SPK100 *************************************** * * STDBREAK * ======== * * Sends a 'B' packet * *************************************** STDBREAK EQU * LDA #'B' SBR100 LDX NXTPAK ;get sequence number JMP STDPAK *************************************** * * STDEOF * ====== * * Sends a 'Z' packet * *************************************** STDEOF LDA #'Z' BNE SBR100 *************************************** * * SDCEOF * ====== * * Sends an EOF/Z packet * *************************************** SDCEOF LDY #'D' ;data byte LDA #'Z' ;packet type SDE100 LDX NXTPAK ;packet number JMP STDPKD *************************************** * * SBKACK * ====== * * Sends an ACK/Z or ACK/X * *************************************** SBKACK LDA #'Y' ;packet type 'y' BNE SDE100 *************************************** * * STDNAK * ====== * * Sends a NAK packet * *************************************** STDNAK LDA #'N' BNE SBR100 *************************************** * * STDACK * ====== * * Sends a parameterless ACK packet * *************************************** STDACK LDA #'Y' BNE SBR100 *************************************** * * CSUM * ==== * * Converts the 8 bit value in A into a * characterised checksum * *************************************** CSUM STA CSTEMP ;save the value CLC ROL A ROL A ROL A AND #%00000011 ;get top bits at bottom CLC ADC CSTEMP ;add original AND #%00111111 ;lose top bits JMP TOCHAR ;and characterise it *************************************** * * VALSEQ * ====== * * Checks that a packet has the expected * sequence number * *************************************** VALSEQ LDA NXTPAK CMP PACNUM ;sequence correct? BNE VSQ900 ;j if not LDA #0 STA NUMTRY ;else clear retry count JSR INCNXT ;step next-packet number CLC RTS ;return OK * * Sequence incorrect so return fail * VSQ900 SEC RTS *************************************** * * VALNAK * ====== * * Checks whether a NAK is for the next * packet to be sent * *************************************** VALNAK LDX PACNUM DEX ;step sequence number back BPL VNK200 LDX #63 ;MOD 64 VNK200 CPX NXTPAK ;does it now match? BNE VSQ900 ;j if not - retrun fail CLC ;else OK RTS *************************************** * * RPTACK * ====== * * Sees if it is appropriate to resend an * ACK, and does so if it is * *************************************** RPTACK LDX NXTPAK ;step next-packet back by 1 DEX BPL RCK200 LDX #0 * * Does this number now match that of the received packet? * RCK200 CPX PACNUM BNE RCK800 * * Yes it does, so we assume host has lost an ACK * which we will repeat * LDA #'Y' LDY PACNUM ;re-use packet number JSR STDPAK ;send it CLC ;return OK RTS * * Not appropriate to resend, so return fail * RCK800 SEC RTS *************************************** * * ERRPKT * ====== * * Handles an error packet received from * the other end * *************************************** ERRPKT EQU * * * We'll copy the text to the stack. First put in * a BRK and a zero error number * LDA #0 STA $100 STA $101 * * Copy the text from the receive packet buffer, with a zero at the end * LDY DATLEN ;get data length STA $102,Y ;put in finishing 0 byte DEY ;step to last byte of data EPK200 LDA RXBUFF,Y ;get byte in STA $102,Y ;store it DEY BPL EPK200 ;j till all moved * * Note that this is an error packet and not a locally * generated BRK * LDA #1 STA BRKSRC * * And do a BRK to give break handler control * JMP $100 *************************************** * * SPAR * ==== * * Sets up a packet containing our * parameters * *************************************** SPAR PHP ;note 'send/receive' flag * * Put values into transmit packet buffer * LDA RMAXL ;max packet size I want JSR TOCHAR STA TXBUFF LDA STIME ;my timeout period JSR TOCHAR STA TXBUFF+1 LDA RNPAD ;number of pad characters I want JSR TOCHAR STA TXBUFF+2 LDA RPADC ;pad character I want EOR #%01000000 STA TXBUFF+3 LDA REOLN ;EOLN character I want JSR TOCHAR STA TXBUFF+4 LDA SQUOTE ;quote character I will use STA TXBUFF+5 LDA #'1' ;always check type 1 STA TXBUFF+7 * * Now the 8-bit prefixing bit. Am I doing a SEND? * PLP ;get the flag BCS SPR600 ;j if I'm sending * * I'm receiving, so I've already had other side's ideas on this * LDA EBQCHR ;get what he sent me BNE SPR300 ;j if didn't default it SPR210 JSR EBQOFF ;else tell user we won't do it SPR220 LDA #0 STA EBQCHR ;kill it over here LDA #'N' ;and we'll send an N in the field BNE SPR800 * * Other side didn't default the field, so look at what he said * SPR300 CMP #'Y' BEQ SPR400 ;j if sent Y CMP #'N' BEQ SPR210 ;j if he sent N - we won't do it JSR VALEBQ ;else is it legal? BCS SPR210 ;j if not legal * * He sent us a legal prefix, so we'll use it * SPR380 STA EBQCHR ;note for packet handlers JSR EBQON ;tell user we do it LDA EBQCHR BNE SPR800 ;and send the char back to him to confirm * * Here he sent a Y - he'll do it if we will * SPR400 LDA PARITY ;am I parity NONE? CMP #4 BEQ SPR210 ;j if so - don't prefix LDA CUREBQ BNE SPR380 ;else we will * * Here I'm sending, so what I request for prefix depends on my parity setting * SPR600 LDA PARITY CMP #4 ;am I parity NONE? BNE SPR620 ;j if not LDA #'Y' BNE SPR630 ;else I will if he will SPR620 LDA CUREBQ ;not parity NONE, so I want to prefix SPR630 STA EBQCHR ;so note my character * * And here I'm all set,and A contains the prefix field to send to him * SPR800 STA TXBUFF+6 ;into packet LDA #8 ;set packet data length STA DATLEN * * And finish * RTS *************************************** * * RPAR * ==== * * Reads the other end's parameters from * an init packet * *************************************** RPAR PHP ;save 'send/receive' flag * * First build a block of defaults in case he sent a short packet with some * fields absent. Use the transmit buffer for this * LDY #6 RPR100 LDA RPRTAB,Y STA TXBUFF,Y DEY BPL RPR100 * * Now copy the stuff we had from him into the buffer * LDY DATLEN ;get length of data part BEQ RPR120 ;j if none at all RPR110 DEY ;step pointer back LDA RXBUFF,Y ;get next byte STA TXBUFF,Y ;move to our new buffer BNE RPR110 ;j always * * Now analyse what we've just produced * RPR120 LDA TXBUFF ;max packet size he wants JSR UNCHAR SEC SBC #5 ;form max DATA size - 3 (see BUFILL for comments) STA SMAXD LDA TXBUFF+2 ;number of pad characters he wants JSR UNCHAR STA XSNPAD LDA TXBUFF+3 ;pad character he wants EOR #%01000000 STA XSPADC LDA TXBUFF+4 ;end of line character I must send JSR UNCHAR STA XSEOLN LDA TXBUFF+5 ;quote character he will send STA RQUOTE * * Now the 8 bit prefix. Am I doing a send or a receive? * PLP ;get the flag BCS RPR300 ;j if I'm sending LDA TXBUFF+6 ;else see what he said STA EBQCHR ;note for SPAR in a minute RTS * * Now look at the 8bit prefix field * RPR300 LDA TXBUFF+6 ;get what he sent CMP #'N' BEQ RPR500 ;j if he won't do it CMP #'Y' BEQ RPR360 ;j if he said yes to something * * He's sent me a prefix character. Did I send a Y or my own prefix? * LDX EBQCHR ;get what I sent him CPX #'Y' ;was it a Y? BNE RPR340 ;j if not * * I sent Y, he replied with a prefix, so do it * STA EBQCHR ;note prefix to use RPR330 JMP EBQON ;tell user we do it * * I sent a prefix, he replied with one. Is it the same one? * RPR340 CMP EBQCHR BEQ RPR330 ;j if it is - we do it BNE RPR500 ;else we differ, so we don't * * He's sent me a Y. Did I send Y or a prefix? * RPR360 LDA EBQCHR ;get what I sent him CMP #'Y' BEQ RPR500 ;we both sent Y, so don't do it JMP EBQON ;else tell user we will * * We disagree or don't want to, so we won't * RPR500 LDA #0 STA EBQCHR ;clear prefix character out JMP EBQOFF ;tell user it's off * * Default S packet contents * RPRTAB DFB 80+' ' ;MAXL DFB 0+' ' ;TIME DFB 0+' ' ;NPAD DFB 0!%01000000 ;PADC DFB $0D+' ' ;EOLN DFB '#' ;QCTL DFB 'N' ;QBIN NEXT BBCFIL ****** File BBCREC ************************************************************* START REC * BBCREC: Updated 24/02/87 @ 1200 *************************************** * * RECSW * ===== * * The state table switcher for receiving * a file or the output of a server command. * Initial state is in A on entry. * *************************************** RECSW STA STATE ;note initial stte * * Clear out the comms buffer * JSR FLUSH * * Set up receiving buffer for the current destination * LDA DESTIN ;get destination LDX #0 ;mode is receive JSR FBINIT * * Initialise protocol values and counts * JSR KINIT * * Log new position and state * RSW050 LDA #15 ;get text number JSR LOGST ;and log it * * Switch on our current state to the correct handler * LDA STATE CMP #'R' BEQ RSW100 ;j if REC_INIT CMP #'F' BEQ RSW200 ;j if REC_FILE CMP #'D' BEQ RSW300 ;j if REC_DATA CMP #'C' BEQ RSW400 ;j if COMPLETE CMP #'I' BEQ RSW500 ;j if SEND_SERVER_INIT CMP #'G' BEQ RSW600 ;j if SEND_GEN_CMD * * Here we're in an unknown state, so break * RSW090 BRK DFB 0 ASC 'Bad protocol state' DFB 0 * * * * State REC_INIT * -------------- * RSW100 JSR RINIT JMP RSW050 * * * State REC_FILE * -------------- * RSW200 JSR RFILE JMP RSW050 * * * State REC_DATA * -------------- * RSW300 JSR RDATA JMP RSW050 * * * State COMPLETE * -------------- * RSW400 RTS * * * State SEND_SERVER_INIT * ---------------------- * RSW500 JSR SVINIT JMP RSW050 * * * State SEND_GEN_CMD * ------------------ * RSW600 JSR SNDCMD JMP RSW050 *************************************** * * STATE REC_INIT * ============== * *************************************** RINIT JSR CHKTRY ;check retry limit * * Read packet from host * JSR RPACK BCC RIN040 ;j if got it OK JMP STDNAK ;else send a NAK * * Branch on packet type * RIN040 CMP #'S' BEQ RIN100 ;j if S CMP #'E' BEQ RIN200 ;j if E * * Packet type invalid here, so abort * RIN050 JMP ABORT * * * * S received * ---------- * RIN100 CLC ;note we're receiving JSR RPAR ;read other side's parameters CLC ;note we're receiving JSR SPAR ;set ours up LDA #'Y' ;select packet type Y LDX NXTPAK ;and get the number JSR SPACK ;and send our parameters LDA NUMTRY STA OLDTRY ;save try counter LDA #0 STA NUMTRY ;reset the main counter STA FCOUNT ;clear file counter JSR INCNXT ;step next-packet number by 1 LDA #'F' STA STATE ;and go to state REC_FILE RTS * * * ERROR received * -------------- * RIN200 JMP ERRPKT *************************************** * * STATE REC_FILE * ============== * *************************************** RFILE JSR CHKTRY ;check retry limit * * Read a packet from the host * JSR RPACK BCC RFI040 ;j if got it OK JMP STDNAK ;else NAK it * * Branch on packet type * RFI040 CMP #'S' BEQ RFI100 ;j if S CMP #'Z' BEQ RFI200 ;j if Z CMP #'F' BEQ RFI300 ;j if F CMP #'B' BEQ RFI400 ;j if B CMP #'E' BEQ RFI500 ;j if E CMP #'X' BEQ RFI600 ;j if X * * Packet type unknown here, so abort * RFI050 JMP ABORT * * * * S Received * ---------- * * This implies host lost an ACK from us with * the parameters, so maybe we'll resend them * RFI100 JSR CHKOTRY CLC ;mark we're sending JSR SPAR ;set our parameters up (C clear for receive here) LDA #'Y' ;packet type is Y LDX PACNUM ;use old number again JSR SPACK ;and send it once more * * Reset the try counter and stay in this state * RFI120 LDA #0 STA NUMTRY RTS * * * * Z Received * ---------- * * This implies host lost an ACK from us * RFI200 JSR CHKOTRY ;check retry limit JSR RPTACK ;repeat the ACK if possible BCS RFI050 ;j if not allowed here BCC RFI120 ;else start again * * * * F received * ---------- * * This is a file header announcing a file * RFI300 LDA NXTPAK CMP PACNUM ;is sequence OK? BNE RFI050 ;abort if not * * Packet is ok. Try to open the file, or set up printer, etc * JSR NEWFILE * * Destination is ready, so we'll prepare ourselves and ACK the host * JSR STDACK ;send an ACK LDA NUMTRY STA OLDTRY ;copy try counter LDA #0 STA NUMTRY ;reset counter STA PENDFLG ;clear char inject flag STA TFSTOP ;and interrupt flag STA BKASENT ;and flag for ACK/X ACK/Z sent JSR CLRINT ;clear interrupt status line JSR INCNXT ;step next-packet number by 1 JSR COUNTF ;add to file count JSR CLRKBC ;clear Kbyte count for current file * * Then switch to state REC_DATA * RFI380 LDA #'D' RFI385 STA STATE RTS * * * B received * ---------- * RFI400 LDA NXTPAK CMP PACNUM ;is packet sequence OK? BNE RFI050 ;abort if not JSR STDACK ;else send an ACK JSR PRTOFF ;and ensure printer is off * * If in generic mode for server output, make sure screen is tidy * BIT MODE BVS RFI420 ;j if not generic mode JSR TIDYLN ;else tidy the line * * Then go to state COMPLETE * RFI420 LDA #'C' BNE RFI385 * * * * ERROR received * -------------- * RFI500 JMP ERRPKT * * * X received * ---------- * * This is the header for bulk server output to screen * RFI600 LDA NXTPAK ;is sequence number OK CMP PACNUM BNE RFI050 ;j if not JSR BUFEMP ;else write packet data to screen JSR TIDYLN ;tidy up the output line JSR STDACK ;send an ACK JSR INCNXT ;step packet counter JSR RXINIT ;clear counts and flags JMP RFI380 ;and go to state REC_DATA *************************************** * * STATE REC_DATA * ============== * *************************************** RDATA JSR CHKTRY ;check retry limit * * Get packet from host * JSR RPACK BCC RDA040 ;j if got it OK JMP STDNAK ;else send a NAK * * Branch on packet type * RDA040 CMP #'D' BEQ RDA100 ;j if D CMP #'F' BNE RDA046 ;j if not F JMP RDA200 RDA046 CMP #'Z' BNE RDA048 ;j if not Z JMP RDA300 RDA048 CMP #'X' BNE RDA049 ;j if not X JMP RDA200 RDA049 CMP #'E' BNE RDA050 ;j if not E JMP RDA400 * * Packet type unknown here, so abort * RDA050 JMP ABORT * * * * D received * ---------- * RDA100 BIT BKASENT ;did we ACK/Z or ACK/X? BPL RDA120 ;j if not * * Other side can't handle ACK/X or ACK/Z, so crash to a stop * BIT MODE ;are we in genric mode for server command? BVC RDA105 ;j if so - no file to close SEC JSR FCLOSE ;close file nicely first JSR OPTDEL ;delete it if nesessary RDA105 BRK ;then crunch bang pow zap splatt DFB 0 ASC 'Interrupted' DFB 0 * * Not interrupting, so process this * RDA120 LDA PACNUM CMP NXTPAK ;is it the right sequence? BEQ RDA160 ;j if it is * * Packet isn't the one expected. * JSR CHKOTRY ;check retry limit not exceeded JSR RPTACK ;if OK, send an ACK if possible BCS RDA050 ;abort if not possible RDA140 LDA #0 ;else reset our count STA NUMTRY RTS * * Here the D packet is valid, so file it * RDA160 JSR BUFEMP ;this may go to disc * * Data is put away, possibly to disc, so it's clear to ACK now * BIT TFSTOP ;had keyboard interrupt? BPL RDA180 ;j if not * * User has done CTRL-X or CTRL-Z * LDY #'X' ;assume CTRL-X BVC RDA170 ;j if that's right LDY #'Z' ;else it's CTRL-Z RDA170 JSR SBKACK ;send ACK/ LDA #$FF STA BKASENT ;note we sent it BMI RDA190 * * No keyboard interrupt, so keep going * RDA180 JSR STDACK ;ordinary ACK RDA190 LDA NUMTRY STA OLDTRY ;save try counter LDA #0 STA NUMTRY ;reset it JSR INCNXT ;step next-packet number * * And make sure we're in state REC_DATA * LDA #'D' STA STATE RTS * * * * F or X received * --------------- * * This implies host has lost an ACK from us. Repeat it if we can * RDA200 JSR RPTACK BCS RDA050 ;abort if not appropriate BCC RDA140 ;else reset counts * * * * Z received * ---------- * RDA300 LDA NXTPAK CMP PACNUM ;is sequence correct? BNE RDA050 ;j if not * * Are we receiving a file or server output? * BIT MODE ;in for generic mode? BVC RDA340 ;j if so - it's server output * * File send is over. We could have a character still to write to it * BIT PENDFLG ;character pending? BPL RDA320 ;j if we not LDA PENDCHR JSR TOFILE ;else output pended character RDA320 SEC ;select 'flush buffer' JSR FCLOSE ;and close the file * * Did we or remote interrupt the transfer with CTRL-X or CTRL-Z? * BIT BKASENT BMI RDA330 ;j if we interrupted LDA DATLEN ;else look at EOF packet data field BEQ RDA340 ;j if there isn't one LDA RXBUFF ;else get first character CMP #'D' BNE RDA340 ;j if not EOF(D) - not interrupted * * We do have an interrupted transfer, so maybe delete incoming file * RDA330 JSR OPTDEL * * Then send an ACK and prepare for the next bit * RDA340 JSR STDACK JSR INCNXT ;step next-packet number JSR STOTCT ;clear counters LDA #0 STA NUMTRY ;clear the try counter LDA #'F' STA STATE ;and go to state REC_FILE RTS * * * * ERROR received * -------------- * RDA400 JMP ERRPKT *************************************** * * STATE SEND_SERVER_INIT * ====================== * *************************************** SVINIT JSR CHKTRY ;check retry limit * * Build parameters and send an I packet * SEC ;we're sending here JSR SPAR ;build packet LDA #'I' ;type is I LDX #0 ;sequence is 0 JSR SPACK ;so send it * * Read the reply * JSR RPACK BCC SVI040 ;j if OK RTS ;else stay in this state * * Branch on packet type * SVI040 CMP #'N' BEQ SVI200 ;j if N CMP #'Y' BEQ SVI300 ;j if Y CMP #'E' BEQ SVI400 ;j if E * * Unknown packet type, so abort * JMP ABORT * * * NAK received * ------------ * SVI200 RTS ;stay in this state * * * ACK received * ------------ * * This contains server's parameters * SVI300 JSR VALSEQ ;sequence OK? BCS SVI200 ;j if not - stay in this state SVI320 JSR INPARS ;else analyse the parameters LDA #'G' STA STATE ;go to state SEND_GEN_CMD LDA #0 STA NXTPAK ;restart packet counter STA NUMTRY ;and try counter RTS * * * ERROR received * -------------- * * This means server does not implement I packets so * we assume he'll use default values * SVI400 LDA #0 ;fake that we had a zero length ACK STA DATLEN ;so we'll use all defaults BEQ SVI320 ;and go to state SEND_GEN_CMD *************************************** * * STATE SEND_GEN_CMD * ================== * *************************************** SNDCMD JSR CHKTRY ;check retry limit * * Copy the command to the transmit buffer. Here TXDLEN gives the number of * bytes in the string, but we have yet to handle quoting and 8th-bit-prefixing. * Set up some control values first * LDX #0 ;start pointer to take from string LDY #0 ;start pointer to insert into transmit buffer * * Get a byte from the command string and see what we need to do * SCD010 LDA SCBUFF,X ;get the byte CMP SQUOTE ;is it the quote we send? BEQ SCD030 ;j if it is BIT EBQFLG ;are we 8th-bit-prefixing? BPL SCD020 ;j if not - move byte unchanged CMP EBQCHR ;else is it the 8-bit-prefix character? BNE SCD020 ;j if not - move byte unchanged * * Byte is the 8-bit-prefix, so it has to be quoted * LDA SQUOTE ;get the quote character JSR SCD040 ;move it to the transmit buffer LDA EBQCHR ;then get the 8-bit-prefix char again SCD020 JSR SCD040 ;move that to the buffer * * Now see if there's any more to move * SCD025 INX ;step remove pointer CPX TXDLEN BNE SCD010 ;j if more to move * * All moved, so we now have the actual packet size in Y * STY DATLEN ;set up the length BEQ SCD045 ;and send the packet * * Here character is the quote, so we double it * SCD030 JSR SCD040 ;output it to the buffer once... JSR SCD040 ;...and once again JMP SCD025 ;and round again * * Here we insert the character into the transmit buffer * SCD040 CPY SMAXD ;is buffer full? BCC SCD042 ;j if not JMP PPR900 ;else break SCD042 STA TXBUFF,Y ;insert char into buffer INY ;step buffer pointer RTS * * Here we send the packet that we've just built * SCD045 LDA TXTYPE ;get type LDX #0 ;sequence is 0 JSR SPACK * * Then get the reply * JSR RPACK BCC SCD050 ;j if OK RTS ;else stay in this state * * Branch on packet type * SCD050 CMP #'S' BEQ SCD100 ;j if S CMP #'Y' BEQ SCD200 ;j if Y CMP #'N' BEQ SCD300 ;j if N CMP #'X' BEQ SCD400 ;j if X CMP #'E' BEQ SCD500 ;j if E * * Packet type unknown, so break * JMP ABORT * * * S received * ---------- * SCD100 JMP RIN100 ;process params and reply * * * Y received * ---------- * * This may contain a message for the screen * SCD200 JSR VALSEQ ;sequence OK? BCS SCD290 ;j if not - stay in this state JSR VDUINI ;else initialise VDU output values JSR BUFEMP ;and write data to sceen JSR TIDYLN ;make sure screen line is tidy LDA #'C' SCD240 STA STATE ;and go to state COMPLETE SCD290 RTS * * * N received * ---------- * SCD300 RTS ;stay in this state * * * X received * ---------- * SCD400 LDA PACNUM ;is sequence OK CMP NXTPAK BNE SCD300 ;j if not - stay in this state JSR VDUINI ;else initialise VDU output values JSR BUFEMP ;and copy packet data to screen JSR TIDYLN ;make sure screen line is tidy JSR STDACK ;then ACK it JSR INCNXT ;step packet number JSR RXINIT ;clear counts and flags LDA #'D' BNE SCD240 ;and go to state REC_DATA * * * ERROR received * -------------- * SCD500 JMP ERRPKT CHN BBCSND ****** File BBCSB1 ************************************************************* START SB1 * BBCSB1: Updated 07/07/86 @ 1500 *************************************** * * MESS * ==== * * Outputs a preset message text * *************************************** MESS EQU * * * Work out start address of string. The lsb is a straight table * look-up * TAY ;message number into Y PHA ;and saved for later LDA MSGTBL,Y ;get address lsb STA MPTR0 ;and note it * * The msb is more complicated. We have a list that gives the number of the * first message to start within each page, relative to the * page that M0 starts in, so we scan back until we find which page our own * message starts in * PLA ;get message number LDY #MTHCNT+1 ;point past end of list MES100 DEY ;step back one element CMP MSGTBH,Y ;check with list BCC MES100 ;j if message in a lower page * * Y now gives the page number relative to M0 start, so add in the * high byte of M0 to get the msb of the address * TYA CLC ADC # and * MES440 JSR MES950 ;step to count value LDA (MPTR0),Y ;pick value up TAX ;save into X JSR MES950 ;step to data character LDA (MPTR0),Y ;get it MES450 JSR OSASCI ;print it DEX BNE MES450 ;until count expires JMP MES310 ;then do next character * * Here we have TXT, which is followed by the text number * we recurse into * MES460 JSR MES950 ;move pointer on LDA #1 ;fake a repeat count of 1 STA MWORK0 ;save it BNE MES510 ;and use MTXT code * * Here we have XCR, so we output a $0D without conversion * to LF-CR * MES480 LDA #$0D JSR OSWRCH JMP MES310 * * Here we have MTXT, for multiple sub-text * MES500 JSR MES950 ;move to next character LDA (MPTR0),Y ;get the repeat count STA MWORK0 ;save for a moment JSR MES950 ;move to text number MES510 LDA (MPTR0),Y ;get sub-text number MES512 TAX ;hold it in X PHA ;and stack it LDA MWORK0 ;get repeat count back PHA ;and stck it TYA ;stack the current offset PHA LDA MPTR0 ;stack current text pointer PHA LDA MPTR0+1 PHA TXA ;get sub-text number back JSR MESS ;recurse to do the sub-text PLA ;then unstack old pointer STA MPTR0+1 PLA STA MPTR0 PLA ;unstack offset TAY PLA ;unstack repeat count SEC SBC #1 ;decrement it BEQ MES518 ;j if no more to do STA MWORK0 ;else save it PLA ;reload text number JMP MES512 ;and do it again MES518 PLA ;all done so lose text number JMP MES310 ;and carry on * * Here we have MSP for multiple space * MES520 JSR MES950 ;move to repeat count LDA (MPTR0),Y ;get the count TAX ;hold it in X LDA #' ' ;set up a space as repeated character BNE MES450 ;and use RPT code * * * Step text pointer * ----------------- * MES950 INY BNE MES960 ;j if still in same page INC MPTR0+1 ;else move on a page LDY #0 ;and start offset again at zero MES960 RTS ;and finish * * * Addresses for routines servicing $F0..$FF * MSGT1L DFB >MES420 ;$F9 - LIT DFB >MES520 ;$FA - MSP DFB >MES500 ;$FB - MTXT DFB >MES480 ;$FC - XCR DFB >MES440 ;$FD - RPT DFB >MES460 ;$FE - TXT DFB >MES400 ;$FF - EOT MSGT1H DFB ' ;then a '>' JSR OSWRCH JMP DME800 ;and end *************************************** * * DPRHEX * ====== * * Outputs one byte to parallel printer * in hex * *************************************** DPRHEX PHA LDA DEBTOG ;is debugging active? BEQ DME990 ;j if not SEC ;else select hex mode BCS DBY100 ;and print the byte *************************************** * * DCLRLN * ====== * * Tidies up the line on the parallel * printer with a CR * *************************************** DCLRLN PHA LDA DEBTOG ;is debug on? BEQ DME990 ;j if not - null call * * Debug is on, so save registers * TXA PHA TYA PHA * * Select parallel printer output * JSR OPPTR * * And send a CR * LDA #$0D BNE DBY300 *************************************** * * PRHEX * ===== * * Prints value in A in hex * *************************************** PRHEX PHA ;save the value LSR A ;get top nibble LSR A LSR A LSR A JSR PRH500 ;print it PLA AND #$0F ;get bottom nibble PRH500 CMP #10 BCC PRH600 ;j if 0..9 CLC ADC #'A'-10 ;else form 'A'..'F' BCC PRH650 PRH600 ADC #'0' ;scale to '0'..'9' PRH650 JMP OSWRCH ;and print it *************************************** * * PRWHEX * ====== * * Prints value in X,Y (low-high) in hex * *************************************** PRWHEX TXA PHA ;save low byte TYA JSR PRHEX ;print high byte PLA ;reload low byte JMP PRHEX ;print it *************************************** * * INCNXT * ====== * * Steps the next-packet number by 1 * *************************************** INCNXT LDX NXTPAK INX CPX #64 BCC INX900 LDX #0 INX900 STX NXTPAK RTS *************************************** * * OPVDU * ===== * * Directs output to the VDU drivers * *************************************** OPVDU LDX #%00000000 OPV100 LDY #0 LDA #3 JMP OSBYTE *************************************** * * OPPTR * ===== * * Directs output to printer * *************************************** OPPTR LDX #%00001010 BNE OPV100 *************************************** * * MKGBPB * ====== * * Partially fills an OSGBPB control * block * *************************************** MKGBPB LDA FHAND ;set handle as byte 0 STA GBPBLK * * Set transfer address to the base of the file buffer * LDA FBUFF STA GBPBLK+1 LDA FBUFF+1 STA GBPBLK+2 LDY #$FF STY GBPBLK+3 STY GBPBLK+4 * * Set top two bytes of transfer size to 0 * INY STY GBPBLK+7 STY GBPBLK+8 * * Set sequential pointer to 0 * STY GBPBLK+9 STY GBPBLK+10 STY GBPBLK+11 STY GBPBLK+12 * * And that's it * RTS *************************************** * * TOCHAR * ====== * * Makes a control char printable * *************************************** TOCHAR CLC ADC #' ' RTS *************************************** * * UNCHAR * ====== * * Reverses the action of TOCHAR * *************************************** UNCHAR SEC SBC #' ' RTS *************************************** * * FLSHKB * ====== * * Flushes the keyboard buffer * *************************************** FLSHKB LDA #15 JMP OB10 *************************************** * * INKEY * ===== * * Does an INKEY(0) call * *************************************** INKEY JSR SUSEXF ;suspend any EXEC file LDX #0 INK100 LDA #$81 JSR OBX0 ;do INKEY(0) PHP ;save status result TXA PHA ;and the key code JSR RSTEXF ;reset any EXEC file PLA ;and reset key code and status TAX PLP RTS *************************************** * * HEXFLG * ====== * * Checks if a character is X, $ or & * *************************************** HEXFLG JSR UPPER ;into upper case CMP #'X' BEQ HFG800 ;j if X CMP #'$' BEQ HFG800 ;j if $ CMP #'&' BEQ HFG800 ;j if & * * Not in the list * SEC RTS * * In the list * HFG800 CLC RTS *************************************** * * CHKFNL * ====== * * Checks if current param is too long * to be a filename * *************************************** CHKFNL LDA CURLEN CMP #MAXFNL BCS CFL900 ;j if too long RTS * * Parameter is too long * CFL900 LDA #195 ;select error text JMP PARMERR ;and report *************************************** * * TELLACT * ======= * * Reports if a toggle is on or off * *************************************** TELLACT CMP #$FF ;check the toggle BEQ TAC400 ;j if active LDA #126 ;else say it's off BNE TAC410 TAC400 LDA #127 ;get text for 'on' TAC410 JMP MESS ;print the text *************************************** * * WHATFS * ====== * * Notes number of current filing system * *************************************** WHATFS LDA #0 TAY LDX #>WORK0 ;point dummy control block JSR OSARGS ;get number in A STA FSNUM ;note the number RTS *************************************** * * LOGST * ===== * * Logs state of a state switcher * *************************************** LOGST JSR DMESS ;log heading LDA STATE JSR DBYTE ;log the state letter JMP DCLRLN ;tidy up the line *************************************** * * PRTON / PRTOFF * ============== * * Turns printer on/off with VDU 2/3 * *************************************** PRTON LDA #2 PON100 JMP OSWRCH PRTOFF LDA #3 BNE PON100 IF RAM *************************************** * * CKSHAD * ====== * * Errors if we do not have shadow screen * capability * *************************************** CKSHAD BIT SHADOW BPL CKD900 ;j if shadow capability RTS ;else OK * * No shadow capability, so we BRK * CKD900 BRK DFB 0 ASC 'Not on BBC B' DFB 0 FI *************************************** * * GETACIA * ======= * * Masks 6850 IRQ from the system * *************************************** GETACIA LDX #0 GAC100 LDA #$E8 JMP OBX0 *************************************** * * LOSEACIA * ======== * * Allows the system to see 6850 IRQ * *************************************** LOSEACIA LDX #$FF BMI GAC100 NEXT BBCSB2 ****** File BBCSB2 ************************************************************* START SB2 * BBCSB2: Updated 10/05/86 @ 1900 *************************************** * * REPORT * ====== * * Reports termination of a transfer * *************************************** REPORT LDA #17 JSR MESS ;print "completed" LDA #51 ;and set status on screen to "idle" JSR PRTSST * * If command source is keyboard we wait for a CR * LDA CSOURCE ;get source indicator BNE REP600 ;j if source is TAKE file JMP WTCMODE ;else wait for CR * * Source is take file. Close it if CTRL-Z was used * REP600 BIT TFSTOP ;was transfer interrupted? BPL REP800 ;j if not JMP WAI900 ;else back to keyboard input * * Not interrupted, so just wait 2 seconds * REP800 LDA #2 JMP WAIT *************************************** * * UPPER * ===== * * Converts lower case to upper * *************************************** UPPER CMP #'a' BCC UPP900 ;j if not 'a'..'z' CMP #'z'+1 BCS UPP900 ;j if not 'a'..'z' AND #$DF ;else convert to upper UPP900 RTS *************************************** * * ONOFPAR * ======= * * Gets a parameter and analyses it as * ON or OFF * *************************************** ONOFPAR EQU * * * Select the commnd table and get the parameter * LDX #>ONOFTB LDY #LFNAME ;point to buffer LDY #RFNAME ;point to buffer LDY #CMO100 ;declare restart vector STX RESTART LDX #BRKH ;point it to our BRK handler STA BRKV ;it's easy since BRKV is non-extended LDA #WIDTAB ;point to table LDY #ONOFTB+2 ;select table LDY #ONOFTB+2 ;select table LDY #CBLK LDY #STYTAB+2 ;select table LDY #SASTAB+2 ;select table LDY # or * *************************************** LFDUMMY LSR A ;form 0=MEMORY,1=PRINTER TAX ;point to dummy string LDA LFDTBL,X STA PTR0 LDA LFDTBH,X STA PTR0+1 * * Copy dummy string to local filename buffer * LDY #9 LFD300 LDA (PTR0),Y STA LFNAME,Y DEY BPL LFD300 * * Set "local name given" flag and finish * LDY #1 STY LFGIVEN RTS LFDMEM ASC ' ' DFB $0D LFDPRT ASC '' DFB $0D LFDTBL DFB >LFDMEM DFB >LFDPRT LFDTBH DFB '+1 BCC VAL800 ;j if legal CMP #97 BCC VAL900 ;j if not legal CMP #'~'+1 BCS VAL900 ;j if not legal * * Here it's legal * VAL800 CLC RTS * * Here it's not legal * VAL900 SEC RTS *************************************** * * STDVEC * ====== * * Restores all OS vectors apart from * those used by DFS to their default * settings * *************************************** STDVEC PHP SEI * * Get pointer to the defaults table in the OS ROM * LDA STDVPTR STA PTR0 LDA STDVPTR+1 STA PTR0+1 * * Reset the low non-filing-system vectors first * (USERV to RDCHV inclusive) * LDY #$11 STV200 LDA (PTR0),Y ;copy byte down STA $0200,Y DEY BPL STV200 ;j till all done * * Now the high non-filing system vectors * (EVENTV to IND3V inclusive) * LDY #$35 STV300 LDA (PTR0),Y ;copy byte down STA $0200,Y DEY CPY #$1F BNE STV300 ;j till all done * * And finish * PLP RTS *************************************** * * GETSYS * ====== * * Sets up system control values * *************************************** GETSYS PHP SEI IF ROM JSR GETEV ;take EVENT vector ELSE JSR GETEV ;take EVENT vector LDA IRQ1V ;take a copy of IRQ1 STA OLDIRQ LDA IRQ1V+1 STA OLDIRQ+1 LDA #>IRQENT ;then point it to us STA IRQ1V LDA #EVENT STA (EVECTB),Y LDA #EVENT STA EVENTV LDA #SPATB1+2 LDY #SFCTAB+2 ;point command table LDY #SKTAB+2 ;point to table LDY #STTAB+2 ;point to table LDY #SVDCTB+2 ;point to table LDY #STYTAB+2 ;select table LDY #SASTAB+2 ;select the table LDY #SITAB+2 LDY #SFNTAB+2 ;point to table LDY #SSRTAB+2 LDY #SDETAB+2 LDY #SBATAB+2 ;point to table LDY #LFNAME ;point to name LDY #SETOPT ;point to table LDY #SBATAB ;point to table LDY #SBATB2 ;point to table LDY #SPATB1 ;point to table LDY #SFTAB ;point to table LDY #STYTAB ;point to table LDY #SASTAB LDY #SFNTAB ;point to table LDY # 64 STA FBPAGES ;else note it RTS * * Parameter is out of range * SBF900 JMP SRS900 FI *************************************** * * SET FILE WARNING * ================ * * Specifies action taken if file names * clash on receive * *************************************** SFWARN JSR LSTMSWP ;get ON/OFF, check no more STA FWARN ;save the value RTS *************************************** * * SET FILE SUFFIX * =============== * * Defines string we add to make a remote * filename * *************************************** SFSUFF EQU * * * Next parameter is the optional suffix string * LDA #114 ;select help text JSR LSTPAR ;get param, check no more BCS SFF800 ;j if not there * * Check size of the parameter * LDY CURLEN CPY #9 BCS SFF900 ;j if too long * * Note size, and the string itself * STY SUFLEN ;note size DEY SFF200 LDA (CURPAR),Y ;else copy string over STA SUFFIX,Y DEY BPL SFF200 RTS ;and finish * * Here parameter is null * SFF800 LDY #0 ;mark size as zero STY SUFLEN RTS * * Here string is too long * SFF900 LDA #189 ;get error text JMP PARMERR ;and report *************************************** * * SET FLOW-CONTROL * ================ * * Selects XON/XOFF or CTS/RTS control * *************************************** SFCON EQU * * * Next parameter is the flow control type * LDX #>SFCTAB ;select option table LDY #SHTTB ;point to table LDY #STTAB ;point to table LDY #SVDCTB ;point to table LDY #SSRTAB ;point to table LDY #SDETAB ;point to table LDY #SSNTAB ;point to table LDY # $1F STA SSOP ;else note it RTS * * Here parameter is out of range * SSS900 JMP SRP900 *************************************** * * SET SEND TIMEOUT * ================ * * Defines timeout we ask remote to use * *************************************** SSTIME LDA #101 ;select help text JSR LSTMNP ;get num par, check no more CMP #95 BCS SSS900 ;j if not 0..94 STA STIME ;else set it RTS *************************************** * * SET SEND PADCHAR * ================ * * Defines the pad character we send * initially * *************************************** SSPADC LDA #94 ;select help text JSR LSTMNP ;get num par, check no more CMP #32 BCS SSS900 ;j if not 0-31 STA SPADC ;else save it RTS *************************************** * * SET SEND PADDING * ================ * * Defines number of pads we send initially * *************************************** SSNPAD LDA #95 ;select help text JSR LSTMNP ;get num par, check no more STA SNPAD ;note it RTS *************************************** * * SET SEND QUOTE * ============== * * Defines how we quote control characters * *************************************** SSQUOTE LDA #73 ;select help text JSR LSTMCP ;get char par, check no more * * Check character doesn't clash with the 8 bit prefix * CMP CUREBQ BEQ SSQ900 ;j if it does STA SQUOTE ;else save the value RTS * * Here character clashes with the 8 bit prefix * SSQ900 LDA #192 ;select error text JMP PARMERR ;and report *************************************** * * SET SEND END-OF-LINE * ==================== * * Defines EOLN we use initially * *************************************** SSEOL LDA #124 ;set help text JSR LSTMNP ;get num par, check no more CMP #$20 BCS SSE900 ;j if not 0..31 STA SEOLN ;else note new value RTS SSE900 JMP SRS900 *************************************** * * SET RECEIVE * =========== * * Sets parameters affecting reception * *************************************** SRECV EQU * * * Next parameter is the option to set * LDX #>SRCTAB ;point to table LDY # $1F STA RSOP ;else note it RTS * * Here parameter is out of range * SRS900 LDA #194 ;get error text JMP PARMERR ;and report *************************************** * * SET RECEIVE TIMEOUT * =================== * * Defines timeout we use on remote * sending to us if TIMER is on * *************************************** SRTIME LDA #92 ;select help text JSR LSTMNP ;get num par, check no more STA RTIME ;and set the value RTS *************************************** * * SET RECEIVE PADCHAR * =================== * * Defines the pad character we ask * other side to send * *************************************** SRPADC LDA #99 ;select help text JSR LSTMNP ;get num par, check no more CMP #32 BCS SRS900 ;j if not 0-31 STA RPADC ;else save it RTS *************************************** * * SET RECEIVE PADDING * =================== * * Defines number of pads we ask other * side to send * *************************************** SRNPAD LDA #100 ;select help text JSR LSTMNP ;get num par, check no more CMP #95 BCS SRS900 ;j if not 0..94 STA RNPAD ;else note it RTS *************************************** * * SET RECEIVE PACKET-LENGTH * ========================= * * Sets value we ask other end to use as * maximum packet length * **************************************** SRPLEN LDA #122 ;select help text JSR LSTMNP ;get num par, check no more CMP #95 BCS SRP900 ;j if too big CMP #35 BCC SRP900 ;j if too small STA RMAXL ;else note the value RTS * * Here value is out of range * SRP900 JMP SRS900 *************************************** * * SET RECEIVE END-OF-LINE * ======================= * * Defines value we ask other end to use * as end-of-line * *************************************** SREOL LDA #123 ;select help text JSR LSTMNP ;get num par, check no more CMP #$20 ;is value > 31? BCS SRP900 ;j if not STA REOLN ;else note it RTS **************************************** * * SET INCOMPLETE * ============== * * Specifies fate of incomplete received * files * *************************************** SINCFD EQU * * * Next parameter is the action to take * LDX #>SITAB ;select option table LDY #SKTAB ;point to table LDY #CONTB1 ;point table of base values LDY #CON800 STA RESTART LDA #CLKBLK LDY #CFJTAB ; point to jump table STX JMPTBL LDX #ESC100 ;set up address of handler for next time STA CHARIN LDA #STDCHR STA CHARIN LDA #' ESQNUM EQU *-ESCSEQ-1 ESCADL DFB >ESCA DFB >ESCB DFB >ESCC DFB >ESCD DFB >ESCF DFB >ESCG DFB >ESCH DFB >ESCI DFB >ESCJ DFB >ESCK DFB >ESCY DFB >ESCZ DFB >ESCEQ DFB >ESCGT ESCADH DFB ESCY10 ; note handler for the next byte STA CHARIN LDA #ESCY20 ;set address for the next byte STA CHARIN LDA # : Enter/exit keypad application mode * --------------- * ESCEQ EQU * ESCGT JMP ESC130 ;null command * * * ESC Z : Identify terminal * ----- * ESCZ JSR TXESC ;send ESCAPE LDA #'/' JSR TXECHO ;then a "/" LDA #'Z' JSR TXECHO ;then a "Z" JMP ESC130 *************************************** * * CURSOR/F/SHIFT-F/KEYPAD HANDLER * =============================== * * Sends the relevant ESCAPE sequence * for these keys * *************************************** CFSF EQU * * * Is this a Master keypad key? * CMP #$D2 BCC CFF180 ;j if not * * It's a keypad key, so translate it into a function key value * LDY #24 CFF120 CMP CFFTB2,Y ;check in translate table BEQ CFF190 ;j if found it DEY BPL CFF120 ;j if more to check RTS ;else not there, so ignore the key * * Scale key and get final byte of sequence we send * CFF180 SEC SBC #FKEY TAY CFF190 LDA CFFTAB,Y ;get final byte BEQ CFF900 ;j if no sequence for this key PHA ;else save it for a moment * * First we send ESCAPE * JSR TXESC * * If final character of sequence is 'l'..'y' or 'M' preced it with a '?' * PLA ;get final byte CMP #'M' BEQ CFF200 ;j if it's 'M' CMP #'l' BCC CFF300 ;j if not 'l'..'z' CFF200 PHA ;else resave character LDA #'?' JSR TXECHO ;send the '?' PLA ;reload character * * And send final byte of sequence * CFF300 JSR TXECHO CFF900 RTS CFFTAB DFB 'p' ;F0 - keypad keys 0..9 DFB 'q' ;F1 DFB 'r' ;F2 DFB 's' ;F3 DFB 't' ;F4 DFB 'u' ;F5 DFB 'v' ;F6 DFB 'w' ;F7 DFB 'x' ;F8 DFB 'y' ;F9 DFB 0 ;BREAK - not used DFB 0 ;COPY- not used DFB 'D' ;LEFT DFB 'C' ;RIGHT DFB 'B' ;DOWN DFB 'A' ;UP DFB 0 ;SF0 - not used DFB 'P' ;SF1 - PF1 DFB 'Q' ;SF2 - PF2 DFB 'R' ;SF3 - PF3 DFB 'S' ;SF4 - PF4 DFB 'm' ;SF5 - MINUS DFB 'l' ;SF6 - COMMA DFB 'n' ;SF7 - PERIOD DFB 'M' ;SF8 - ENTER DFB 0 ;SF9 - not used * This table translates the key codes * for master keypad keys to give the number * of the matching function key. The table * contains the key codes ordered in F-key * order CFFTB2 DFB $F5 ;0 DFB $F6 ;1 DFB $F7 ;2 DFB $F8 ;3 DFB $F9 ;4 DFB $FA ;5 DFB $FB ;6 DFB $FC ;7 DFB $FD ;8 DFB $FE ;9 DFB 0,0,0,0,0,0,0 ;unused keys in the middle DFB $F0 ;PF1 (key +) DFB $F2 ;PF2 (key -) DFB $F4 ;PF3 (key /) DFB $EF ;PF4 (key *) DFB $E8 ;MINUS (key #) DFB $F1 ;COMMA (key ,) DFB $F3 ;PERIOD (key .) DFB $D2 ;ENTER (key RETURN) *************************************** * * TXESC * ===== * * Transmits ESCAPE * *************************************** TXESC LDA #$1B JMP TXECHO *************************************** * * VT52 GRAPHICS CHARACTER SET * =========================== * * These are the definitions for the * VT52 Graphics Character set * *************************************** GRCHAR DFB %00111100 ;graphics character 95 DFB %01000010 DFB %10011001 DFB %10100001 DFB %10100001 DFB %10011001 DFB %01000010 DFB %00111100 DFB %00011000 ;graphics character 96 DFB %00111100 DFB %01111110 DFB %11111111 DFB %01111110 DFB %00111100 DFB %00011000 DFB %00000000 DFB %11001100 ;graphics character 97 DFB %11001100 DFB %00110011 DFB %00110011 DFB %11001100 DFB %11001100 DFB %00110011 DFB %00110011 DFB %10010000 ;graphics character 98 DFB %10010000 DFB %11110000 DFB %10010000 DFB %10011111 DFB %00000100 DFB %00000100 DFB %00000100 DFB %11110000 ;graphics character 99 DFB %10000000 DFB %11110000 DFB %10001111 DFB %10001000 DFB %00001111 DFB %00001000 DFB %00001000 DFB %11110000 ;graphics character 100 DFB %10000000 DFB %10000000 DFB %11111100 DFB %00010010 DFB %00011100 DFB %00010100 DFB %00010010 DFB %10000000 ;graphics character 101 DFB %10000000 DFB %10000000 DFB %10001111 DFB %11111000 DFB %00001110 DFB %00001000 DFB %00001000 DFB %01111000 ;graphics character 102 DFB %11001100 DFB %11001100 DFB %01111000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00011000 ;graphics character 103 DFB %00011000 DFB %01111110 DFB %00011000 DFB %00011000 DFB %00000000 DFB %01111110 DFB %00000000 DFB %10010000 ;graphics character 104 DFB %11010000 DFB %10110000 DFB %10010000 DFB %00001000 DFB %00001000 DFB %00001000 DFB %00001111 DFB %10001000 ;graphics character 105 DFB %10001000 DFB %10001000 DFB %01010000 DFB %00111111 DFB %00000100 DFB %00000100 DFB %00000100 DFB %00011000 ;graphics character 106 DFB %00011000 DFB %00011000 DFB %11111000 DFB %11111000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 107 DFB %00000000 DFB %00000000 DFB %11111000 DFB %11111000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00000000 ;graphics character 108 DFB %00000000 DFB %00000000 DFB %00011111 DFB %00011111 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 ;graphics character 109 DFB %00011000 DFB %00011000 DFB %00011111 DFB %00011111 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00011000 ;graphics character 110 DFB %00011000 DFB %00011000 DFB %11111111 DFB %11111111 DFB %00011000 DFB %00011000 DFB %00011000 DFB %11111111 ;graphics character 111 DFB %11111111 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 112 DFB %11111111 DFB %11111111 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 113 DFB %00000000 DFB %11111111 DFB %11111111 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 114 DFB %00000000 DFB %00000000 DFB %00000000 DFB %11111111 DFB %11111111 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 115 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 DFB %11111111 DFB %11111111 DFB %00011000 ;graphics character 116 DFB %00011000 DFB %00011000 DFB %00011111 DFB %00011111 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 ;graphics character 117 DFB %00011000 DFB %00011000 DFB %11111000 DFB %11111000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 ;graphics character 118 DFB %00011000 DFB %00011000 DFB %11111111 DFB %11111111 DFB %00000000 DFB %00000000 DFB %00000000 DFB %00000000 ;graphics character 119 DFB %00000000 DFB %00000000 DFB %11111111 DFB %11111111 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 ;graphics character 120 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00011000 DFB %00000110 ;graphics character 121 DFB %00011000 DFB %01100000 DFB %00011000 DFB %00000110 DFB %00000000 DFB %01111110 DFB %00000000 DFB %01100000 ;graphics character 122 DFB %00011000 DFB %00000110 DFB %00011000 DFB %01100000 DFB %00000000 DFB %01111110 DFB %00000000 DFB %00000000 ;graphics character 123 DFB %00000011 DFB %11111111 DFB %01100110 DFB %01100110 DFB %01100110 DFB %01100110 DFB %00000000 DFB %00000011 ;graphics character 124 DFB %00000110 DFB %11111111 DFB %00001100 DFB %00011000 DFB %11111111 DFB %01100000 DFB %11000000 DFB %00011100 ;graphics character 125 DFB %00110110 DFB %00110000 DFB %01111100 DFB %00110000 DFB %00110000 DFB %01111110 DFB %00000000 DFB %00000000 ;graphics character 126 DFB %00000000 DFB %00000000 DFB %00011000 DFB %00011000 DFB %00000000 DFB %00000000 DFB %00000000 NEXT BBCPM1 ****** File BBCTX1 ************************************************************* START TX1 * BBCTX1: Updated 10/01/87 @ 1730 *************************************** * * TEXTS * ----- * * These texts are output by the message * system. * * Control bytes used are: * * TXT recurse to output text n * MSP output n spaces * RPT output n copies of character m * LIT output character n as is * XCR output byte value 13 without change to CR-LF * MTXT recurse to output text m, n times * *************************************** M0 DFB 3,22,7,TXT,151 DFB NORMHT,TXT,120 ;version string DFB $0D,TXT,151,$0D DFB GREEN DFB TXT,119 ;'By Lancaster ....' DFB EOT M1 ASC 'RX:' DFB EOT M2 DFB $0D ASC 'SOH!' DFB $0D DFB EOT M3 DFB $0D ASC 'Early EOLN' DFB $0D DFB EOT M4 DFB $0D ASC 'Short pkt' DFB EOT M5 DFB $0D ASC 'Bad len' DFB $0D DFB EOT M6 DFB $0D ASC 'Bad c/s' DFB $0D DFB EOT M7 DFB $0D ASC 'BUF oflw' DFB $0D DFB EOT M8 DFB $0D ASC 'SENDSW' DFB TXT,153 ;' : State ' DFB EOT M9 DFB YELLOW,TXT,158,WHITE ;'BBC>' DFB EOT M10 DFB TXT,0 ;main header DFB 31,0,4,YELLOW ASC 'ACTION:' DFB CYAN,31,21,4,YELLOW ASC 'STATUS :' DFB CYAN,$0D,YELLOW ASC 'F.TYPE:' DFB CYAN,31,21,5,YELLOW ASC '8BIT PFX:' DFB CYAN,31,21,6,YELLOW ASC 'INTRPT :' DFB CYAN,31,0,10,YELLOW ASC 'FILENAMES' DFB $0D,CYAN ASC ' Remote:' DFB GREEN,$0D,CYAN ASC ' Local :' DFB GREEN,31,0,15,YELLOW ASC 'COUNTERS' DFB $0D,CYAN ASC ' Packets' DFB GREEN,31,14,16,'0',CYAN ASC ' Files' DFB GREEN ASC ' 0' DFB CYAN ASC ' Kbytes:' DFB $0D DFB CYAN ASC ' Retries' DFB GREEN,31,14,17,'0',CYAN DFB 31,29,17 ASC 'Current' DFB GREEN ASC ' 0' DFB CYAN ASC ' T/outs' DFB GREEN,31,14,18,'0',CYAN DFB 31,29,18 ASC 'Total ' DFB GREEN ASC ' 0' DFB EOT M11 DFB 31,0,8,YELLOW,7,NEWBG,RED ASC 'WARNING : Non-ASCII data ' DFB BLKBG DFB EOT M12 DFB 31,0,22 DFB TXT,138 ;'ERROR : ' DFB EOT M13 DFB $0D,$0D,YELLOW DFB TXT,216 ;'TRANSFER' DFB TXT,65 ;' PARAMETERS' DFB EOT M14 DFB 31,2,20,YELLOW,NEWBG,RED ASC 'RETURN for more; ESCAPE to quit ' DFB BLKBG DFB EOT M15 DFB $0D ASC 'RECSW' DFB TXT,153 ;' : State ' DFB EOT M16 DFB 31,0,24 DFB TXT,148 ;'Press any key to ' ASC 'return' DFB TXT,157 ;' to command mode' DFB EOT M17 DFB 31,0,20,FLASH,YELLOW ASC ' *** ' DFB TXT,216 ;'TRANSFER' ASC ' COMPLETED OK ***' DFB EOT M18 DFB ' ',CYAN DFB 'P',TXT,217 ;'Packet size' DFB MSP,3,GREEN DFB EOT M19 DFB 31,10,18 DFB EOT M20 DFB 31,9,XCR DFB EOT M21 ASC 'Byte' DFB TXT,221 ;' period' ASC ' delay (0-255)' DFB EOT M22 DFB 31,32,5 ASC 'Not used' DFB EOT M23 ASC 'Waiting ' DFB EOT M24 ASC 'Transmit' DFB EOT M25 ASC 'Receive ' DFB EOT M26 DFB 31,32,5 ASC 'In use ' DFB EOT M27 DFB $0D STR 'Options are :' DFB EOT M28 DFB 31,10,11 DFB EOT M29 DFB 31,10,12 DFB EOT M30 DFB CYAN ASC 'TX baud' DFB MSP,6,GREEN DFB EOT M31 DFB 31,23,16 DFB EOT M32 DFB TXT,154 ;'A filename on ' DFB TXT,163 ;' remote system' DFB EOT M33 DFB TXT,154 ;'A filename on ' ASC ' the BBC' DFB EOT M34 DFB 0,0,0 DFB EOT M35 ASC 'TX:' DFB EOT M36 DFB 31,10,16 DFB EOT M37 DFB 31,10,17 DFB EOT M38 ASC 'No more ' DFB TXT,180,'s' ;' parameters' ASC ' for this ' DFB TXT,169 ;'command' DFB EOT M39 DFB $0D ASC 'FB full' DFB $0D DFB EOT M40 DFB $0D ASC 'FB out' DFB $0D DFB EOT M41 DFB ' ',CYAN ASC '8bit ' DFB TXT,220 ;'prefix' DFB MSP,5,GREEN DFB EOT M42 DFB 31,32,6 DFB EOT M43 DFB 23,1,1,RPT,7,0 DFB EOT M44 DFB 23,1,RPT,8,0 DFB EOT M45 ASC 'Writing' DFB EOT M46 ASC 'Reading' DFB EOT M47 DFB 22,7 DFB EOT M48 DFB 28,0,24,79,1,12,26,$0A DFB EOT M49 DFB 31,9,4 ASC 'Receive' DFB TXT,56 ;' file' DFB EOT M50 DFB 31,9,4 ASC 'Send' DFB TXT,56 ;' file' DFB EOT M51 ASC 'Idle' DFB MSP,4 DFB EOT M52 ASC 'Opening ' DFB EOT M53 ASC 'Closing ' DFB EOT M54 DFB 31,32,4 DFB EOT M55 DFB CYAN ASC 'Handshake' DFB MSP,5,GREEN DFB EOT M56 ASC ' file' DFB EOT M57 DFB ' ',CYAN ASC 'MUX wait' DFB MSP,6,GREEN DFB EOT M58 ASC 'Delay after SEND ' DFB TXT,169 ;'command' DFB TXT,159 ;', in seconds' DFB EOT M59 ASC 'Pausing ' DFB EOT M60 ASC 'Delay before ' DFB 'p',TXT,218 ;'packet' ASC ' send' DFB TXT,159 ;', in seconds' DFB EOT M61 DFB 28,0,24,79 DFB EOT M62 DFB 12,26 DFB EOT M63 DFB ' ',CYAN ASC 'RX baud' DFB MSP,5,GREEN DFB EOT M64 DFB CYAN ASC 'Debugging' DFB MSP,6,GREEN DFB EOT M65 STR ' PARAMETERS' DFB EOT M66 DFB ' ',CYAN ASC 'Parity' DFB MSP,6,GREEN DFB EOT M67 DFB ' ',CYAN ASC 'Retries' DFB MSP,7,GREEN DFB EOT M68 DFB ' ',CYAN ASC 'TX pause(s)' DFB MSP,3,GREEN DFB EOT M69 DFB CYAN ASC 'SEND delay(s) ' DFB GREEN DFB EOT M70 DFB ' ',CYAN DFB 'T',TXT,91,' ',' ' ;'Terminal ' DFB GREEN DFB EOT M71 DFB ' ',CYAN DFB TXT,191,' ' ;'Quote character' DFB GREEN DFB EOT M72 DFB 31,9,5 DFB EOT M73 DFB TXT,172 ;'Character' ASC ' we use for control quoting' DFB EOT M74 DFB ' ',CYAN ASC 'Local ' DFB TXT,219 ;'echo' DFB MSP,4,GREEN DFB EOT M75 ASC 'CTRL-' DFB EOT M76 DFB $0C,YELLOW ASC 'GENERAL' DFB TXT,65 ;' PARAMETERS' DFB EOT M77 DFB $0D,YELLOW ASC 'RECEIVE' DFB TXT,65 ;' PARAMETERS' DFB EOT M78 DFB $0D,$0D,YELLOW ASC 'SEND' DFB TXT,65 ;' PARAMETERS' DFB EOT M79 DFB YELLOW ASC 'TERMINAL' DFB TXT,65 ;' PARAMETERS' DFB EOT M80 DFB CYAN ASC 'Timer' DFB MSP,10,GREEN DFB EOT M81 DFB CYAN ASC 'End-of-line' DFB MSP,4,GREEN,'X' DFB EOT M82 DFB CYAN DFB 'P',TXT,174 ;'Pad character' DFB MSP,2,GREEN,'&' DFB EOT M83 DFB ' ',CYAN DFB 'P',TXT,218 ;'Packet' ASC 'start' DFB MSP,2,GREEN,'&' DFB EOT M84 DFB $0D,$0D,YELLOW ASC 'FILE' DFB TXT,65 ;' PARAMETERS' DFB EOT M85 DFB ' ',CYAN DFB TXT,170 ;'File ' ASC 'type' DFB MSP,2,GREEN DFB EOT M86 DFB ' ',CYAN ASC 'Data source' DFB MSP,6,GREEN DFB EOT M87 EQU * IF ROM DFB $0D FI DFB ' ',CYAN ASC 'Data destination ' DFB GREEN DFB EOT M88 DFB CYAN ASC 'Pad count' DFB MSP,6,GREEN DFB EOT M89 DFB ' ',CYAN DFB TXT,205 ;'Timeout' ASC '(s)' DFB MSP,4,GREEN DFB EOT M90 DFB TXT,205 ;'Timeout' DFB $0D DFB EOT M91 ASC 'erminal ' DFB EOT M92 DFB TXT,205 ;'Timeout' ASC ' we use' DFB TXT,159 ;', in seconds' DFB EOT M93 DFB TXT,200 ;'Start-of-packet character' DFB TXT,201 ;' we send to remote' DFB TXT,202 ;' (0-31)' DFB EOT M94 DFB 'P',TXT,174 ;'Pad character' DFB TXT,224 ;' we send' DFB TXT,202 ;' (0-31)' DFB EOT M95 DFB TXT,213 ;'Number of ' DFB 'p',TXT,174,'s' ;'pad characters' DFB TXT,224 ;' we send' DFB EOT M96 DFB TXT,203 ;'End-of-line character' DFB TXT,201 ;' we send to remote' DFB TXT,202 ;' (0-31)' DFB EOT M97 DFB 31,0,8 DFB EOT M98 DFB TXT,200 ;'Start-of-packet character' DFB TXT,199 ;' we wish to receive' DFB TXT,202 ;' (0-31)' DFB EOT M99 DFB 'P',TXT,174 ;'Pad character' DFB TXT,160 ;' remote is to use' DFB TXT,202 ;' (0-31)' DFB EOT M100 DFB TXT,213 ;'Number of ' DFB 'p',TXT,174,'s' ;'pad characters' DFB TXT,160 ;' remote is to use' ASC ' (0-94)' DFB EOT M101 DFB TXT,205 ;'Timeout' DFB TXT,160 ;' remote is to use' DFB TXT,159 ;', in seconds' DFB EOT M102 ASC 'Hex a' DFB TXT,226 ;'ddress' DFB EOT M103 DFB TXT,170 ;'File ' DFB 'b',TXT,214 ;'buffer size' ASC ' (pages)' DFB EOT M104 DFB YELLOW,NEWBG,RED ASC '(Renamed by BBC ' DFB TXT,156 ;'KERMIT' ASC ') ' DFB BLKBG DFB EOT M105 DFB ' ',CYAN ASC 'Incomplete ' DFB GREEN DFB EOT M106 DFB CYAN DFB TXT,170 ;'File ' ASC 'warning' DFB MSP,3,GREEN DFB EOT M107 DFB TXT,170 ;'File ' ASC 'for t' DFB TXT,212 ;'erminal log' DFB $0D DFB EOT M108 DFB CYAN ASC 'End of record ' DFB GREEN DFB EOT M109 DFB ' ',CYAN DFB 'B',TXT,214 ;'Buffer size' ASC '(p)' DFB GREEN DFB EOT M110 DFB TXT,0 ;main header DFB 28,0,24,39,4 DFB EOT M111 DFB 31,36,0 DFB EOT M112 DFB CYAN DFB 'T',TXT,212 ;'Terminal log' DFB MSP,3,GREEN DFB EOT M113 DFB TXT,170 ;'File ' ASC 'for ' DFB TXT,156 ;'KERMIT' DFB ' ',TXT,180,'s' ;' parameters' DFB EOT M114 DFB TXT,175 ;'Suffix ' ASC 'added to remote filenames' DFB EOT M115 DFB CYAN DFB TXT,175 ;'Suffix ' DFB MSP,3,GREEN DFB EOT M116 DFB TXT,219,$0D ;'echo' DFB EOT M117 DFB TXT,170 ;'File ' ASC 'of ' DFB TXT,156 ;'KERMIT' DFB ' ',TXT,169,'s' ;'commands' DFB EOT M118 DFB CYAN ASC 'TAKE-' DFB TXT,170 ;'File ' DFB TXT,219,' ' ;'echo ' DFB GREEN DFB EOT M119 ASC 'By Lancaster University Computing Dept' DFB EOT M120 EQU * IF ROM ASC 'ROM' ELSE ASC 'RAM' FI DFB TXT,222 ;' Vm.vv' DFB EOT M121 DFB ' ',CYAN ASC 'Key clicks' DFB MSP,4,GREEN DFB EOT M122 ASC 'Maximum ' DFB 'p',TXT,217 ;'packet size' DFB TXT,199 ;' we wish to receive' ASC ' (35-94)' DFB EOT M123 DFB TXT,203 ;'End-of-line character' DFB TXT,201 ;' we send to remote' DFB TXT,202 ;' (0-31)' DFB EOT M124 DFB TXT,203 ;'End-of-line character' DFB TXT,199 ;' we wish to receive' DFB TXT,202 ;' (0-31)' DFB EOT M125 ASC 'Eight-bit-' DFB TXT,220 ;'prefix' DFB TXT,152 ;' character' DFB EOT M126 ASC 'ON' DFB EOT M127 ASC 'OFF' DFB EOT M128 DFB TXT,207 ;'BBC Kermit' ASC ': ' DFB TXT,119 ;'By Lancaster ... ' DFB MSP,9,TXT,120,$0D ;version string DFB EOT M129 DFB CYAN ASC 'Flow ctrl ' DFB GREEN DFB EOT NEXT BBCTX2 ****** File BBCTX2 ************************************************************* START TX2 * BBCTX2 : Updated 10/07/86 @ 1800 M130 ASC 'Wait' DFB TXT,221 ;' period' DFB TXT,159 ;', in seconds' DFB EOT M131 DFB TXT,23,$0D ;'Waiting' DFB EOT M132 ASC 'Text to display' DFB EOT M133 DFB CYAN ASC 'VDU colour ' DFB GREEN DFB EOT M134 DFB 19,1 DFB EOT M135 DFB TXT,136 ;inverse video ASC 'C-F||0=Exit||1=Disc||2=Prnt||3=Hold||4=Crsr||5=' DFB MSP,4 ASC '||6=' DFB MSP,4 ASC '||7=' DFB MSP,4 ASC '||8=Lbrk||9=Brk ||' DFB MSP,6 DFB TXT,137 ;normal video DFB EOT M136 DFB 17,129,17,0 DFB EOT M137 DFB 17,128,17,1 DFB EOT M138 ASC 'ERROR : ' DFB EOT M139 DFB ' ',CYAN ASC 'Ignore char' DFB MSP,3,GREEN DFB EOT M140 DFB CYAN ASC '*TV pars' DFB MSP,3,GREEN DFB EOT M141 DFB TXT,172 ;'Character' ASC ' to ignore' DFB EOT M142 DFB 3,28,0,24,79,24,12,26,31,0,24,$0A DFB EOT M143 ASC '*TV ' DFB TXT,180 ;'parameter' DFB EOT M144 ASC 'Address' DFB EOT M145 DFB 31,37,17 DFB EOT M146 DFB ' ',CYAN ASC 'Help trigger' DFB MSP,4,GREEN DFB EOT M147 ASC 'Sure (Y/N)? ' DFB EOT M148 ASC 'Press any key to ' DFB EOT M149 DFB 31,37,18 DFB EOT M150 ASC 'Retries allowed (1..255)' DFB EOT M151 DFB YELLOW,NEWBG,DOUBLE,BLUE DFB TXT,207 ;'CUCCA KERMIT (RxM) ' DFB EOT M152 ASC ' c' DFB TXT,173 ;'haracter' DFB EOT M153 ASC ' : State ' DFB EOT M154 ASC 'A' DFB TXT,171 ;' filename on' DFB EOT M155 DFB MSP,4,TXT,75,'F' ;'CTRL-F' DFB EOT M156 ASC 'KERMIT' DFB EOT M157 ASC ' to ' DFB TXT,169 ;'command' ASC ' mode' DFB EOT M158 ASC 'BBC>' DFB EOT M159 ASC ', in seconds' DFB EOT M160 DFB TXT,163 ;' remote system' ASC ' is to use' DFB EOT M161 ASC 'Filespec for' DFB TXT,163 ;' remote system' ASC ' directory list' DFB EOT M162 ASC 'Old' DFB TXT,171 ;' filename on' DFB TXT,163 ;' remote system' DFB EOT M163 ASC ' remote system' DFB EOT M164 ASC 'New' DFB TXT,171 ;' filename on' DFB TXT,163 ;' remote system' DFB EOT M165 ASC 'Topic on' DFB TXT,163 ;' remote system' DFB EOT M166 ASC 'System ' DFB TXT,169 ;'command' ASC ' on' DFB TXT,163 ;' remote system' DFB EOT M167 ASC 'Not a ' DFB EOT M168 ASC 'Disc area on' DFB TXT,163 ;' remote system' DFB EOT M169 ASC 'command' DFB EOT M170 ASC 'File ' DFB EOT M171 ASC ' filename on' DFB EOT M172 ASC 'C' DFB TXT,173 ;'haracter' DFB EOT M173 ASC 'haracter' DFB EOT M174 ASC 'ad' DFB TXT,152 ;' character' DFB EOT M175 ASC 'Suffix ' DFB EOT M176 ASC ' logging ' DFB EOT M177 DFB TXT,158,' ' ;'BBC> ' DFB EOT M178 DFB 31,2,20,YELLOW,NEWBG,RED,' ',' ' DFB TXT,148 ;'Press any key to ' ASC 'continue' DFB MSP,6,BLKBG DFB EOT M179 DFB $0D DFB TXT,138 ;'ERROR : ' DFB EOT M180 ASC 'parameter' DFB EOT M181 ASC 'Mandatory ' DFB TXT,180,'s' ;'parameters' ASC ' missing' DFB EOT M182 ASC 'Too many ' DFB TXT,180,'s' ;'paramaters' ASC ' supplied' DFB EOT M183 ASC 'Ambiguous' DFB TXT,185 ;' command or parameter' DFB EOT M184 ASC 'Unknown' DFB TXT,185 ;' command or parameter' DFB EOT M185 DFB ' ',TXT,169 ;' command' ASC ' or ' DFB TXT,180 ;'parametr' DFB EOT M186 DFB TXT,187 ;'Not a valid ' DFB TXT,125 ;'Eight-bit-prefix character' DFB EOT M187 DFB TXT,167 ;'Not a ' ASC 'valid ' DFB EOT M188 DFB TXT,125 ;'Eight-bit-prefix character' DFB TXT,193 ;' cannot be same as ' DFB TXT,191 ;'Quote character' DFB EOT M189 DFB TXT,175 ;'Suffix ' ASC 'string' DFB TXT,190 ;' is too long' DFB EOT M190 ASC ' is too long' DFB EOT M191 ASC 'Quote' DFB TXT,152 ;' character' DFB EOT M192 DFB TXT,191 ;'Quote character' DFB TXT,193 ;' cannot be same as ' DFB TXT,125 ;'Eight-bit-prefix character' DFB EOT M193 ASC " can't be same as " DFB EOT M194 ASC 'Value is out of range' DFB EOT M195 DFB TXT,170 ;'File ' ASC 'name' DFB TXT,190 ;' is too long' DFB EOT M196 DFB TXT,187 ;'Not a valid ' ASC 'number' DFB EOT M197 ASC 'Directory on' DFB TXT,163 ;' remote system' DFB EOT M198 DFB TXT,167 ;'Not a ' ASC 'single' DFB TXT,152 ;' character' DFB EOT M199 ASC ' we wish to receive' DFB EOT M200 ASC 'Start-of-' DFB 'p',TXT,218 ;'packet' DFB TXT,152 ;' character' DFB EOT M201 DFB TXT,224 ;' we send' ASC ' to' DFB TXT,163 ;' remote system' DFB EOT M202 ASC ' (0-31)' DFB EOT M203 ASC 'End-of-line' DFB TXT,152 ;' character' DFB EOT M204 ASC 'Password?' DFB EOT M205 ASC 'Timeout' DFB EOT M206 DFB 28,0,0,79,0,12,26,11 DFB EOT M207 ASC ' BBC MICRO ' DFB TXT,156 ;'KERMIT' ASC ' ' DFB EOT M208 ASC 'DL/PT ' DFB EOT M209 ASC 'Type? ' DFB EOT M210 DFB 22,3 DFB EOT M211 DFB 22,7 DFB YELLOW,NEWBG,RED ASC 'CF:0=Exi:1=Dsc:2=Prt:3=Hld:4=' DFB MSP,3,':',$0D DFB YELLOW,NEWBG,RED ASC ' :5=' DFB MSP,3 ASC ':6=' DFB MSP,3 ASC ':7=' DFB MSP,3 ASC ':8=Lbk:9=Brk:' DFB 28,0,24,39,2 DFB EOT M212 DFB TXT,91 ;'erminal ' ASC 'log' DFB EOT M213 ASC 'Number of ' DFB EOT M214 ASC 'uffer size' DFB EOT M215 DFB ' ',CYAN ASC 'Name ' DFB GREEN DFB EOT M216 ASC 'TRANSFER' DFB EOT M217 DFB TXT,218 ;'acket ' ASC 'size' DFB EOT M218 ASC 'acket ' DFB EOT M219 ASC 'echo' DFB EOT M220 ASC 'prefix' DFB EOT M221 ASC ' period' DFB EOT M222 ASC ' V' DFB MARK+$30 ASC '.' DFB VERSION/10+$30 DFB (VERSION-(VERSION/10*10))+$30 IF ~LEVEL DFB LEVEL+'A' ELSE DFB ' ' FI DFB EOT M223 DFB $0D,TXT,156 ;'KERMIT' DFB TXT,222,$0D ;' Vm.vv' DFB EOT M224 ASC ' we send' DFB EOT M225 DFB TXT,170 ;'File ' ASC 'to transmit' DFB EOT M226 ASC 'ddress' DFB EOT M227 DFB 'A',TXT,226 ;'Address' DFB EOT *************************************** * * MESSAGE ADDRESS TABLE * ===================== * * This defines the start address of each * of the texts. * * The first table holds the low bytes of * each address, one message per table byte * * The second table is built with the MTHE * macro. It contains a list of message numbers, * each being the first message to start * within one page, relative to the page * M0 is in. The macro takes two parameters, * so for message n the call should be * MTHE n-1,n * *************************************** MSGTBL DFB >M0,>M1,>M2,>M3,>M4,>M5,>M6,>M7,>M8,>M9 DFB >M10,>M11,>M12,>M13,>M14,>M15,>M16,>M17,>M18,>M19 DFB >M20,>M21,>M22,>M23,>M24,>M25,>M26,>M27,>M28,>M29 DFB >M30,>M31,>M32,>M33,>M34,>M35,>M36,>M37,>M38,>M39 DFB >M40,>M41,>M42,>M43,>M44,>M45,>M46,>M47,>M48,>M49 DFB >M50,>M51,>M52,>M53,>M54,>M55,>M56,>M57,>M58,>M59 DFB >M60,>M61,>M62,>M63,>M64,>M65,>M66,>M67,>M68,>M69 DFB >M70,>M71,>M72,>M73,>M74,>M75,>M76,>M77,>M78,>M79 DFB >M80,>M81,>M82,>M83,>M84,>M85,>M86,>M87,>M88,>M89 DFB >M90,>M91,>M92,>M93,>M94,>M95,>M96,>M97,>M98,>M99 DFB >M100,>M101,>M102,>M103,>M104,>M105,>M106,>M107,>M108,>M109 DFB >M110,>M111,>M112,>M113,>M114,>M115,>M116,>M117,>M118,>M119 DFB >M120,>M121,>M122,>M123,>M124,>M125,>M126,>M127,>M128,>M129 DFB >M130,>M131,>M132,>M133,>M134,>M135,>M136,>M137,>M138,>M139 DFB >M140,>M141,>M142,>M143,>M144,>M145,>M146,>M147,>M148,>M149 DFB >M150,>M151,>M152,>M153,>M154,>M155,>M156,>M157,>M158,>M159 DFB >M160,>M161,>M162,>M163,>M164,>M165,>M166,>M167,>M168,>M169 DFB >M170,>M171,>M172,>M173,>M174,>M175,>M176,>M177,>M178,>M179 DFB >M180,>M181,>M182,>M183,>M184,>M185,>M186,>M187,>M188,>M189 DFB >M190,>M191,>M192,>M193,>M194,>M195,>M196,>M197,>M198,>M199 DFB >M200,>M201,>M202,>M203,>M204,>M205,>M206,>M207,>M208,>M209 DFB >M210,>M211,>M212,>M213,>M214,>M215,>M216,>M217,>M218,>M219 DFB >M220,>M221,>M222,>M223,>M224,>M225,>M226,>M227 MSGTBH DFB 0 ;M0 starts page relative 0 MTHE 0,1 MTHE 1,2 MTHE 2,3 MTHE 3,4 MTHE 4,5 MTHE 5,6 MTHE 6,7 MTHE 7,8 MTHE 8,9 MTHE 9,10 MTHE 10,11 MTHE 11,12 MTHE 12,13 MTHE 13,14 MTHE 14,15 MTHE 15,16 MTHE 16,17 MTHE 17,18 MTHE 18,19 MTHE 19,20 MTHE 20,21 MTHE 21,22 MTHE 22,23 MTHE 23,24 MTHE 24,25 MTHE 25,26 MTHE 26,27 MTHE 27,28 MTHE 28,29 MTHE 29,30 MTHE 30,31 MTHE 31,32 MTHE 32,33 MTHE 33,34 MTHE 34,35 MTHE 35,36 MTHE 36,37 MTHE 37,38 MTHE 38,39 MTHE 39,40 MTHE 40,41 MTHE 41,42 MTHE 42,43 MTHE 43,44 MTHE 44,45 MTHE 45,46 MTHE 46,47 MTHE 47,48 MTHE 48,49 MTHE 49,50 MTHE 50,51 MTHE 51,52 MTHE 52,53 MTHE 53,54 MTHE 54,55 MTHE 55,56 MTHE 56,57 MTHE 57,58 MTHE 58,59 MTHE 59,60 MTHE 60,61 MTHE 61,62 MTHE 62,63 MTHE 63,64 MTHE 64,65 MTHE 65,66 MTHE 66,67 MTHE 67,68 MTHE 68,69 MTHE 69,70 MTHE 70,71 MTHE 71,72 MTHE 72,73 MTHE 73,74 MTHE 74,75 MTHE 75,76 MTHE 76,77 MTHE 77,78 MTHE 78,79 MTHE 79,80 MTHE 80,81 MTHE 81,82 MTHE 82,83 MTHE 83,84 MTHE 84,85 MTHE 85,86 MTHE 86,87 MTHE 87,88 MTHE 88,89 MTHE 89,90 MTHE 90,91 MTHE 91,92 MTHE 92,93 MTHE 93,94 MTHE 94,95 MTHE 95,96 MTHE 96,97 MTHE 97,98 MTHE 98,99 MTHE 99,100 MTHE 100,101 MTHE 101,102 MTHE 102,103 MTHE 103,104 MTHE 104,105 MTHE 105,106 MTHE 106,107 MTHE 107,108 MTHE 108,109 MTHE 109,110 MTHE 110,111 MTHE 111,112 MTHE 112,113 MTHE 113,114 MTHE 114,115 MTHE 115,116 MTHE 116,117 MTHE 117,118 MTHE 118,119 MTHE 119,120 MTHE 120,121 MTHE 121,122 MTHE 122,123 MTHE 123,124 MTHE 124,125 MTHE 125,126 MTHE 126,127 MTHE 127,128 MTHE 128,129 MTHE 129,130 MTHE 130,131 MTHE 131,132 MTHE 132,133 MTHE 133,134 MTHE 134,135 MTHE 135,136 MTHE 136,137 MTHE 137,138 MTHE 138,139 MTHE 139,140 MTHE 140,141 MTHE 141,142 MTHE 142,143 MTHE 143,144 MTHE 144,145 MTHE 145,146 MTHE 146,147 MTHE 147,148 MTHE 148,149 MTHE 149,150 MTHE 150,151 MTHE 151,152 MTHE 152,153 MTHE 153,154 MTHE 154,155 MTHE 155,156 MTHE 156,157 MTHE 157,158 MTHE 158,159 MTHE 159,160 MTHE 160,161 MTHE 161,162 MTHE 162,163 MTHE 163,164 MTHE 164,165 MTHE 165,166 MTHE 166,167 MTHE 167,168 MTHE 168,169 MTHE 169,170 MTHE 170,171 MTHE 171,172 MTHE 172,173 MTHE 173,174 MTHE 174,175 MTHE 175,176 MTHE 176,177 MTHE 177,178 MTHE 178,179 MTHE 179,180 MTHE 180,181 MTHE 181,182 MTHE 182,183 MTHE 183,184 MTHE 184,185 MTHE 185,186 MTHE 186,187 MTHE 187,188 MTHE 188,189 MTHE 189,190 MTHE 190,191 MTHE 191,192 MTHE 192,193 MTHE 193,194 MTHE 194,195 MTHE 195,196 MTHE 196,197 MTHE 197,198 MTHE 198,199 MTHE 199,200 MTHE 200,201 MTHE 201,202 MTHE 202,203 MTHE 203,204 MTHE 204,205 MTHE 205,206 MTHE 206,207 MTHE 207,208 MTHE 208,209 MTHE 209,210 MTHE 210,211 MTHE 211,212 MTHE 212,213 MTHE 213,214 MTHE 214,215 MTHE 215,216 MTHE 216,217 MTHE 217,218 MTHE 218,219 MTHE 219,220 MTHE 220,221 MTHE 221,222 MTHE 222,223 MTHE 223,224 MTHE 224,225 MTHE 225,226 MTHE 226,227 MTHCNT EQU *-MSGTBH-1 LST ON PRGTOP EQU * IF LFULL!LSTXXX&LIST LST ON ELSE LST OFF FI IF ROM DS $C000-* IF ~ADE DISP2 'ROM space free %D($C000-PRGTOP) bytes' FI FI ****** File BBCWKS ************************************************************* START WKS * BBCWKS: Updated 10/01/87 @ 1730 ************************************** * * WORKSPACE * ========= * * This defines the non-page 0 areas * to be used * ************************************** DSECT ORG $400 WKBASE EQU * *************************************** * * Locations in this block are maintained * by the main program but can be used * by a TXR for the same purposes. Their * location is fixed * *************************************** PTYPE DFB 0 ;0=ROM, $FF=RAM IOBUFF DS IOBSIZ ;comms buffer *************************************** * * This block contains the current SET * parameter values. A TXR may read them * but should not really change them * unless it is prepared to do any dependent * changes involved as well. TXRs *must* * access values as offsets from (DEFPTR) * above, as this block may move. The * offset values will not be changed. * * Also here are various odds and ends * used by the main program - TXRs must * not tamper with these * *************************************** DFBASE EQU * TXBAUD DFB 0 ;transmit baud rate RXBAUD DFB 0 ;receive baud rate ECHO DFB 0 ;local echo DFB 0 ;obsolete byte (1.03) DEBUG DFB 0 ;debug mode DFB 0 ;obsolete byte (1.03) STIME DFB 0 ;timeout he uses on me RTIME DFB 0 ;timeout I use on him TIMER DFB 0 ;whether I do timing PAUSE DFB 0 ;pause after packet read DELAY DFB 0 ;delay after SEND command DFB 0 ;obsolete byte (1.40) DFB 0 ;obsolete byte (1.40) CLICK DFB 0 ;keyclick flag SQUOTE DFB 0 ;quote I will send CUREBQ DFB 0 ;8 bit prefix I want to use SEOLN DFB 0 ;EOLN I send to start REOLN DFB 0 ;EOLN I ask him to send RPADC DFB 0 ;pad char I ask him to send RNPAD DFB 0 ;pad char count I ask him to use SPADC DFB 0 ;pad character I send SNPAD DFB 0 ;number I send PARITY DFB 0 ;parity setting FTYPE DFB 0 ;file type EORTYP DFB 0 ;type of EOR in use SOURCE DFB 0 ;source of data (file/memory) MSBASE DW 0 ;source base for memory MSTOP DW 0 ;source top for memory DESTIN DFB 0 ;destination (file/memory) MDBASE DW 0 ;dest base for memory MDTOP DW 0 ;dest top for memory SSOP DFB 0 ;start of packet I will send RSOP DFB 0 ;start of packet I expect him to send RMAXL DFB 0 ;max size packet (data + red tape) I want from him FBPAGES DFB 0 ;size of file buffer in pages FWARN DFB 0 ;file warning flag FINCOM DFB 0 ;incomplete file disposition FLOW DFB 0 ;flow control in use SUFLEN DFB 0 ;length of file suffix SUFFIX DS 8 ;file suffix (less the ".") TKECHO DFB 0 ;TAKE file echo VDUCOL DFB 0 ;VDU foreground colour TVFLAG DFB 0 ;flag for doing *TV TVPAR1 DFB 0 ;first *TV parameter TVPAR2 DFB 0 ;second *TV parameter IGNFLG DFB 0 ;flag for VDI ignore in use IGNCHR DFB 0 ;character to ignore MUXWT DFB 0 ;MUX wait in byte periods HLPTRG DFB 0 ;char triggering command autohelp MAXTRY DFB 0 ;max retries allowed HSHAKE DFB 0 ;handshake type in use TTYPE DFB 0 ;terminal type in use FNTYPE DFB 0 ;file name translation type DFTOP EQU * DFSIZE EQU *-DFBASE OLDIRQ DW 0 ;copy of old IRQ1 vector EOR DS 2 ;end-of-record bytes in use FSNUM DFB 0 ;number of filing system at start FBSIZE DW 0 ;size of buffer OLDHWM DFB 0 ;setting of OSHWM on entry STARTUP DFB 0 ;startup flag *************************************** * * Space from here to $7FF may be used * freely by a TXR. Such ROMs should * allocate space from $7FF down to * allow for expansion in the tables * above * *************************************** TXBUFF DS MAXPAK ;outgoing packet RXBUFF DS MAXPAK ;incoming packet SCBUFF DS MAXPAK ;buffer for building server command MAXINP EQU 120 ;max length of command line CMDBUF DS MAXINP ;input buffer MAXFNL EQU 64 ;max length of filename FBTOP DW 0 ;buffer high water mark FBMAX DW 0 ;pointer to byte past buffer FHAND DFB 0 ;file handle EOB DFB 0 ;buffer flags EOF DFB 0 GBPBLK DS 18 ;OSGBPB block for I/O; also OSFILE use GNXBLK DS 13 ; for directory scan RFNAME DS MAXFNL ;remote filename LFNLEN DFB 0 ;size of local name LFNAME DS MAXFNL ;local name - must follow LFNLEN LFGIVEN DFB 0 ;flag for explicit local name WCLEN DFB 0 ;length of wildcarded name WCNAME DS MAXFNL ;wildcarded name FSNLEN DFB 0 ;size of name FS allows IF *>$800 STOP '** Too much workspace **' FI DEND *************************************** * * This area defines the buffer used for * terminal mode logging. A TXR may use * it as it wishes * *************************************** DSECT ORG $A00 LOGBUF DS 256 DEND CHN BBCMAI