NOVATERM 9.5 Memory Map Copyright (c) 1989-1994 by Nick Rossi If you have any questions about writing modules or external programs with Novaterm, my addresses are: Internet: "voyager@eskimo.com" GEnie: "N.ROSSI" U.S. mail: Nick Rossi 10002 Aurora Ave. N. #1159 Seattle, WA 98133 The latest Novaterm updates are available at the Internet FTP site: FTP site: eskimo.com Directory: /voyager MEMORY OVERVIEW Hex Decimal Use $02A7-$02FF 679-767 ML work area $033C-$0343 828-835 vectors $0344-$03F1 836-1009 misc data tables $0400-$04FF 1024-1279 transmit table $0500-$05FF 1280-1535 receive table $0600-$064F 1536-1615 80 column tab stops $0650-$06FF 1616-1791 string input buffer $0700-$07FF 1792-2047 RS232 receive buffer $0800-$81FF 2048-33279 compiled BASIC $8200-$88FF 33280-35071 machine language $8900-$8BFF 35072-35839 80 column font $8C00-$8FFF 35840-36863 screen memory $9000-$95FF 36864-38143 terminal emulator $9600-$9FFF 38144-40959 machine language $A000-$BFFF 40960-49151 hi-res screen (80 columns) $B000-$B7FF 45056-47103 character set (40 columns) $B800-$BBFF 47104-48127 terminal screen save (40 columns) $BC00-$BFFF 48128-49151 color memory save (40 columns) $C000-$CBFF 49152-52223 file transfer protocol $CC00-$CD7F 52224-52607 modem driver $CD80-$CEFF 52608-52991 machine language $CF00-$CFFF 52992-53247 RAM expander interface $D000-$D7FF 53248-55295 hi-res screen save/font save $D800-$DBFF 55296-56319 color memory save (80 columns) $E000-$FFFF 57344-65535 buffer ZERO PAGE $02 - $03 2 - 3 REGISTER VECTOR Vector to the start of the data registers at location 703. $04 - $05 4 - 5 STATUS LINE VECTOR Vector to the start of the status line at location 836. $06 6 FLAG Bit flag used for various purposes: bit 0,1: unused bit 2: Buffer capture file open? (1=yes) bit 3: unused bit 4: Save buffer when full? (1=yes) bit 5: Flow control enabled? (1=yes) bit 6: Terminal in 80 column mode? (1=yes) bit 7: Status line on? (1=yes) $FB - $FC 251 - 252 BUFFER READ POINTER Pointer to the location in the buffer which will be read next. $FD - $FE 253 - 254 BUFFER WRITE POINTER Pointer to the location in the buffer which will be written to next. REGISTERS $02A7 - $02A8 679 - 680 BUFGET VECTOR Vector to Routine 72, which gets a byte from the buffer. $02A9 - $02AA 681 - 682 BUFSTR VECTOR Vector to Routine 75, which writes a byte to the buffer. $02AB - $02AC 683 - 684 ENABLE VECTOR Vector to Routine 21, which re-enables RS232 I/O after disk access. $02AD - $02AE 685 - 686 RSGET VECTOR Vector to Routine 27, which gets a character from the receive buffer and puts it in the accumulator. $02AF - $02B0 687 - 688 CARDET VECTOR Vector to Routine 57, which checks for a carrier. $02B1 - $02B2 689 - 690 DISABLE VECTOR Vector to Routine 24, which disables RS232 I/O before disk access. $02B3 - $02E0 691 - 736 NOVATERM REGISTERS Add the offset value given below to determine the true address of each register. 0-1 Pointer to the end of the current buffer read file. 2-3 Pointer to the end of the current buffer capture file. Updated as data is captured. 4 Set to 1 when the buffer fills up. 5 Set to 1 for output in 80 columns. 6 Set to 1 if host has been paused. 7 Saved cursor color from 80 column mode. 8 Flow control tolerance. 9 SwiftLink page map ($DE, $DF, or $D7). 10 Set to 1 if a SwiftLink is connected. 11 Set to 1 if the 80 column status line must be updated. 12 Color of 80 column status line (foreground and background). 13 Set to 1 if "Press C= M" already displayed. 14 Last value of phone ring detect register. 15 XOFF character. 16 XON character. 17 Saved cursor row position from 40 column terminal mode. 18 Saved cursor column position from 40 column terminal mode. 19 Saved cursor color from 40 column terminal mode. 20 Saved cursor row position from 80 column terminal mode. 21 Saved cursor column position from 80 column terminal mode. 22 Saved border color from 80 column terminal mode. 23 80 column text color. 24 80 column screen color. 25 Set to 1 if the bell is turned on. 26-28 Used to preserve A,X,Y registers in certain routines. 29 Number of detected string during script CHECK. 30 RAM expander device number. 31 SwiftLink command register parity. 32 Parity: 0=none, 1=even, 2=odd. 33-34 RS-232 start bit time. 35-36 RS-232 full bit time. 37 Flag/tab position for menu routine. 38 Color of 40 column status line. 39 Baud rate. 40-41 Unused. 42 Flow control type: 0=none, 1=XOFF/XON, 2=RTS/CTS 43 Zmodem auto-download, 1=on 44-45 Pointer to script search strings $02E1 - $02F0 737 - 752 FUNCTION KEY TRANSLATE TABLE Table used to translate the value of the current key pressed (location 203) combined with the appropriate shift, Commodore, or control key combination to produce the number of the function key that was pressed. The values in this table are: 7,1,3,5,8,2,4,6,16,13,14,15,12,9,10,11 MORE REGISTERS $033C - $033D 828 - 829 INDEX TO MAIN MACHINE LANGUAGE Vector to the start of the main machine language at $9600 (38400). $033E - $033F 830 - 831 OLDOUT VECTOR Vector to the old CHROUT routine used if the output device is not the modem. This will normally be $F1CA, but if a RAM expander is in use, it may be something else. $0342 - $0343 834 - 835 OLDCHKIN VECTOR Vector to the old location of the CHKOUT routine used to jump to the old routine if the output device is not the modem. This will normally be $F21B unless a RAM expander is present. $0344 - $036B 836 - 875 STATUS LINE Text for the status line is stored here. The values of the indicator bytes here are used to determine the status of the terminal. An ASCII display of this memory looks like this (quotes not included): "^:E:T:K:C:B:X: 00:00:00 " Add the offset value given below to determine the true location of each register. Each indicator is turned on by setting the high bit of the register. 0 An up-arrow means that command and function keys are taken as normal characters. 2 Local echo on/off. 4 ASCII translation on/off. 6 Control character display on/off. 8 Carrier indicator. 10 Buffer indicator (open or closed). 12 Indicates script file in progress. 31-38 On-line timer. $036C - $038F 876 - 911 BAUD RATE TABLES Contains the start-bit, full-bit, and transmit times for 300, 1200, and 2400 baud. $0390 - $0396 912 - 918 SWIFTLINK BAUD RATES Contains control register values for the seven baud rates. $0397 - $03A0 919 - 928 BELL SID OFFSETS Offsets from the beginning of the SID registers to which the bell sounding values are stored. $03A1 - $03AA 929 - 938 BELL SID VALUES Whenever the bell is sounded, the values here are stored in the SID chip locations pointed to by the preceding ten bytes, in order. $03AB - $03C4 939 - 964 80 COLUMN ROWS - LOW BYTES $03C5 - $03DE 965 - 990 80 COLUMN ROWS - HIGH BYTES This table gives bitmap memory addresses for the start of each 80 column display line. $03DF - $03E5 991 - 997 FLOW CONTROL TOLERANCES This table defines a default flow control tolerance for each baud rate. $0400 - $04FF 1024 - 1279 TRANSMIT TRANSLATION TABLE Characters sent to the modem are first replaced with the corresponding ASCII value in this table. $0500 - $05FF 1280 - 1535 RECEIVE TRANSLATION TABLE Characters received from the modem are replaced with the corresponding ASCII value in this table. $0600 - $064F 1536 - 1615 TAB STOPS Table of tab stops for 80 column mode. $0650 - $06FF 1616 - 1791 STRING INPUT BUFFER Buffer for reading strings from disk. $0700 - $07FF 1792 - 2047 RS232 RECEIVE BUFFER The NMI interrupt routine reads data from the modem and stores it here. $0800 - $81FF 2048 - 33279 COMPILED BASIC Main compiled BASIC program of Novaterm and variable storage area. 80 COLUMN SCREEN DRIVER The 80 column machine language handles all output in 80 column mode. A number of the routines are made available to external programs (such as the ANSI, VT52, and VT102 terminals) via a jump table. The 80 column mode uses location 214 for the cursor row position and location 211 for the cursor column position, as well as 209-210 as a pointer to the actual memory location of the cursor on the hi-res screen. $8500 34048 INIT Turns on hi-res mode and clears the hi-res screen. $8503 34051 CHROUT Takes the ASCII value in the .A register, executes the control code if a control character, or searches for the pattern in the 80 column font, puts the character on the screen, and advances the cursor. $8506 34054 BLCRSR Reverses the seventh nybble of the current cursor location, turning the underline cursor on or off. $8509 34057 ENTER Performs initialization without clearing the hi-res screen. $850C 34060 CALCRSR Calculates the actual screen location from the cursor column in 211 and the cursor row stored in .X register and stores in 209-210. $850F 34063 SCROLL Deletes the number of rows specified in the accumulator starting from the row specified in the .X register. $8512 34066 INSERT Inserts the number of rows given in the accumulator before the row specified in the .X register. $8515 34069 ERASE Blanks the row specified in the .X register. $8518 34072 PUTCHAR Puts a character in the current cursor location without updating the cursor. $851B 34075 CRSR Holds either the value $F0 (240) if the cursor is on the left side of a hi-res screen block, or $0F (15) if the cursor is on the right side of a screen block. $851C 34076 UNDERLINE Holds a 1 if printed characters are to be underlined. $851D 34077 COLOR80 Contains the foreground and background colors of 80 column text. The lower 4 bits are the background color and the higher 4 bits are the foreground (text) color. $851E 34078 BORDER80 Holds the value for the border color in 80 column mode. $851F 34079 SCTOP Specifies the upper boundary row of the scrolling region. $8520 34080 SCBOT Specifies the lower boundary row of the scrolling region. $8521 34081 BLANK Value of 1 forces character output to be blank spaces, regardless of attribute settings. $8522 34082 RVS Value of 1 causes characters to be reversed. A carriage return does not reset reverse mode as it does in 40 columns. $8523 34083 SCRL Number of lines to scroll in 80 columns. Only values between 0 and 3 produce useful results. $8900 - $8BFF 35072 - 35845 80 COLUMN FONT Each set of 8 bytes holds two character patterns. The first four bits of each of the 8 bytes make up one character, and the last four bits of each byte make up the other character. Locations $8900-$8A7F hold characters 32 through 127 and locations $8A80-$8BFF hold characters 160 through 255. Note that there are more character patterns available in 80 column mode than in 40 columns. $8C00 - $8FFF 35840 - 36863 SCREEN MEMORY TERMINAL EMULATORS This small area near the top of BASIC is the location of the terminal emulator modules. SYS 36864 or JSR $9000 will enter terminal mode. As soon as control is returned to the basic program, Novaterm checks the exit code to determine what interrupted terminal mode. Novaterm then takes the appropriate action. If you are going to write a terminal emulator, all you need to do to check the necessary conditions is include a call to display the status line and a call to the routine CHECK at $CD89. The CHECK routine leaves the exit code in the accumulator, and your terminal emulator must store this value in location 36872 and exit if it is not zero. $9000 36864 TERMINAL EMULATOR $9003 36869 TERMINAL EMULATOR REGISTERS Add the offset value given below to determine the true value of each register. 0 flag: bit 0: 1=80 columns only bit 1: 1=don't allow c/g mode 1 Last character received from modem. 2 Last character from keyboard. 3 Terminal emulator exit code. The codes are: 1: C= (logo) key pressed 2: function key pressed 3: C= 0 pressed 4: script file check string found 5: carrier detected 6: carrier lost 7: ring detected 4 Number of function key pressed. (1-16) 5 Temporary location for character. 6 Control key pressed? (4=yes) MACHINE LANGUAGE This area in memory contains the machine language routines. Each routine number represents the byte offset from the starting location of 38400 ($9600). Routine 0 PRINT Used by the terminal emulators to print characters to the screen in terminal mode, taking into account the color and character under the cursor and ensuring that the cursor does not move underneath the status line if it is on. Routine 3 SETCRSR Used by PRINT to turn on the cursor and save the color and character. Routine 6 RETCRSR Restores the screen location to its previous color and character. Routine 9 STATLIN Puts the status line at the top of the screen if the flag is set. Routine 12 BELL Uses the values and offsets in locations 912-931 to sound the bell. Routine 15 OUTPUT Outputs the string contained in S$ to the modem, taking into account ASCII translation and control characters (such as ^M for a return). If local echo is on, output is sent to the screen as well. If the byte immediately to the right of the last colon symbol in the status line has its high bit set, output to the modem will be supressed. Used for local mode in the BBS module. Routine 18 RVSLIN Reverses characters on a screen line starting from the current cursor location and proceeding until it reaches an ASCII 96 (invisible character, like a space). Used to highlight menu selections. Routine 21 INABLE Re-enables RS232 input/output by initializing the CIA #2 chip with timer values. In machine language modules (especially protocols), this routine should be called after disk access. Routine 24 DISABL Disables RS232 input/output by turning off the CIA timer. This routine should be called before turning off any interrupts. Routine 27 RSGET Gets a character from receive buffer and puts it in the accumulator. Routine 30 RSOUT Puts the character in the accumlator into the transmit buffer. Routine 33 SETBAUD Uses the values from the baud rate table pointed to by the accumulator (by storing in location 780 from BASIC either a 0 for 300 baud, 1 for 1200 baud, or 2 for 2400 baud). PAL baud rates are accounted for. Routine 36 INIT Initialization routine executed when the BASIC program begins. Sets the registers to their defaults, sets the locations of the RS232 buffers, and sets up vectors to the buffer routines. Routine 39 KEYBD Keyboard input routine. This takes the value in the accumulator (location 780 from BASIC) as the maximum length for the string, and the string is stored in I$. Routine 42 PRINTEX Jumps into the middle of the PRINT routine to store characters in the buffer without actually printing them. Used by ANSI and VT102 terminals to capture escape sequences. Routine 45 SAVESCR Used when terminal mode is exited. Either saves 40 column screen to $B800-$BFFF or leaves hi-res mode. Routine 48 RESTSCR Used when terminal mode is entered. Either restores the saved terminal screen or enters hi-res mode. Routine 51 KEYCHK Checks to see if the last key pressed was a function key. If it was, it determines which function key was pressed using location 203, location 653, and the table at locations 737-752. Routine 54 DIRFIL Reads a directory entry from disk and stores it in Z$ when the directory file is opened with logical file #1 (as in OPEN 1,8,0,"$") Routine 57 FILLSCR Fills color memory with the current cursor color (location 646). Routine 60 GETSTR Inputs a string from the logical file specified in the .X register. Routine 63 FLOWCTRL Starts or stops the remote using the selected flow control type. Set the .X register to 0 to stop or 1 to start. Routine 66 SETLOOK Finds the location of the array LK$(0..6), which contains pointers to the script file search strings. Stores the location of the array in Novaterm registers 44-45. Routine 69 JUMP Performs the script command JUMP by reading characters from the buffer until it encounters a value of 255, which indicates the end of a script statement. Routine 72 BUFGET Reads one byte from the location pointed to by locations 251-252 into the .A register and increments the counter. It will not read a character if the pointer is at the end of the buffer. Routine 75 BUFSTR Stores the byte in the .A register into the location pointed to by locations 253-254. Does not store a byte if the pointer is at the end of the buffer. Routine 78 BUFDEL Deletes the current buffer entry. Routine 81 CHKREC Puts a 1 in the accumulator if data is being received from the modem. Routine 84 BLANKSCR Blanks or un-blanks the screen. $9657 - $9658 38487 - 38488 VECTOR Contains a vector to the register table at location 689. $A000-$BFFF 40960 - 49151 80-COLUMN HI-RESOLUTION BITMAP The hi-resolution screen is placed here in 80 column mode. $B000 - $B7FF 45056 - 47103 CHARACTER SET Font files are loaded directly into this area. When 80 column mode is entered, this memory block is moved into the RAM underneath $D000 for temporary storage. $B800 - $BBFF 47104 - 44031 TERMINAL SCREEN SAVE Used to save the contents of screen memory when terminal mode is exited. Restored when terminal mode is entered. $BC00 - $BFFF 44032 - 45055 TEMPORARY COLOR MEMORY SAVE Used to save color memory when terminal mode is exited. Restored to color RAM when terminal mode is entered. PROTOCOLS A simple format for protocol files has been developed to keep things standard. If you follow the format use the registers properly, you can write any new protocol. NOTE: When you write a protocol, you will need memory to store the data bytes contained in each protocol block. That block MUST be stored in this memory area, but it doesn't matter where in the range it is located. Don't use some other memory to store the protocol block, because there really isn't any free space not used by Novaterm. To use a protocol from basic, you must first set the file name in the variable I$. Open the file with logical file #2 first before an upload, but only first before a download if the file name and file type are not received during the download. POKE the proper values for the block size, ASCII translation on or off, buffer transfer on or off, disk device number, and drive number. Then SYS the appropriate location for an upload or download. After the transfer is done, check the abort code register to see if the transfer aborted abnormally. NOTE: If you are going to use an existing modem driver separately, you MUST have the vectors in locations 679-688 set to routines that are the equivalents of those found in Novaterm's machine language code. Here is an example of BASIC program text for downloading with single file or batch file protocols: 999 PT=49161 : FL=0 : REM set the index variable 1000 IF PEEK(PT+14) AND 10 THEN 1020 : REM skip input of file name if protocol is batch or file name received 1005 INPUT"Name of file";I$ : IF I$="" THEN END 1010 TT=0 : IF(PEEK(PT+14) AND 1)=0 THEN INPUT"File type (P,S,U)" ;TP$ :TT=-(TP$="P")- 2*(TP$="S")-3*(TP$="U") : REM TT = 1 for P, 2 for S, 3 for U : REM if bit 0 of attribute is 0, file type is not received 1020 POKE PT,1 : REM suppress display of block on screen 1021 POKE PT+18,DV : REM poke device number 1022 POKE PT+21,0 : REM to or from disk (change to 1 for buffer) 1023 POKE PT+22,0 : REM ASCII translation off (change to 1 for on) 1025 IF PEEK(PT+14) AND 11 THEN 1040 1030 OPEN 2,DV,2,I$+","+TP$+",W" : REM if protocol is not batch, file name received, or file type received, then open the file 1035 PRINT : PRINT" Bytes recv: Errors:"; : REM there must be EXACTLY 9 spaces between "Bytes recv" and "Errors" 1040 POKE PT+16,TT : SYS PT-6 : TT=PEEK(PT+16) : CLOSE 2 : REM store file type, then download, then get a received type. close file #2 for safety. 1045 IF PEEK(PT+15) THEN END : REM if abort register is not zero, end transfer 1047 IF FL THEN BY=PEEK(PT+11) + PEEK(PT+12)*256 + PEEK(PT+13)*65536 : REM byte count for previous file 1050 A=0 : IF (PEEK(PT+14) AND 11) AND I$>"" THEN FL=1 : TP$=MID$("PSU",TT,1) : A=1 : REM set variable A to execute more statements under this condition : REM if protocol is batch, file name received, or file type received, then get file type. received file name should be stored in I$. if I$ is empty, then batch protocol is finished. 1060 IF A THEN IF LEN(I$)>1 THEN IF MID$(I$,LEN(I$)-1,1)="," THEN TP$=RIGHT(I$,1) : I$=LEFT$(I$,LEN(I$)-2) : REM if the received file name has a file type attached (e.g. I$="file,p") then amputate the type and retain in TP$ 1070 IF A THEN 1030 : REM finally, go to open the file. then re-enter protocol through same vector, and download will continue. 1080 END The following BASIC program text is for uploading with a single file or batch protocol: 999 PT=49161 : FL=0 : DIM F$(16) : OPEN 15,DV,15 1000 IF (PEEK(PT+14) AND 8)=0 THEN exit: REM if not batch protocol, skip multiple file input 1010 PRINT"Name of file #"FL+1; : INPUT I$ 1020 IF I$>"" THEN FL=FL+1 : F$(FL)=I$ : IF FL<16 THEN 1010 1030 IF FL=0 THEN END 1040 FOR I=1 TO FL : I$=F$(I) : GOSUB 1050 : REM enter FOR loop. set I$ to current file name, then GOSUB the program to upload file. 1050 IF PEEK(PT+15) THEN I=FL : REM if transfer aborted, don't send any more files -- set FOR variable to end 1060 NEXT : I$="" : GOSUB 1050 : REM must GOSUB the upload routine one more time with an empty file name. this tells the protocol to end the transfer. 1070 END 1100 INPUT"File name";I$ : IF I$="" THEN END 1110 TT=1 : OPEN 2,DV,2,I$+",P" : INPUT#15,E : IF E>19 AND E<>64 THEN CLOSE 2 : END : REM if disk error (not file type mismatch) then end 1120 IF E=64 THEN CLOSE 2 : TT=2 : OPEN 2,DV,2,I$+",S" : INPUT#15,E : IF E=64 THEN CLOSE 2 : TT=3 : OPEN 2,DV,2,I$+",U" : INPUT#15,E : IF E=64 THEN CLOSE 2 : END : REM check for correct file type 1130 PRINT : PRINT" Bytes sent: Errors:"; : REM there must be EXACTLY 9 spaces between "Bytes sent" and "Errors" 1140 POKE PT+16,TT : SYS PT-9 : CLOSE 2 : IF PEEK(PT+15) THEN END : REM store file type, then upload. if abort register is not zero, then transfer aborted. 1150 IF FL THEN RETURN : REM if batch protocol in progress, return from GOSUB. 1160 END The BASIC code for uploading and downloading given here is not exactly what is used in Novaterm itself, but the above programs should do the job. You can change the cosmetics of the transfer routines to fit your own programs, but you must include a statement to print the line "Bytes xxxx Errors:" or else you will have numbers appearing on your screen without a label. $C000 49152 UPLOAD Upload a file from logical file #2. $C003 49155 DOWNLOAD Download a file to logical file #2. $C006 49158 ABORT Abort batch transfer from BASIC. $C009 49161 PROTOCOL REGISTERS Add the offset value given below to determine the true value of each register. 0 Flag: 1=suppress display in window 1-2 Size of one block in bytes. 3-4 Minimum block size (for variable sizes). 5-6 Maximum block size (for variable sizes). 7-8 Current block number. 9-10 Bad block count. 11-13 Byte count. 14 A flag with the following bits used: bit 0: file type received? (1=yes) bit 1: file name received? (1=yes) bit 2: use screen window? (1=yes) bit 3: batch protocol? (1=yes) bit 4: abort on carrier loss? (1=yes) (can be set by basic program) bit 5: prevent downloading? (1=yes) (for upload-only protocols) bit 6: prevent uploading? (1=yes) (for download-only protocols) bit 7: is this Zmodem? (1=yes) (to enable auto-download) 15 Protocol abort code. (0=good, 1=bad) 16 File type is stored here by the program before an upload or if received by a download. 17 Unused 18 Disk device number. 19-20 Screen block window size. 21 Upload or download from buffer? (1=yes) 22 ASCII translation? (1=yes) 23 Strip padding? (1=yes) 24 Drive number. MODEM DRIVERS Another important feature of Novaterm is its ability to support ANY type of modem that it is programmed for. Using this format you can program a modem driver that is not already supported. In order to use a modem driver, set an index variable to the start of the modem driver, such as MD=52224. Then, to perform any of the operations, do a SYS MD+xx, where xx is whatever the corresponding offset happens to be. For example, to take the phone off the hook, you would do a SYS MD+3. To dial a number, you would write: P$="555-1212" : SYS MD+12 NOTE: If you are going to use an existing modem driver separately, you MUST have the CARDET vector in locations 687-688 set to some machine language routine that checks for a carrier. The baud rate locations below hold values which correspond to the following: 0=300 baud 4=9600 baud 1=1200 baud 5=19200 baud 2=2400 baud 6=38400 baud 3=4800 baud $CC00 52224 HANGUP Hang up the phone. $CC03 52227 PICKUP Take the phone off the hook. $CC06 52230 ANSWER Answer a ring and determine caller's baud rate. $CC09 52233 UNUSED $CC0C 52236 DIAL Dial the number contained in P$. $CC0F 52239 ABORT Abort dialing. $CC12 52242 MODEM DRIVER REGISTERS Add the value of the offset given below to determine the true location of each register. 0 Maximum baud rate of modem. 1 Baud rate at which modem answered. 2 Contains the value to compare with bit 4 of location 56577. If equal, a carrier is present. 3 Unused. 4 A flag, using the following bits: bit 0: Hayes compatible modem? (1=yes) bit 1: 0=only pulse available, 1=tone and pulse available bit 2: 0=pulse dial, 1=tone dial MORE MACHINE LANGUAGE The index for these routines is 52608 ($CD80). $CD80 52608 BUF General file output routine. It reads data from the logical file number contained in location 781 and outputs to the file number stored in location 782. If either location is 0, the buffer will be used. $CD83 52611 CHKLIN Check to see if screen line has a menu bar terminator (ASCII 96). $CD86 52614 CARCHK Returns a 1 in the accumulator if a carrier is found, 0 if not. $CD89 52617 CHECK Used by the terminal emulators to check for a command key, a function key, a carrier detect, and a ring detect. Exits terminal mode if any of these are found, and sets the exit code in location 36869. $CD8C 52620 ONINT Turns on interrupts and calls INABLE. $CD8F 52623 OFFLIN Blanks status line and makes the two lines available for screen use. $CD92 52626 ROWCHK Used by STATLIN to check if the cursor is underneath the status line. $CD95 52629 LOADML Loads the file contained in F$ from the device number in location 780. $CD98 52632 BREAK Send 250 millisecond break signal. $CD9B 52635 MENU General menu selection routine. As input: accumulator (location 780) = starting location of menu bar .X register (location 781) = row number of first item (minus 1) .Y register (location 782) = number of menu items menu flag (location 726): bit 7: 1=allow right cursor key bit 6: 1=allow function keys bit 5: 0=jump to bottom of menu on exit bits 0-4: tab position of menu items Output: accumulator (location 780) = number of selected item $CD9E 52638 OFFINT Turns off interrupts and calls DISABL. $CF00 - $CFFF 52736 - 53247 RAM EXPANDER INTERFACE Reserved for the RAMDOS interface. If a RAM expander is to be used, RAMDOS must be installed and the interface must be placed at page 207 before loading Novaterm. $D000 - $D7FF 53248 - 55295 BLOCK STORAGE AREA The RAM under this area is used to swap the font set and 80 column hi-res screen depending on which one is not in use. In 80 column mode, the font is temporarily saved here, and part of the hi-res screen is saved here when 80 column mode is exited. $D800 - $DBFF 55296 - 56319 COLOR MEMORY SAVE The 80 column color memory is saved here temporarily. $E000 - $FFFF 57344 - 65535 BUFFER All data for the buffer is stored in this area. The BASIC program keeps track of where files begin and end within this memory space. UTILITY PROGRAMS Utility programs are usually written in BASIC, but you may write one in machine language as long as you tack on a BASIC SYS statement and the BASIC lines below so that the program can be loaded and executed by Novaterm. These programs are run separately from Novaterm, so there are no restrictions on available variable names. There are only three things that are necessary to interface a BASIC or ML program with Novaterm: 1) The first line of your program should read: poke 45,peek(174) : poke 46,peek(175) : clr This line resets the pointer to the end of BASIC program text to the end of the program just loaded. This is necessary because when Novaterm loads the program file from within its own program, this pointer is not set and it remains pointing to the end of Novaterm's main program. If this pointer were left alone, your program would be greatly restricted in memory available for variable storage. The above line will free up a great deal of memory. 2) Before loading a program file, Novaterm executes a POKE 6,255. This is used to indicate to the program module that Novaterm loaded it directly. In the place where your program exits, you should have some code that looks similar to this: 1000 if peek(6)<255 then end 1010 open 2,dv,2,"prog menu" : input#15,e : close2 : if e<20 then load"prog menu",dv 1020 open 2,dv,2,"novaterm *" : input#15,e : close2 : if e<20 then load"novaterm *",dv 1030 end This code first ends normally if location 6 does not contain 255. If location 6 does contain 255, the code checks the disk (with the device number stored in the variable DV) to see if the module selection program is there. It then tries to find Novaterm's main program if the module selection program is not found. Notice that the wildcard specifiers are set up to match any file with a version number in the filename "novaterm *". This allows your module program to be compatible with any version of Novaterm. 3) The file name of your program must have the "nova." prefix so that the "Utility progs" option on the main menu will recognize it.