POKES.100
                                                                
                                                  by Tony Anderson 70506,1261
                                                                
  COPYRIGHT 1984 Tony B. Anderson
  
     This file lists RAM memory locations and the values that may be poked to them for special applications. It is a
     user-active file. If you know of any POKES that work, and are not listed, please send a message to the author.
     Additions and corrections will be added to the next update.
     
                                                  THIS FILE IS M100 SPECIFIC.
                                                                
   If you own a NEC or Olly, please send any known Poke addresses to Tony Anderson, 70506,1261 to be included in similar NEC
                                                         or OLY files.
                                                                
  ______________________________________________________________________________________________________________________________
                                                                 
TELCOM FUNCTIONS:

    POKE 63064,0  will set TELCOM to HALF DUPLEX mode.
    POKE 63064,255  will set TELCOM to FULL DUPLEX mode.
    POKE 63065,255  will set TELCOM to ECHO to printer. (Turns ECHO on)
    POKE 63065,0  will set TELCOM to not ECHO to printer. (Turns ECHO off)
    POKE 63066,1  will set TELCOM to send a LF (line feed) after a CR (carriage return) one devices need them.
    POKE 63066,0  will reset to No LF after CR
   
   To be able to clear the screen when in TELCOM, type the following two pokes in BASIC, before you use TELCOM.
   
POKE 64268,49
POKE 64269,66.

   Then when you want to clear the screen, just press the F6 key.
   
   To reset to normal operation, in BASIC, type
   
POKE 64268,247
POKE 64269,127

   These statements can be entered on one line, with a colon between them; i.e.
   
   POKE64268,247:POKE64269,127.
   
     _____________________________________________________________________________________________________________________
                                                                
   It is often useful to poke TELCOM status into memory from a basic program, for example in a file transfer program.
   "Status" is held in RAM in locations 63067 to 63071, in a five character field. The leading character is the baud rate,
   and if this is all you want to change, you can use the direct command: POKE 63067,"M" (or whatever you want to poke
   there).
   
   If, for example, you want to reset TELCOM to modem status before leaving a file transfer program, you could add this short
   routine to your program:
   
1000 REM Pokes "M7I1E" into "Status"
1010 FOR A = 63067 TO 63071
1020 READ B : POKE A,B
1030 NEXT
1040 DATA 77,55,73,49,69
1050 REM M 7 I 1 E

   The values in the DATA statement are the ASCII value of the character you want to poke into memory. Change the values in
   the DATA statement to set any "Status" required.
   
     _____________________________________________________________________________________________________________________
                                                                
   There are two changes that will enhance TELCOM's basic functions by providing two additional function key actions, using
   F6 and F7. While in TELCOM or TERM mode, pressing F6 will respond with the current number of bytes free in RAM; and F7
   will give you a list of file names in RAM, similar to the F1-FILES command in BASIC. Rick Perry gives us this short
   routine which will make the necessary pokes:
   
1 FOR I = -1268 TO -1265
2 READ X : POKE I,X
3 NEXT
4 DATA 172,126,58,31

     _____________________________________________________________________________________________________________________
                                                                
   While you will probably never need this, the dialing pulse rate is stored at RAM address 63019, and can be set, or changed
   with a POKE.
   
POKE 63019,1 = 10 pulses/second
POKE 63019,20 = 20 pulses/second

     _____________________________________________________________________________________________________________________
                                                                
BREAK KEY - CONTROL-C - FUNCTION KEYS

   The interrupt routine can be turned on and off at RAM location 63056. The command to disable one of these functions will
   disable them all. There is no way to "selectively" disable one or the other. Read BREAK.KEY in DL4, which contains
   detailed descriptions and demonstration programs, and a way of trapping BREAK and CONTROL-C.
   
    POKE 63056,128  will disable the Break Key, Control-C and Function Keys.
    POKE 63056,0  will re-enable the same functions.
   

  ______________________________________________________________________________________________________________________________
                                                                 
SECRET STORAGE SPACES

   The following is from Rick Perry (75665,1045), and is a "Use at your own Risk". There are 36 bytes of RAM which can
   effectively, be rendered invisible to the operating system, and will be protected from everything short of a cold start;
   which can be used to store an identification name or number permanently in RAM. You might also find other uses for this 36
   bytes. If you have installed any alternate ROM in your M100, then these 36 bytes are not available to you, as they are the
   bytes that hold the M/L routines for accessing the optional ROM.
   
   If you have used Rick Perry's ALARM or ALARMS programs, first POKE 62975,201 to completely disable any residual code still
   in memory from these programs. Then, do these two: POKE 62981,201 and POKE 63018,255.
   
   Once these two pokes are done, addresses 62982 to 63017 are free, and can be used for anything you want. The above pokes
   remain effective until a cold- start occurs. What's happening here is that the original code from 62981 to 63011 checks
   for the existence of an optional ROM everytime you power up. If ROM is installed, then the value 255 is stored in 63018,
   and the name of the ROM (for the Menu) will be placed in 64164-64171. Code from 63012 to 63017 is used when choosing the
   option ROM from the Menu.
   
   The POKE 62981,201 puts a M/L RETurn there, which effectively makes the M100 think that the optional ROM is installed. You
   need the POKE 63018,255 to prevent a cold-start on power-up. [correlate this with password protection ideas in BREAK.KEY
   DL4]
   
   Whatever you put in those 36 bytes will stay there, regardless of whatever BASIC or normal machine language programs you
   are running. Obviously, you use POKE commands to get whatever you want into those locations.
   
   Interested in more free RAM to poke stuff into? Space used in TELCOM to store the previous screen (64704 to 65023) seems
   safe, although it is also used for lots of different things, including some Menu Directory stuff. The lowest addresses
   might be useful. Also, the optional ROM LUCID makes use of some of this area, if it is installed. The MDM & COM receive
   buffer (65350 to 65413) can be used as long as MDM/COM is not being accessed for input or output. That's 384 bytes to poke
   away in, at least for temporary use during a running program. If a running program does a CLEAR or LOADM, then all
   variables are erased. Before using either of these commands, a program can poke values/characters it wants to save into
   these unused RAM areas, then PEEK them back later.
   
     _____________________________________________________________________________________________________________________
                                                                
BASIC PROGRAM POKES

   The following pokes would generally be used from a BASIC program, but could also be used in direct mode, if needed.
   
   As you know, SCREEN,0 will turn off the label line. However, in some programs, it's also desirable to prevent the user
   from pressing the LABEL key to turn the label line back on. POKE 64173,0 will disable the Label Key, so that pressing it
   will have no effect. If the label line is on, it will stay on. If it is off, it will stay off. However, the effect is
   temporary; returning to the menu will automatically re-enable the LABEL key.
   
    POKE 64173,0  will disable the Label key.
    POKE 64173,1  will enable the Label key.
    POKE 63048,175  will turn on Reverse Video display, until cancelled.
    POKE 63048,0  will turn off reverse video, and return to normal display.
    POKE 65348,175  turns Sound Off.
    POKE 65348,0  turns Sound On.
   
   To place a string of characters in the keyboard buffer, just as if they had been typed in from the keyboard, follow the
   following proceedure: (Assume that the string you want to put in the buffer is A$) Use the following line, either in
   direct mode, or written as a line of code in your program.
   
   FOR I = 1 TO LEN(A$):POKE 65449+2*I, ASC(MID$(A$,1)):POKE 65450+2*I,0:NEXT:POKE 65450,I
   
   This puts the characters from A$ into the odd addresses from 65451+, zeroing out the even addresses which are reserved for
   FN key entries; then puts the number of characters into 65450. This is very useful before a program does a SAVEM, LOAD, or
   MERGE, which would cause the program to stop execution. Using the above code, with A$ = "RUN"+CHR$(13) will make the
   program restart automatically. But be careful, the length of A$ must be <= 32 characters.
   
     _____________________________________________________________________________________________________________________
                                                                
   Here's a quickie poke that will initialize the RND seed based on the time of day:
   
   J=63795:FOR I=64634 TO 64637:POKE I,16*PEEK(J)+PEEK(J+1):J= J+2:NEXT
   
   And, this one will re-seed the random number generator with one of 125 possible values: (thanks to Larry Gensch)
   
   POKE 64634,PEEK(63791)
   
   The following poke will send the next PRINT statement in a BASIC program to the printer port, instead of to the LCD
   screen. It works only on the next PRINT statement in a program, so has limited usefullness, but might be useful in a trace
   or debugging program. Just add it into any BASIC program as a BASIC statement.
   
   POKE 63096,1
   
   Jim Irwin (72346,1020) sends us the following information: RAM address 64228 is the place to intercept the print routine,
   just before it prints a character. PCSG and others use that location for an intercept to add line feeds. But, if one
   wanted to, they could intercept the character and re-direct it to another location, to the serial port, for example.
   
   If you wish to disable printer output completely, in order to prevent a program lock-up if the printer is not on and
   ready, the following two pokes will bypass the printer port:
   
   POKE 64228,136:POKE 64229,20
   
   To return to normal, use:
   
   POKE 64228,243 : POKE 64229,127
   
   The "bypass" poke, will apparently also prevent the PRINT key in the function key row from being used.
   
   Alternately, if you wish to test the printer port to determine if the printer is powered up, and ready to accept data, you
   can use the following statement in a BASIC program:
   
   IF (INP(187)AND6) <> 2 THEN BEEP : PRINT "Printer Not Ready" : STOP
   
   Or you can devise alternate tests: a 0 means the printer is not ready; a 2 means it is; and a 6 means it is not connected.
   
IF (INP(187)AND6) = 0 THEN (Printer not ready)
IF (INP(187)AND6) = 2 THEN (Printer ready)
IF (INP(187)AND6) = 6 THEN (Printer not connected)

     _____________________________________________________________________________________________________________________
                                                                
   Technical types will find a large listing of RAM addresses and their functions in the December 1983 issue of 80-Micro
   magazine. The list from that article, by David Sumner [75515,1507], is also available in the file MAP.100 in DL4. Suggest
   you also check the file ROMADR.100 in DL4, if you are looking for ROM addresses, calls and routines.
   
   Of course you realize, any address which can be "poked" can also be "peeked" to determine what is currently happening at
   that location, or what will happen depending on the value set at that address.
   
   END