┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                                    Block Directory of                                                    ┃
┃                                         Filename: 'plmods001' type 'compass  e'                                          ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
#Ord Block Name      Words #Blks  Blk#  POut --- Last Edit --- (---block inf word---)
                      Used 
   0 01-a *directory     0     0     0     1 2025/05/09. 21:07 (40321246507000000000) 
   1 01-b bu            58     1     1     1 1990/10/26. 08:29 (47106551035001072001) 
   2 01-c mod files    128     1     2     1 2025/04/22. 07:47 (47321130757001200002) 
   3 01-d retro1.org   277     1    34     1 2025/04/24. 12:11 (47321141413001425042) 
   4 01-e dummy         17     0     3     1 2024/06/26. 16:13 (40315552015000021003) 
   5 01-f signof2       78     0    49     0 2024/06/23. 09:59 (00315535173000116061) 
   6 01-g no acct       38     0    50     0 2024/06/05. 17:28 (00315426134000046062) 
   7 02-a nopcode       48     0    51     0 2024/06/05. 17:29 (00315426135000060063) 
   8 02-b frame1024    103     0    52     0 2024/06/05. 17:33 (00315426141000147064) 
   9 02-c fastniu      304     0    53     1 2024/06/05. 20:58 (40315426472000460065) 
  10 02-d fastniu      121     0    54     1 2024/06/05. 17:36 (40315426144000171066) 
  11 02-e fastniu871   274     0    39     0 2024/06/23. 06:26 (00315534632000422047) 
  12 02-f fastniu871   236     0    40     0 2024/06/22. 20:20 (00315532424000354050) 
  13 02-g fastniu871   238     0    41     0 2024/06/22. 20:23 (00315532427000356051) 
  14 03-a back2exit     33     0    55     0 2024/06/23. 08:10 (00315535012000041067) 
  15 03-b cons2.1       37     0    56     1 2024/06/05. 21:01 (40315426501000045070) 
  16 03-c systype       99     0    57     0 2024/06/24. 19:40 (00315542350000143071) 
  17 03-d miscfix       38     0    35     1 2024/06/23. 11:57 (40315535371000046043) 
  18 03-e nos2.1       107     0    58     1 2024/06/05. 21:02 (40315426502000153072) 
  19 03-f platlvl       23     0     4     0 2024/06/05. 21:02 (00315426502000027004) 
  20 03-g lvdebug       41     0     5     1 2024/06/05. 17:43 (40315426153000051005) 
  21 04-a pni800x      252     0     6     0 2024/06/05. 17:44 (00315426154000374006) 
  22 04-b jpoutfx       97     0     7     0 2024/06/05. 17:44 (00315426154000141007) 
  23 04-c faadev        72     0     8     0 2024/06/23. 09:03 (00315535103000110010) 
  24 04-d lviofix      317     0     9     0 2024/06/05. 17:45 (00315426155000475011) 
  25 04-e lviofix      316     0    10     0 1997/10/27. 11:56 (00142555370000474012) 
  26 04-f lviofix      205     0    11     0 2024/06/05. 17:46 (00315426156000315013) 
  27 04-g filedfx       26     0    12     0 2024/06/05. 17:46 (00315426156000032014) 
  28 05-a fgtcrsx      120     0    13     0 2024/06/23. 11:36 (00315535344000170015) 
  29 05-b statnfx       49     0    14     0 2024/06/05. 17:47 (00315426157000061016) 
  30 05-c csflgfx       35     0    15     1 2024/06/05. 17:47 (40315426157000043017) 
  31 05-d anscsfx       73     0    16     1 2024/06/05. 17:47 (40315426157000111020) 
  32 05-e date4        317     0    17     0 2024/06/05. 17:48 (00315426160000475021) 
  33 05-f cdaty2k      318     0    18     0 2024/06/05. 17:48 (00315426160000476022) 
  34 05-g cdaty2k      315     0    19     0 1998/10/10. 22:19 (00146452623000473023) 
  35 06-a cdaty2k      319     0    20     0 1998/10/10. 12:36 (00146451444000477024) 
  36 06-b cdaty2k       36     0    21     0 2024/06/05. 17:48 (00315426160000044025) 
  37 06-c mfuy2k       203     0    22     0 2024/06/23. 17:40 (00315536150000313026) 
  38 06-d buy2k        287     0    23     0 2024/06/05. 17:49 (00315426161000437027) 
  39 06-e attfxx       125     0    24     1 2024/06/05. 17:49 (40315426161000175030) 
  40 06-f attdbg       173     0    25     1 2024/06/05. 17:49 (40315426161000255031) 
  41 06-g datinfx      103     0    26     0 2024/06/05. 17:50 (00315426162000147032) 
  42 07-a fix           73     0    27     1 2024/06/05. 17:50 (40315426162000111033) 
  43 07-b nolvl6       114     0    28     0 2024/06/22. 20:56 (00315532470000162034) 
  44 07-c ccode         49     0    29     0 2024/06/23. 11:37 (00315535345000061035) 
  45 07-d tbtcap       259     0    32     1 2025/04/01. 14:55 (40321005667000403040) 
  46 07-e tbtcap       283     0    72     1 2025/04/01. 14:57 (40321005671000433110) 
  47 07-f statbank-a    54     0    73     1 2024/06/05. 17:40 (40315426150000066111) 
  48 07-g statbank-b    38     0    60     1 2024/06/05. 17:59 (40315426173000046074) 
  49 08-a notesys       35     0    31     0 2024/06/05. 17:51 (00315426163000043037) 
  50 08-b pfy2k2       190     0    30     0 2024/06/23. 11:38 (00315535346000276036) 
  51 08-c fontx         48     0    33     1 2024/06/05. 17:53 (40315426165000060041) 
  52 08-d ptfont       262     0    36     0 2024/06/22. 20:41 (00315532451000406044) 
  53 08-e packdir       35     0    37     1 2024/06/23. 08:33 (40315535041000043045) 
  54 08-f ovlfix        33     0    38     0 2025/04/02. 15:03 (00321011703000041046) 
  55 08-g rvar leak     28     0    42     0 2024/06/22. 20:27 (00315532433000034052) 
  56 09-a call fin      30     0    43     0 2024/06/22. 20:45 (00315532455000036053) 
  57 09-b p5block       75     0    44     0 2024/06/22. 20:45 (00315532455000113054) 
  58 09-c pniemu       158     0    45     1 2024/06/22. 20:45 (40315532455000236055) 
  59 09-d nprtfix      179     0    46     0 2024/06/23. 08:59 (00315535073000263056) 
  60 09-e pptok         37     0    47     0 2024/06/22. 20:44 (00315532454000045057) 
  61 09-f ciuasci       33     0    48     0 2024/06/22. 20:47 (00315532457000041060) 
  62 09-g cerlpak       28     0    59     1 2024/06/22. 20:48 (40315532460000034073) 
  63 10-a logout       115     0    61     0 2024/06/22. 21:01 (00315532501000163075) 
  64 10-b dtxon        301     0    62     1 2024/06/22. 21:01 (40315532501000455076) 
  65 10-c dd60hlp       30     0    63     0 2024/06/22. 21:03 (00315532503000036077) 
  66 10-d blkeras       43     0    64     0 2024/06/22. 21:04 (00315532504000053100) 
  67 10-e dterase       56     0    65     0 2024/06/22. 21:05 (00315532505000070101) 
  68 10-f bdspsdm       36     0    66     1 2024/06/22. 21:06 (40315532506000044102) 
  69 10-g cfo          296     0    67     1 2024/06/22. 21:10 (40315532512000450103) 
  70 11-a bigkeys      246     0    68     0 2024/06/23. 08:34 (00315535042000366104) 
  71 11-b bigkeys      286     0    69     0 2024/06/22. 21:20 (00315532524000436105) 
  72 11-c bigkeys      285     0    70     0 2024/06/23. 09:10 (00315535112000435106) 
  73 11-d bigkeys      283     0    71     0 2024/06/22. 21:29 (00315532535000433107) 
  74 11-e sxtchw       171     0    74     0 2025/05/07. 17:38 (00321236146000253112) 
  75 11-f                0     0    75     0 1973/00/00. 00:00 (00000000000000000113) 
  76 11-g                0     0    76     0 1973/00/00. 00:00 (00000000000000000114) 
  77 12-a                0     0    77     0 1973/00/00. 00:00 (00000000000000000115) 
  78 12-b                0     0    78     0 1973/00/00. 00:00 (00000000000000000116) 
  79 12-c                0     0    79     0 1973/00/00. 00:00 (00000000000000000117) 
  80 12-d                0     0    80     0 1973/00/00. 00:00 (00000000000000000120) 
  81 12-e                0     0    81     0 1973/00/00. 00:00 (00000000000000000121) 
  82 12-f                0     0    82     0 1973/00/00. 00:00 (00000000000000000122) 
  83 12-g                0     0    83     0 1973/00/00. 00:00 (00000000000000000123) 
  84 13-a                0     0    84     0 1973/00/00. 00:00 (00000000000000000124) 
  85 13-b                0     0    85     0 1973/00/00. 00:00 (00000000000000000125) 
  86 13-c                0     0    86     0 1973/00/00. 00:00 (00000000000000000126) 
  87 13-d                0     0    87     0 1973/00/00. 00:00 (00000000000000000127) 
  88 13-e                0     0    88     0 1973/00/00. 00:00 (00000000000000000130) 
  89 13-f                0     0    89     0 1973/00/00. 00:00 (00000000000000000131) 
  90 13-g                0     0    90     0 1973/00/00. 00:00 (00000000000000000132) 
  91 14-a                0     0    91     0 1973/00/00. 00:00 (00000000000000000133) 
  92 14-b                0     0    92     0 1973/00/00. 00:00 (00000000000000000134) 
  93 14-c                0     0    93     0 1973/00/00. 00:00 (00000000000000000135) 
  94 14-d                0     0    94     0 1973/00/00. 00:00 (00000000000000000136) 
  95 14-e                0     0    95     0 1973/00/00. 00:00 (00000000000000000137) 
  96 14-f                0     0    96     0 1973/00/00. 00:00 (00000000000000000140) 
  97 14-g                0     0    97     0 1973/00/00. 00:00 (00000000000000000141) 
  98 15-a                0     0    98     0 1973/00/00. 00:00 (00000000000000000142) 
  99 15-b                0     0    99     0 1973/00/00. 00:00 (00000000000000000143) 
 100 15-c                0     0   100     0 1973/00/00. 00:00 (00000000000000000144) 
 101 15-d                0     0   101     0 1973/00/00. 00:00 (00000000000000000145) 
 102 15-e                0     0   102     0 1973/00/00. 00:00 (00000000000000000146) 
 103 15-f                0     0   103     0 1973/00/00. 00:00 (00000000000000000147) 
 104 15-g                0     0   104     0 1973/00/00. 00:00 (00000000000000000150) 
 105 16-a                0     0   105     0 1973/00/00. 00:00 (00000000000000000151) 
 106 16-b                0     0   106     0 1973/00/00. 00:00 (00000000000000000152) 
 107 16-c                0     0   107     0 1973/00/00. 00:00 (00000000000000000153) 
 108 16-d                0     0   108     0 1973/00/00. 00:00 (00000000000000000154) 
 109 16-e                0     0   109     0 1973/00/00. 00:00 (00000000000000000155) 
 110 16-f                0     0   110     0 1973/00/00. 00:00 (00000000000000000156) 
 111 16-g                0     0   111     0 1973/00/00. 00:00 (00000000000000000157) 
 112 17-a                0     0   112     0 1973/00/00. 00:00 (00000000000000000160) 
 113 17-b                0     0   113     0 1973/00/00. 00:00 (00000000000000000161) 
 114 17-c                0     0   114     0 1973/00/00. 00:00 (00000000000000000162) 
 115 17-d                0     0   115     0 1973/00/00. 00:00 (00000000000000000163) 
 116 17-e                0     0   116     0 1973/00/00. 00:00 (00000000000000000164) 
 117 17-f                0     0   117     0 1973/00/00. 00:00 (00000000000000000165) 
 118 17-g                0     0   118     0 1973/00/00. 00:00 (00000000000000000166) 
 119 18-a                0     0   119     0 1973/00/00. 00:00 (00000000000000000167) 
 120 18-b                0     0   120     0 1973/00/00. 00:00 (00000000000000000170) 
 121 18-c                0     0   121     0 1973/00/00. 00:00 (00000000000000000171) 
 122 18-d                0     0   122     0 1973/00/00. 00:00 (00000000000000000172) 
 123 18-e                0     0   123     0 1973/00/00. 00:00 (00000000000000000173) 
 124 18-f                0     0   124     0 1973/00/00. 00:00 (00000000000000000174) 
 125 18-g                0     0   125     0 1973/00/00. 00:00 (00000000000000000175) 

File Name -------- plmods001
File Type -------- compass  
Account ---------- s0sup
Update Level ----- 0
Created ----------  05/09/25
Last Edited ------  05/09/25
                    21.07.54.
       by -------- sinder::::::::b
       of -------- s
       at -------- 4-0
Change Code ------ no match permitted
Inspect Code ----- account system
File Access Code - **********
System Access ---- allowed
Submit Block ----- 
Charset Lesson --- 
Charset Block ---- 
Micro Lesson ----- sysmicro
Micro Block ------ modify
Processor -------- 
Editor ----------- 
Author Name ------ systems
Author Dept. ----- 
Author Phone ----- 
Subject ---------- 
Audience --------- 
Description ------ mods to platopl to be added to pl at week'7s end.

* /---   block=01-b bu                   1990/10/26. 08:29    text  out
*
*
*        this weeks ident prefix is the name of this block
*
*        previous weeks mods are kept in ',oplmods',
*
*        previous previous weeks mods are kept in ',ooplmods',
*
*         'n'o't'e'; there 'm'u's't be at least 'o'n'e modset here,
*         even if its nothing more than ',*ident   dummy',
*
*         'n'o't'e'; this must be the 'f'i'r's't block in this file.
*         =source= expects to find the current ident prefix
*         as the name of the first block here.
*
* /---   block=01-c mod files            2025/04/22. 07:47    text  out
*list     parts
 
'the standard assembly/listing procedures expect all
modsfiles, including personal files, to be on 'p'l'a't'o
'master 'file ',modsmf',, which resides on pack 'p'd'e'v1. (10/2/85)
 
 
'the regular modset files are';
 
*plmods*  - modsets used in all assemblies and applied
            permanently to *platopl* each week.
            *oplmods* has previous mod sets..
            *ooplmods* has even older mod sets...
 
*tpmods*  - modsets used in all assemblies, but never
            applied permanently to *platopl*.
 
*gogomods*- modsets used in all assemblies, except the code-
            sharing full assemblies, and not applied 
            permanently to *platopl*.  the modsets in this
            file are active during gogo only; they are
            partialed out before the codesharing assemblies
            are run.  the programmers must reactivate their
            modsets each week after codesharing is finished.
 
*l1pmods* - modsets used in all assemblies, but never
            applied permanently to *platopl*.
            these add level protocol enhancements
* /---   block=01-d retro1.org           2025/04/24. 12:11    text  out
'the following modsets are active on this system and are
tailored to handle a more scalable environment than is
provided by the normal v-campus distribution.
 
 
'this list needs to be maintained as a secondary check
against the partial flags.
 
mod block    'expected 'installation 'state
-----------  ---------------------------
 
anscsfx      'not 'implemented
attdbg       'not 'required
attfxx       'not 'applicable
back2exit    20240605'; 'activated
bdspsdm      'not 'activated
bigkeys      'not 'activated
blkerase     20240622'; 'activated
buy2k        20240605'; 'activated
call fin     20240622'; 'activated
ccode        20240605'; 'activated
cdaty2k      20240605'; 'activated
cerlpak      'not 'active
cfo          'not 'active
ciuasci      20240622'; 'activated
cons2.1      'n'o's 2.1 'only
csflgfx      'not 'implemented
date4        20240605'; 'activated
datinfx      20240605'; 'activated
dd60hlp      20240622'; 'activated
dterase      20240622'; 'activated
dtxon        'not 'activated
dummy        'not 'implemented
faadev       20240605'; 'activated
fastniu      'not 'implemented
fastniu871   'not 'implemented
fgtcrsx      20240605'; 'activated
filedfx      20240605'; 'activated
fix          'for 'debugging
fontx        'not 'required
frame1024    20240605';sjz
jpoutfx      20240605'; 'activated
logout       20240622'; 'activated
lvdebug      'not 'required
lviofix      20240623'; 'activated
mfuy2k       20240623'; 'activated
miscfix      'not 'activated
no acct      20240622'; 'activated
nolvl6       20240605'; 'activated
nopcode      'not 'required
nos2.1       'n'o's 2.1 'only
notesys      20240605'; 'activated
nprtfix      20240622'; 'activated
ovlfix       20240623'; 'activated
p5block      20240622'; 'activated
packdir      'not 'required
pfy2k2       20240605'; 'activated
platlvl      20240623'; 'activated  'level at 99'a
pni800x      20240623'; 'activated for 'p'n'i on 170+
pniemu       'not 'activated
pptok        20240622'; 'activated
ptfont       20240622'; 'activated
rvar leak    20240622'; 'activated
signof2      20240622'; 'activated
*statbank-a   20240623'; 'activated (in lieu of tbtcap)
statbank-a   20250330'; 'deactivated    drs
statbank-b   'not 'yet 'required
statnfx      20240605'; 'activated
systype      20240623'; 'activated
*tbtcap       'not 'activated -'conflicts with ptfont mod
*tbtcap       20250330'; 'activated  drs moved to l1pmods
* /---   block=01-e dummy                2024/06/26. 16:13    source  out
*/ 'this is the minimum required dummy entry.
*/        'it is normally partialed-out if there are
*/        other mods to be applied.
*ident    pdummy
* /---   block=01-f signof2              2024/06/23. 09:59    source 
*/ -------------------------------------------------------
*/ treat the disconnect key as special,
*/ so it always gets through.
*/ -------------------------------------------------------
*ident signof2
*deck pio
*i pio.740
          ldm    keybuff+1,d.t0  load key word
          stm    key
          lmc    1753b*2     check *offky2* value (immediate off)
          zjn    kyo150      if *offky2*, bypass flooding check
*d pio.754,pio.755
*i pio.937
          ldd    key
          lmc    1753b*2     check *offky2* value (immediate off)
          zjn    kyo227      if *offky2*, overwrite last key
*/ end pio
*/ -------------------------------------------------------
* /---   block=01-g no acct              2024/06/05. 17:28    source 
*/ --------------------------------------------------------
*/ turn off detailed accounting
*/ --------------------------------------------------------
*ident noacct
*deck instalp
*delete instalp.49
 accon    data   0           accounting off
*/ end instalp
*/ --------------------------------------------------------
* /---   block=02-a nopcode              2024/06/05. 17:29    source 
*/ --------------------------------------------------------
*/ send nop words (word value 1) for nopcode
*/
*/ for now, change only plato iv overlay
*/ --------------------------------------------------------
*ident dtnop
*deck fovlay1 
*delete fovlay1.898 
          sx7    1
          packwrd x7         send terminal nop
*/ end fovlay1
*/ --------------------------------------------------------
* /---   block=02-b frame1024            2024/06/05. 17:33    source 
*/ --------------------------------------------------------
*/ increase frame count to 1024 (was 128) and
*/ mout buffer to 1000 
*/ (was 512)
*/ --------------------------------------------------------
*ident fram1k 
*deck pftext
*delete vgtext.1
 moutlth  equ    1000d       usable *mout* area (arbitrary) 
*delete pftext.33,pftext.34 
 nframs   equ    1024d        number of frames
 nfrmshf  equ    10d
*/ end pftext 
*/
*deck pio 
*delete pio.72
*         fmask   - nfrmshf/nframs
*delete pio.80
 fmask    equ    1777b       mask for frame index 
*/ end pio
*/
*deck ftext 
*delete ftext.362 
* this takes two steps because *max* produces a redefinable 
* symbol, and those are not saved in the cmtext.
 outbl.   max    mdismax+4,nframs 
 outblth  equ    outbl. 
*/ end ftext
*/
*/ --------------------------------------------------------
* /---   block=02-c fastniu              2024/06/05. 20:58    source  out
*/ --------------------------------------------------------
*/ change framat-pio interface so dtcyber emulated niu works
*/ correctly when running without rate limiting.
*/
*/ 'the effect of the lack of rate limiting is that
*/ pio can get ahead of framat, unlike the classic hardware
*/ which needed 16.66 ms to send a frame and would not
*/ accept another one until that time is expired.
*/
*/ 'the framat-pio communication assumed that it would not
*/ be possible for pio to finish one frame and go on to
*/ the next in less time than it would take it would
*/ take framat toframe all the pending output for a station.
*/
*/ 'if there is a lot of output to frame, that is no longer
*/ true whenthe niu frame pacing is takenout of the
*/ picture.
*/
*/ 'solution';
*/ (a) 'update the frame counters all the time.
*/ (b) 'add a framat-pio interlock variable, 2 ecs words
*/     right after the pio frame counter words (one per
*/     niu).
*/ 'framat sets that word non-zero while it is filling the
*/ frame buffer chain for a station, starting just before
*/ it reads the ppu frame counter, and ending after it has
*/ written the updated frame lengths.  'if the interlock
*/ is set, pio waits exactly as it would clasically
*/ when the niu is not yet ready for a new frame. 
*/
*/ 'note that the error correction code paths
*/ are not handled in this path, because they are
*/ not used in the emulated environment.
*/
*/ --------------------------------------------------------
*ident fastniu
*deck format
*delete format.297,format.304 
*/ end format 
*/
*deck pio 
*insert pio.28
*             the framat-pio framing interlock is at offset +2 from here. 
*delete pio.268,pio.270 
*         wait for framat-pio framing interlock to be clear 
* 
 m110     ldc    ecsbuff
          std    d.t0        d.t0 = ppu memory address
          ldm    ecra+1      compute ecs addr of interlock
          adm    outpnt+1 
          adn    2           +2 for interlock 
          std    d.t2        d.t2 = lower part of ecs addr
          shn    -12
          adm    ecra 
          adm    outpnt 
          std    d.t1        d.t1 = upper part of ecs addr
          ldn    5
          std    d.t3        d.t3 = number words to read
          call   readecs     read interlock 
          ldm    ecsbuff+4
          njp    main        if interlock set 
* 
*         attempt to select ciu and output no-op
* 
          ijm    m112,o=niu 
*/ end pio
*/
*deck platxt
*delete platxt.671
 aframpt  ecsbuf 4           frame counters and framer-pio interlocks 
*/ end platxt 
*/
*/ --------------------------------------------------------
* /---   block=02-d fastniu              2024/06/05. 17:36    source  out
*deck format
*insert format.2034 
          sa2    xfrmpnt
          sx3    2
          mx6    0
          ix3    x2+x3       form address of interlock
          wx6    x3          clear pio interlock (may chg *a6*) 
  
*delete format.2042 
          sa2    xfrmpnt
          sx3    2
          sx6    1
          ix3    x2+x3       form address of interlock
          wx6    x3          set pio interlock (may chg *a6*) 
          rx2    x2          read current pio frame ctr (may chg *a2*)
          ix3    x1-x2       check pio against framat pointers
          pl     x3,ftw050   if framat not behind 
          bx1    x2          start framing from next pio frame
          bx3    -x3         number of frames pio is ahead
          sb6    x3          pretend to caller we used that much extra
  
 ftw050   mx0    -nfrmshf 
*/ this one line change is a documentation fix
*delete for180.35 
 setf     sa2    xfrmpnt     ecs address of pio frame counter 
*/ end format 
*/ end fastniu modset
*/ --------------------------------------------------------
* /---   block=02-e fastniu871           2024/06/23. 06:26    source 
*/ -------------------------------------------------------
*/ change framat-pio interface so dtcyber emulated niu 
*/ works correctly when running without rate limiting.
*/ 
*/ the effect of the lack of rate limiting is that pio 
*/ can get ahead of framat, unlike the classic hardware 
*/ which needed 16.66 ms to send a frame and would not 
*/ accept another one until that time is up.
*/ 
*/ the framat-pio communication assumed that it would 
*/ not be possible for pio to finish one frame and go 
*/ on to the next in less time than it would take 
*/ framat to frame all the pending output for a 
*/ station. if there is a lot of output to frame, 
*/ that is no longer true when the niu frame pacing 
*/ is taken out of the picture.
*/ 
*/ solution'; add a *barrier* variable set by framat, 
*/ which specifies the frame number that pio is not 
*/ allowed to reach.  whenever pio is about to process 
*/ a frame, it checks if the barrier matches that
*/ frame number.  if yes, it pauses.  the barrier 
*/ is in the same block of ecs where the frame 
*/ counter lives.  there are two frame counters,
*/ one for each supported ciu.  the barriers are also 
*/ indexed by ciu number, at offset 2 from the frame 
*/ counter.  
*/ 
*/ the barrier is simply the frame counter value that 
*/ pio is not allowed to reach.  when framat is not 
*/ busy, the barrier is set to once around the frame
*/ length table from the last position that framat 
*/ has seen as complete. this ensures that pio cannot 
*/ wrap around the length table and revisit old frames 
*/ whose lengths have not been zeroed yet, even if pio 
*/ gets far ahead of framat.  this is not likely in 
*/ practice, but it is an easy thing to implement 
*/ just in case.
*/ 
*/ in addition, the frame length table is updated every 
*/ poll, which ensures that the framer stays ahead of pio.
*/ 
*/ note that the error correction code paths are not 
*/ handled in this patch, because they are not used 
*/ in the emulated environment.
*/ -------------------------------------------------------
*ident fniu871
*deck platxt
*delete platxt.671
 aframpt  ecsbuf 4           frame counters and framer-pio barriers
*/ end platxt
*/
*deck ftext
*d ftext.516
*/ end ftext
*/
*deck format
*d format.294,format.304
*i format.310
          rj     cpb         turn off pio barrier
*i format.316
          rj     cpb         turn off pio barrier
* /---   block=02-f fastniu871           2024/06/22. 20:20    source 
*i format.435
 cpb      title  clear *pio* barrier
*
*         cpb - clear *pio* barrier.
*
*         this routine removes the barrier set while framer is 
*         sending frames to the framat-pio frame buffers.
*         more precisely, it sets the barrier to nearly once
*         around the frame length table, to ensure that pio
*         can process all that has been framed but cannot wrap
*         around and reprocess old frames.
*
*         uses   a2, 6.
*                x0, 2, 6.
*
*
          entry  cpb
 
 cpb      ps
          sa2    framid      get fod index
          sa2    x2+flthpnt  get how far lengths have been zeroed
          sx6    nframs-2
          ix6    x6+x2       form new barrier value
          sa2    xfrmpnt
          sx0    2
          ix0    x2+x0       form barrier ecs address
          wx6    x0          turn off pio barrier
          eq     cpb
          space  4,12
*d yixov.359
 fr900    call   cpb         turn off pio barrier
          call   cleanup     drop unused parcels
*d format.1828
          ext    ecsprty,ecsprtz,cpb
*d yixov.370
          eq     fr991
*d yixov.374
          nz     x2,fr990    re-enter continued output queue
*d yixov.381
 fr990    call   cpb         turn off pio barrier
 fr991    call   enterq      put this station in queue
*i yixov.651
          call   cpb         turn off pio barrier
*i format.2465
*                pio barrier set at (frmpnt).
*d for180.37
*i format.2479
          sx0    2
          ix0    x0+x2       form ecs address of barrier
          wx6    x0          set barrier at next frame
          rx5    x2          re-read frame count
          bx5    x5-x1
          nz     x5,setf     if pio frame counter changed
          mx2    -nfrmshf 
*/ '/'/'/ should setf35 load nframs-n for small n instead'/
*i format.2531
          sa2    xfrmpnt
          sx0    2
          ix0    x2+x0       form barrier ecs address
          wx6    x0          update barrier to start index we found
*/ end format
* /---   block=02-g fastniu871           2024/06/22. 20:23    source 
*/
*deck pio
*d pio.19,pio.40
*         10 words of argument are passed to this program
*
*         12/, 24/ecs address of station switch list,
*              24/ecs address of fastkey buffer
*         60/number of sites recognized
*         12/, 24/ecs address of scim buffer,
*              24/ecs address of key buffer
*         60/ecs address of frame counter and frame count barrier
*         60/ecs address of frame length table
*         60/ecs address of first frame buffer
*         12/, 24/ecs address of statistics buffer,
*              24/unused
*         60/unused
*         60/maximum frame length
*         60/physical-logical site mapping info
*d pio.407
*         check for framat-pio barrier.  if we are about to process
*         the frame mentioned by the barrier, pause until the barrier
*         is dropped or moves.
*
 m215     ldc    ecsbuff
          std    d.t0        d.t0 = ppu memory address
          ldm    ecra+1      compute ecs addr of barrier
          adm    outpnt+1
          adn    2           +2 for barrier address
          std    d.t2        d.t2 = lower part of ecs addr
          shn    -12
          adm    ecra
          adm    outpnt
          std    d.t1        d.t1 = upper part of ecs addr
          ldn    5
          std    d.t3        d.t3 = number words to read
          call   readecs     read barrier word
          ldm    ecsbuff+4   get low order barrier frame count
          lmm    nframe+4
          lpc    fmask       mask off frame index
          njn    m217        if barrier for a different index
          ldd    cp
          adn    ms2w        form address of message line 2
          cwm    m216,tr
          call   pause       check for storage move / error
          ujp    m215        check again
 
 m216     dis    ,*pio  wait barrier.*
 
 m217     ldn    zerl
          crd    cm
          ldd    cp
          adn    ms2w        form address of message line 2
          cwd    cm          clear wait message
          ldn    4
*/ end pio
*/
*/ end fastniu
* /---   block=03-a back2exit            2024/06/23. 08:10    source 
*/ --------------------------------------------------------
*/ remove "press -back- to exit"
*/ --------------------------------------------------------
*ident rmpbte
*deck mainov
*yank pbte
*/ end mainov 
*/ --------------------------------------------------------
* /---   block=03-b cons2.1              2024/06/05. 21:01    source  out
*/ --------------------------------------------------------
*/ make dd60 assemble on nos 2.1
*/ --------------------------------------------------------
*ident dtcyber
*deck dd60
*yank ws2p3 
*yank yppdd,* 
*yank yppddrs,* 
*/ end dd60 
*/ --------------------------------------------------------
* /---   block=03-c systype              2024/06/24. 19:40    source 
*/ --------------------------------------------------------
*/ set os level and system type 
*/ --------------------------------------------------------
*ident systype
*deck syscon
*delete jsnppu.28 
*/
*/ we call it 180, not 170, even though we really aren'7t.
*/ the only difference is that rx and wx instructions 
*/ are enabled, which is required or fovlay5 doesn'7t fit.
*/ (the other difference is that some necessary code in pms 
*/ disappears, but the mod below, deleting pms800 1-4, cures that.) 
*/
 machine  micro  1,3,/180/   cyber 180 or cyber 170 system
  
*                os level 
  
          if     -mic,noslvl,1
 noslvl   micro  1,,/"modlevel"/
  
*                production or development
  
 dev      equ    0           production system
  
*/ end syscon 
*/ --------------------------------------------------------
* /---   block=03-d miscfix              2024/06/23. 11:57    source  out
*ident miscfix
*deck pms
*yank pms800
*/ delete 180 specific code to make room
*d pms.2095,pms.2136
 rlp1     equ    relddpx
*/ we do need a few lines from that mod';
*i pms.2477
 .nos282  ifge   oslev,826d
 pda      here               insert *pda* subr from complda
 .nos282  endif
*/ end pms
* /---   block=03-e nos2.1               2024/06/05. 21:02    source  out
*/ --------------------------------------------------------
*/ some edits needed to make things build on nos 2.1-580. 
*/ --------------------------------------------------------
*ident plsi580
*deck comsssd 
*insert ns21000.3 
 plsi     equ    7754        plato / cybis
*/ end comsssd
*/
*ident cyb580 
*deck pms 
*yank pms800
*insert yr2p4p2.29
 .nos251  ifge   oslev,664d 
*delete zq2p5p1.7 
*insert yt2p4p2.6 
          dsker  ftoe,xtoe        function time-out 
  
*/ end pms
*/
*deck mrq 
*prefix . 
.insert xk2p4p1.29
*call     aidtext            nos level dependent instructs. 
.insert xk2p4p1.30
 .nos22   ifge   oslev,594d 
.prefix * 
*insert xk2p4p1.36
 .nos22   endif 
*delete mrq.194 
*/ end mrq
*/
*deck mrq1
*delete mrq1.1596 
          ldk    /cps/ssis   sjcm sub-fnc = set sub-sys id
*/ end mrq1 
*/ --------------------------------------------------------
* /---   block=03-f platlvl              2024/06/05. 21:02    source 
*/ --------------------------------------------------------
*ident,cyb97b
*deck,placsmd 
*d,cyb97a.1
 platlvl  micro  1,,/99'a/
*/ --------------------------------------------------------
* /---   block=03-g lvdebug              2024/06/05. 17:43    source  out
*/ --------------------------------------------------------
*ident,lvdebug
*deck,autload 
*i,autload.809
          bx7    x2          *** debug
          sa7    lnsave      *** debug
*d,autload.832
 lnsave   bss    1           *** debug
* 
* /---   block      resvrel    00 000   80/02/01  11.17 
*/ --------------------------------------------------------
* /---   block=04-a pni800x              2024/06/05. 17:44    source 
*/ --------------------------------------------------------
*ident,pni800x
*deck,pni2
*d,pni2.37,pni2.39
*call     comccmd 
*call     comcmac 
*call     comsprd 
*call     comccvl 
*i,xtipc.55 
* /---   block      pnii       00 000   81/05/27  13.32 
*i,pni2.1333
*         determine if running on a170 system or not
  
          getmc  mcbuf       get machine characteristics
          sa1    mcbuf       (x1) = word with 170/835 status
          mx0    -1 
          lx0    20          position mask under 170/835 bit
          bx6    -x0*x1      (x6) = 170/835 status flag 
          sa6    a170 
  
*i,pni2.1357
  
          sa1    a170 
          nz     x1,pnia170  if a170, skip reset
  
*d,vgmpni.13
 pnia170  sa1    actr 
*d,bjsac.11 
*i,vgmpni.30
* /---   block      pnii       00 000   81/05/27  13.31 
*d,jsnppu.5 
*i,vgmpni.64
* 
 mcbuf    con    0           machine id return word 
 a170     con    0           a170 status word 
* 
* /---   block      pnii       00 000   81/05/27  13.30 
*d,pni2.1836,pni2.1841
  
 wcb6a    bx6    x1          save *x1*
          sa1    a170 
          nz     x1,wcb7     if a170 system, skip 
  
+         re     1
          eq     *           re-try on reject 
  
 wcb7     bx1    x6          restore *x1* 
          bx0    x1          save buffer pointer
          recall             pause
          bx1    x0 
          eq     wcb6a       try again
*i,pni2.1845
* /---   block      rsr/svr    00 000   81/05/27  16.05 
*i,pni2.1850
  
          sa2    a170        see if a170 system 
          nz     x2,wcbskp1  if a170 system, skip 
  
*d,pni2.1856,bjsac.14 
 wcbskp1  mx7    -21
*i,pni2.1914
* /---   block      rsr/svr    00 000   81/05/27  16.17 
*d,pni2.1926,pni2.1929
* 
          tx0    /plat/gfr17,ecscl release interlock
          lx0    /plat/gfrsc
          bx6    x1 
          sa1    a170        see if a170 system 
          nz     x1,wcb5a    skip if a170 system
* 
+         re     1
          eq     *           re-try on reject 
  
 wcb5a    bx1    x6          restore *x1* 
*/ --------------------------------------------------------
* /---   block=04-b jpoutfx              2024/06/05. 17:44    source 
*/ --------------------------------------------------------
*ident,jpoutfx
*deck,tutorx
*i,tutor1x.18 
 jmpmode  equ    tbintsv+7   save jumpout mode
*d,tutor1x.32 
 padjump  sx6    2           -jumpout- based on *key* value 
*d,tutor1x.36 
 feditx   sx6    1           -filedit-
*d,tutor1x.40,tutor1x.42
 jmpoutx  sx6    0           -jumpout-
 jpfego   sa6    jmpmode     save mode for later
*d,tutor1x.60,tutor1x.62
* /---   block      -jumpout-  00 000   81/08/14  13.47 
*i,tutor1x.69 
          sa1    jmpmode     get jumpout mode 
          bx0    x1          restore *x0* 
*d,tutor1x.83 
          sa1    jmpmode     get -jumpout- mode 
*i,tutorx.4405
 awvars   vfd    42/0,18/work-1 
* 
* 
* /---   block      deffont    00 000   78/10/03  16.08 
*d,varsfix.2,varsfix.5
*/ --------------------------------------------------------
* /---   block=04-c faadev               2024/06/23. 09:03    source 
*/ --------------------------------------------------------
*ident,faadev 
*deck,msubs 
*d,msubsa.6,msubsa.8
 ndevsys  equ    3           maximum number of dev systems
          data   0luol       university online system 
          data   0lcybdev    cybis development system 
          data   0lfaa       faa system (used by uol) 
*d,msubsa.15,msubsa.17
 nuolsys  equ    3           maximum number of uol systems
          data   0luol       university online system 
          data   0lcybdev    cybis development system 
          data   0lfaa       faa system (used by uol) 
*/ --------------------------------------------------------
* /---   block=04-d lviofix              2024/06/05. 17:45    source 
*/ --------------------------------------------------------
*ident,lviofix
*deck,autload 
*d,autload.88,loadfix.3 
          call   rvload 
* 
 lload    bss    0
          call   lvload,1    load local vars for this unit
* 
          mx6    0           zero max nc vars loaded
*d,autload.441
*         called from one place in -lessons- and -filex-
*d,autload.451,autload.453
          rj     rvload 
          eq     rload
* 
          entry  rvload 
 rvload   eq     *           entry/exit 
          sa1    tbrvnum     router variables lesson number 
          zr     x1,rvload
          sx2    x1          get lesson number
*d,autload.462,yulverr.1
          eq     rvload      -- exit
* 
          entry  rvuload
 rvuload  eq     *           entry/exit 
          sa1    tbrvnum     router variables lesson number 
          zr     x1,rvuload 
          sx2    x1          get lesson number
          sx3    2           bias for header
          call   lessadd
          ax1    18          get number of variables
          sb1    x1 
          bx0    x7          ecs address of variables 
          sa0    rvarbuf
+         we     b1          store router variables 
          rj     ecsr 
          eq     rvuload
* 
* /---   block      lvload     00 000   81/10/26  17.14 
*d,autload.471
*         called from csload, csuload, join, unjoin, dataio 
*d,autload.477,autload.478
          zr     x1,lvload   if no locals 
          sa2    lvucnt      number in current unit 
          zr     x2,lvload1  skip chk if no lvars in unit 
*d,autload.493
          sa2    lvecsad     get ecs address of lv buffer 
*d,autload.539,loadfix.51 
          call   rvuload
* 
 luload   bss    0
          call   lvload,-1   unload local variables 
* 
          call   uloadcs     unload common and storage
          call   savejdg     save judge buffers (if any)
*deck,filex 
*d,filex.1908 
          sa2    dsnwrds     (x2) = number of words 
*d,bilvars.5,bilvars.11 
+         zr     x3,*+1      if first word, skip *nz* check 
          ng     x3,dsiocmr  before locals, check router
+         ix3    x1+x2       (x3) = lwa +1 of transfer
          ix3    x4-x3       check if in local range
          zr     x3,dssvset  if perfect fit, go 
          ng     x3,dsiocm1  beyond range of locals 
 dssvset  sx6    dio.sv      reset type of i/o to sv
          sa6    dskind      locals treated same as svars 
          eq     dsiochk     --- if all ok
* 
* /---   block      bounds     00 000   81/10/26  07.47 
 dsiocmr  sx3    rvarbuf     (x3) = fwa of router vars
*tbrvnum = 1/in-router flag,23/0,18/^$of rvars,18/rvar less^$ 
          sa4    tbrvnum     router var info
          ax4    18          right justify ^$ of rvars
          sx4    x4          (x4) = ^$ of rvars 
* /---   block=04-e lviofix              1997/10/27. 11:56    source 
          ix4    x3+x4       (x4) = lwa +1 of rvars 
          ix3    x1-x3
+         zr     x3,*+1      if first word, skip *nz* check 
          ng     x3,dsiocm1  before router, check nc
+         ix3    x1+x2       (x3) = lwa +1 of transfer
          ix3    x4-x3       check if in local range
          zr     x3,dssvset  if perfect fit, go 
          pl     x3,dssvset  if in range, process as svars
*d,ncvrbuf.4
*d,filex.2230,filex.2236
 dsiow1   rj     iosetup
*d,filex.2240 
          sx2    x1-dio.nc   check if to/from nc vars 
          sa1    dsrel       absolute cm address
***   load *dsrel* into *x1* before checking nc vars
          zr     x2,dscmw0   --- if to/from nc vars 
          sx6    lvarbuf     see if local var to store into 
          ix6    x1-x6       negative if not local var
          ng     x6,dscmnlw  -- if not local var
          sa2    tlvless     load local var lesson number 
          call   lvaddr      update *lvecsad* incase moved
          call   lvload,1    load local vars
          rj     iosetup
          eq     dscmw0 
* 
 dscmnlw  bss    0
          sx6    rvarbuf     see if router var stored into
          ix6    x1-x6       compare
          ng     x6,dscmw0   if not router var, skip
          sa2    tbrvnum     router variables lesson number 
          pl     x2,dscmw0   sign bit = in-router flag
          call   rvload      load router vars 
          rj     iosetup
* 
 dscmw0   bss    0
*d,filex.2246 
*          title  dataset disk read 
*d,filexx.390,filex.2256
          rj     iosetup
*i,uznsub1.176
* /---   block      dsior      00 000   81/10/26  20.30 
*d,filexx.409,filexx.410
          sa1    dsrel       absolute cm address
          eq     dscm0
* 
 dsiorcm  sa1    dsrel       absolute cm address
          sx6    lvarbuf     see if local var to store into 
          ix6    x1-x6       negative if not local var
          ng     x6,dscmnl   -- if not local var
          sa2    tlvless     load local var lesson number 
          call   lvaddr      update *lvecsad* incase moved
          call   lvload,1    load local vars
          rj     iosetup
          eq     dscm0
* 
 dscmnl   bss    0
          sx6    rvarbuf     see if router var stored into
          ix6    x1-x6       compare
          ng     x6,dscm0    if not router var, skip
          sa2    tbrvnum     router variables lesson number 
          pl     x2,dscm0    sign bit = in-router flag
          call   rvload      load router vars 
          rj     iosetup
* 
 dscm0    bss    0
*i,filex.2279 
* 
          sa2    dskind      (x2) = type of datain/dataout
          sx2    x2-dio.nc   check if to/from nc/nv vars
          zr     x2,dscmu    -- if to/from nc/nv vars 
  
***       *x1* has cm address to store into 
          sx6    lvarbuf     see if local var stored into 
* /---   block=04-f lviofix              2024/06/05. 17:46    source 
          ix6    x1-x6       negative if not local var
          ng     x6,dscmnl2  -- if not local var
          call   lvload,-1   save updated local vars
          eq     dsionxt
* 
 dscmnl2  bss    0
          sx6    rvarbuf     see if router var stored into
          ix6    x1-x6       negative if not router var 
          ng     x6,dsionxt  -- if not router var 
          sa2    tbrvnum     router variables lesson number 
          pl     x2,dsionxt  sign bit = in-router flag
          call   rvuload     save updated router vars 
          eq     dsionxt
*d,uqnso3.210,uqnso3.212
 dscmu    bss    0
*i,filexx.442 
 iosetup  eq     *           entry/exit 
          sa1    tioecs      (x1) = em address of i/o bank
          sx2    ioblth 
          sa3    dsbias      offset to 1st disk buffer word 
          ix0    x1+x2
          ix0    x0+x3
          sa2    dswcnt      word count 
          sb2    x2 
          sa1    dsrel       restore absolute cm address
          eq     iosetup     -- exit
* 
*deck,logicx
*d,logicx.1565,logicx.1569
          call   lvaddr 
*i,logicx.1577
***       set *lvecsad* with current local var em address 
* 
          entry  lvaddr 
 lvaddr   eq     *           entry/exit 
          ax2    18          move lesson number 
          sx2    x2          strip off lesson number
          sx3    lvhead      header bias
          call   lessadd     x7 = ecs addr. of locals lesson
          sa7    =xlvecsad   store ecs address in cm cell 
          eq     lvaddr      -- return
* 
* 
*deck,platxt
*i,platxt.1468
 lvucnt   bss    1           number of local vars this unit 
 lvecsad  bss    1           ecs address of local var lesson
* 
*d,ncvrbuf.27,ncvrbuf.28
*/ --------------------------------------------------------
* /---   block=04-g filedfx              2024/06/05. 17:46    source 
*/ --------------------------------------------------------
*ident,filedfx
*deck,tutorx
*d,tutor1x.44 
          bx7    -x1*x6      bit 0; 1=filedit, 0=jumpout
*/ --------------------------------------------------------
* /---   block=05-a fgtcrsx              2024/06/23. 11:36    source 
*/ --------------------------------------------------------
*/ 'fine 'grid to 'normal ('coarse) conversion
*/ --------------------------------------------------------
*ident,fgtcrsx
*deck,exec7 
*i,kytfgtx.7
          sx7    1           normal coarse/fine conversion
*i,kytfgtx.30 
          sx7    -1          fgt coarse/fine conversion
*d,kytfgtx.76,kytfgtx.77
*                  *x7* has normal(1) or fgt(-1) flag 
* 
 touchxy  eq     *           entry/exit 
          sa7    kfgt        save touch mode
*d,fgtgfix.1,fgtgfix.2
          sa1    kfgt        get touch mode 
+         ng     x1,*+1      if fgt, assume in dots 
          lx6    3           convert to fine grid 
+         sa6    varbuf+2 
*d,fgtgfix.3,fgtgfix.4
          sa1    kfgt        get touch mode 
+         ng     x1,*+1      if fgt, assume in dots 
          lx6    4           convert to fine grid 
+         sa6    varbuf+3 
*i,exec7.2041 
 kfgt     bss    1           fgt mode'/ (-1=yes, 1=no)
*/ --------------------------------------------------------
* /---   block=05-b statnfx              2024/06/05. 17:47    source 
*/ --------------------------------------------------------
*ident,statnfx
*deck,logsitx 
*d,logsitx.1458,alesnam.2 
          sa3    statemp+12  get *trouinf*
          sx1    x3          router lesson number 
*d,logsitx.1467,logsitx.1469
          sa1    a0+1        get lesson name
 stir     bx6    x1 
          sa6    a3          store name in statemp+12 
*/ --------------------------------------------------------
* /---   block=05-c csflgfx              2024/06/05. 17:47    source  out
*/ --------------------------------------------------------
*ident,csflgfx
*deck,autload 
*d,autload.536,autload.537
          sa6    =xcsflg     mark successful unload 
* 
          sa1    tbrvnum     router variables lesson number 
*/ --------------------------------------------------------
* /---   block=05-d anscsfx              2024/06/05. 17:47    source  out
*/ --------------------------------------------------------
*ident,anscsfx
*deck,answer
*i,answer.64
          ext    csflg       (file tutorx)
*d,answer.645 
*          sa1    =xcsflg     see if we have sto/com loaded 
*          zr     x1,ffera    if no vars loaded, skip 
*          call   csuload     now start over with this key
*d,answer.748 
*          sa1    =xcsflg     see if we have sto/com loaded 
*          zr     x1,aexit1   if no vars loaded, skip 
*          call   csuload     unload any com/sto to ecs 
* aexit1   sb7    -1          flag not executing lesson 
*/ --------------------------------------------------------
* /---   block=05-e date4                2024/06/05. 17:48    source 
*/ --------------------------------------------------------
*ident,date4
*deck,comnds
*d,woipc.1
          jump   8ldate4,date4,0,onestor,11010,date4x       date4    147
*deck,exec1 
*d,exec1.87 
          ext    copyx,jkeyx,datex,date4x,clockx
*deck,exec2 
*d,exec2.33 
          entry  copyx,jkeyx,datex,date4x,clockx
*d,exec2.622
 date1    sa2    iloc 
*d,xkreorg.49,exec2.631 
* 
* 
          title  -date4-
*         -date4-  (code=147)
* 
*            stores the current date in y2k formast (as 
*           read from nos lowcore) in specified variable. 
* 
 date4x   ngetvar            a1 = variable storage address
*d,exec2.635,exec2.639
          sa1    itemp+2
          eq     date1       go and save it 
* 
* 
          title  -clock- command
* 
*         -clock-  (code=137) 
* 
 clockx   ngetvar            a1 = variable storage address
          sx6    a1 
          sa6    iloc 
          call   s=tdate,itemp     read time/date 
          sa1    itemp
          eq     date1       go and save it 
* 
* 
*deck,namex 
*d,namex.3151 
 datime   bss    3           current time/date
*deck,recordx 
*d,recordx.3966 
 datime   ovdata 3           alpha time/date (3 words)
*deck,record2 
*i,record2.1529 
 temp2    ovdata             for *s=tdate= call 
*deck,psys
*d,psys.651 
*         on entry - b1 = address of three word buffer in 
*i,psys.655 
*                   date4= (mm/dd/yyyy) 
*i,psys.683 
          bx6    x7          copy date
          lx6    48          right-shift 2 character
          mx0    -6          mask for last char 
          bx6    -x0*x6      mask out *tens* of system yr 
          sx0    1r9         check to see if year *9x*
          bx0    x6-x0       see if year *199x* 
          zr     x0,*+2      if *199x*, set to 1900 
+         sx1    2r20        century 2000 
          eq     *+2         skip to set century
+         sx1    2r19        century 1900 
+         lx1    12          position for insertion 
          bx6    x7          copy date
          lx6    54          set format '7  mm/dd/yy'7
          mx0    48 
          bx6    x0*x6       mask out '7  mm/dd/  '7
          lx6    12          set format '7mm/dd/    '7
          mx0    36 
          bx6    x0*x6       mask out '7mm/dd/    '7
          bx6    x6+x1       set format '7mm/dd/yy  '7
          lx7    54          set format '7--mm/dd/yy'7
          mx0    -12         mask out last 2 chars
          bx1    -x0*x7      get *yy* from original -date-
          bx6    x6+x1       set format '7mm/dd/yyyy'7
          sa6    a7+1        save in *itemp+2*
*i,psys.686 
* /---   block      routines   00 000   82/10/03  16.36 
*/ --------------------------------------------------------
* /---   block=05-f cdaty2k              2024/06/05. 17:48    source 
*/ --------------------------------------------------------
*ident,cdaty2k
*deck,exec9 
*i,exec9.357
* /---   block      ident      00 000   82/09/26  20.39 
*d,exec9.368
*i,exec9.402
* /---   block      ident      00 000   82/09/26  20.37 
*d,exec9.536
*i,exec9.541
* /---   block      ident      00 000   82/09/26  22.32 
*d,exec9.615
*i,exec9.623
* /---   block      ident      00 000   82/10/07  21.49 
*i,exec9.628
*         -cdate- can convert 4 types of input';
* 
*         1) -day- input
*         2) -date- input 
*         3) -date4- input
*         4) month, day, year input 
*                yr = 70-99 (1970-1999) 
*                     00-69 (2000-2069) 
*                     100-199 (2000-2099) 
*                     1970-2069 
* 
*d,exec9.658
          ng     x4,dalpha   alpha format input (date)
          bx1    x4          copy value 
          lx1    6           shift 1st char right side
          mx0    -6          mask first char
          bx1    -x0*x1      get first char (right side)
          sx0    1r0         see if first char ',0',
          bx0    x0-x1       compare
          zr     x0,dalpha   -date4- format 
          sx0    1r1         see if first char ',1',
          bx0    x0-x1       compare
          zr     x0,dalpha   -date4- format 
*d,exec9.667,exec9.670
          sb1    3
          eq     b1,b3,nolzero  if yy/mm/dd.. 
          sb1    6
          eq     b1,b3,nolzero  if yyyy/mm/dd 
  
          mx3    6           check for leading zero 
          bx3    x7*x3       mask out first character 
          lx3    6           right justify character
          sx1    33b         ',0',
          ix3    x3-x1       compare
          nz     x3,nolzero 
*i,exec9.679
* /---   block      ident      00 000   82/10/09  20.40 
*d,exec9.688
*i,exec9.746
* /---   block      ident      00 000   82/10/09  20.40 
*d,exec9.752
*d,exec9.758
          sb3    x1          (b1) = format 1-6
*d,exec9.766
          sb1    6           1-3 regular, 4-6 y2k 
*i,exec9.778
* /---   block      ident      00 000   82/10/09  22.10 
*d,exec9.806,exec9.811
          ng     x1,err0     leave if < 0 
  
*d,exec9.822,exec9.834
  
**        comment out lines below to solve year 2000
**        leap year problem.    10/09/98 cmh
*          bx3    x0
*          bx4    x1
**         ix2    x4/x3       form partial year 
*          px4    x4
*          px3    x3
*          nx4    x4,b4 
*          nx3    x3,b4 
*          fx2    x4/x3 
*          ux2    x2,b4 
*          lx2    b4
*          ix0    x0*x2 
*          ix1    x1-x0       (jul * 4)-1-(146097 * year) 
**        above lines commented out because checking for
**        leap year in year 2000 does not compute correctly.
* /---   block=05-g cdaty2k              1998/10/10. 22:19    source 
**        this will have to be fixed further before year
**        2100 to prevent leap year.  10/09/98 cmh
  
*i,exec9.862
* /---   block      ident      00 000   82/10/09  23.27 
*d,exec9.894
*d,exec9.898,exec9.900
  
*          sx0    100 
*          ix2    x0*x2       year*100
*          ix2    x2+x1       year _ year*100+jul 
**        above 3 lines commented out because removing
**        check for 146097 check on day/month automatically 
**        adds 100 to the year.   10/09/98 cmh
          bx2    x1          get year (10/10/98 cmh)
*i,exec9.915
  
  
* /---   block      ident      00 000   82/10/09  23.58 
*d,exec9.943,exec9.944
          sa1    datesl      10h00/00/0000
          bx6    x1 
  
          sx1    2000        check to see if date < 2000
          ix1    x2-x1       compare
          ng     x1,dpack00  if negative, year 1900+
          sx2    x1          convert to 2 digit year
          eq     dpack02
  
 dpack00  sx0    2r19        year 19xx
          sx1    1900d       see if 4 digit year
          ix1    x2-x1       compare
          ng     x1,*+2      if < 1900, continue
+         sx2    x1          get 2 digit year 
          eq     dpack03
  
+         sx1    100         check to see if > 100 (yr 2000)
          ix1    x2-x1       compare
          ng     x1,dpack01  if < 100, year 1900
          bx2    x1          get 2 digit year 
          eq     dpack02
  
 dpack01  sx1    72          check to see if 2char date 
          ix1    x2-x1       compare
          pl     x1,dpack03  year in 1900 century 
 dpack02  sx0    2r20        set thousands/hundreds 
 dpack03  lx0    12          position for insert
          mx1    12          set up mask to clear century 
          lx1    24          position correctly 
          bx6    -x1*x6      00/00/..00 
          bx6    x6+x0       (x6) = 00/00/xx00
*d,exec9.950
*d,exec9.957
          lx0    30 
*d,exec9.964
          lx0    48 
*i,exec9.967
* /---   block      ident      00 000   82/10/09  20.05 
*d,exec9.973
*d,exec9.997,exec9.1003 
          pl     x1,datcvt1  if in y2k format, skip 
          lx1    6           (x1) = mm/dd/yy--
          mx0    12          mask out year to move
          lx0    24          position to *yy* 
          bx4    x0*x1       get *yy* 
          lx4    48          right justify *yy* 
          mx0    6*6         6 chars
          bx1    x0*x1       (x1) = mm/dd/....
          bx2    x4          copy *yy*
          ax2    6           right shift, drop ones digit 
          sx3    1r7         check for year 1970 or greater
          ix3    x2-x3       check to see if 1970 or greater
          pl     x3,*+2      if 1970 or greater, skip
+         sx0    2r20        set to year 20xx 
          eq     *+2
* /---   block=06-a cdaty2k              1998/10/10. 12:36    source 
+         sx0    2r19        set to year 19xx 
+         lx0    12          position century for date
          bx1    x1+x0       (x1) = mm/dd/xx00
          bx1    x1+x4       (x1) = mm/dd/xxyy
  
 datcvt1  sb1    1           format 1 
          eq     b1,b3,dshif1 
          sb1    4           y2k form of format 1 
          eq     b1,b3,dshif1 
  
          sb1    2           format 2 
          eq     b1,b3,ddmmyy 
          sb1    5           y2k form of format 2 
          eq     b1,b3,ddmmyy 
  
* /---   block      ident      00 000   82/10/09  20.00 
*d,exec9.1007,exec9.1017
          bx2    x1*x4       mm/dd..... 
          lx2    42          ...mm/dd.. 
          mx4    -4*6        777777.... 
          bx3    -x4*x1      ......yyyy 
          lx3    48          yy......yy 
          sx4    1r/         ........./ 
          lx4    42          ../....... 
  
          sb1    6           y2k format 
          eq     b1,b3,ydm1  if y2k format
          mx0    12          mask top 2 chars 
          bx3    x0*x3       (yy........) 
          eq     ydm2 
  
 ydm1     lx2    48          .....mm/dd 
          lx3    48          yyyy...... 
          lx4    48          ..../..... 
  
 ydm2     bx7    x3+x4       yy/....... or yyyyy/.....
          bx7    x7+x2       yy/mm/dd.. or yyyy/mm/dd 
*d,exec9.1022,exec9.1046
 ddmmyy   mx0    -4*6        777777.... 
          bx7    -x0*x1      ......yyyy 
  
          sb1    5           y2k format 
          eq     b1,b3,*+2   if y2k format
  
+         mx0    -12
          bx7    -x0*x7      ........yy 
          lx7    12          ......yy.. 
  
+         mx0    3*6         777....... (2 chars of 77b)
          bx2    x1*x0       mm/....... 
          lx2    42          ...mm/...
          lx1    18          dd/yyyymm/ 
          bx3    x0*x1       dd/....... 
          bx7    x7+x3       dd/...yy.. or dd/...yyyy 
          bx7    x7+x2       dd/mm/yy.. or dd/mm/yyyy 
          eq     datcvt      exit 
  
  
 dshif1   bx7    x1          (mm/dd/yyyy) 
          sb1    4           y2k format 
          eq     b1,b3,datcvt   already in y2k, exit
  
          mx0    8*6         77777777.. 
          bx3    -x0*x1      mask out 2 digit year
          mx0    6*6         777777.... 
          bx7    x1*x0       mm/dd/.... 
          lx3    12          ......yy.. 
          bx7    x7+x3       mm/dd/yy.. 
          eq     datcvt      exit 
* /---   block      ident      00 000   82/10/03  18.35 
*d,exec9.1079,exec9.1081
          sb1    3           format 3 
          ne     b1,b3,dshf0 year is on left now
          lx1    3*6         move year to right side
          eq     dshf 
  
* /---   block=06-b cdaty2k              2024/06/05. 17:48    source 
 dshf0    sb1    6           y2k form of format 3 
          ne     b1,b3,dshf  year is on left now
          lx7    5*6         move the year to right 
  
*i,exec9.1084 
  
  
*d,exec9.1117,exec9.1118
 datesl   con    10h00/00/0000
*/ --------------------------------------------------------
* /---   block=06-c mfuy2k               2024/06/23. 17:40    source 
*/ --------------------------------------------------------
*ident,mfuy2k 
*deck,mfutil
*d,mfutil.741,zp895.8 
  
          rj     date4       get y2k date 
          eq     setup
  
* /---   block      setup      00 000   82/09/25  22.01 
*d,mfutil.818 
*          date   ddate       date in header
          rj     date4       get y2k date for header
          sa7    ddate       save y2k date in *x7*
*i,zb26736.43 
 date4    ps                 entry/exit 
* 
*         get date and reformat for initialization date 
* 
          date   cdate
          sa1    cdate       (x1) = byy/mm/dd.
          mx0    12 
          lx0    60-6 
          bx6    x0*x1       (x6) = 0yy0000000
          lx6    54          (x6) = 00yy000000
          bx7    x6          (x7) = 00yy000000
          lx7    24          (x7) = 00000000yy
          mx0    -12         mask last char (*yy*)
          bx0    -x0*x7      (x7) = 00000000yy
          sx2    2r98        check to see if yr < 98
          ix0    x0-x2       subtract year
          ng     x2,*+2      if year < 98, y2k
+         sx2    2r19        19xx 
          eq     *+2
+         sx2    2r20        20xx 
+         lx2    48          left justify (xx00000000)
          bx6    x6+x2       (x6) = xxyy000000
          sx2    1r/
          lx2    60-6 
          bx6    x6+x2       (x6) = /xxyy00000
          lx6    60-6*5      (x6) = 00000/xxyy
          mx0    6*5
          lx0    60-6 
          lx1    3*6         (x1) = /mm/dd.byy
          bx7    x0*x1       (x7) = 0mm/dd0000
          lx7    6           (x7) = mm/dd00000
          bx7    x7+x6       (x7) = mm/dd/xxyy
          sa7    a1 
          eq     date4
* 
*/ --------------------------------------------------------
* /---   block=06-d buy2k                2024/06/05. 17:49    source 
*/ --------------------------------------------------------
*ident,buy2k
*deck,backlib 
*i,backlib.159
* /---   block      tape       00 000   82/10/20  21.37 
* 
*d,bufix.1,backlib.165
          sx1    x1+96d      current year = yr+96 (base yr) 
          sx7    100d        see if past (19)99 
          ix7    x1-x7       subtract 100, + = year 20xx
          ng     x7,buildo1  if negative, not year 2000+
          sx1    x7          get 2 digit portion of yr 2000 
 buildo1  rj     cdd
*deck,backone 
*i,backone.341
* /---   block      backone    00 000   82/10/20  21.49 
* 
*d,backone.346,backone.347
          sx1    x1+96d      (current year = yr+96)
          sx7    100d        see if past (19)99 
          ix7    x1-x7       subtract 100, + = year 20xx
          ng     x7,buildo1  if negative, not year 2000+
          sx1    x7          get 2 digit portion of yr 2000 
 buildo1  rj     cdd
*deck,copymf
*i,copymf.247 
 setepr   space  4
**        setepr - set error processing bit in the fet
* 
*         entry  a1/x1=fet+1 and contents 
  
 setepr   data   0           entry/exit 
          sx6    b1          mask for epr 
          lx6    44 
          bx6    x6+x1
          sa6    a1 
          eq     setepr 
* /---   block      subrtines  00 000   82/10/20  21.26 
*d,bufix.1
** in packed date, the year is stored in 12 bits, full
** value (ie'; 1998).  'i assume it is already y2k
** compliant so will have a value of 2000 and beyond. 
** below, it subtracts 26d from year (1998), then masks 
** the lower 4 bits to come up with the offset.  'the 
** original offset was 13d (1980-1995), but with a
** modification, was changed to 26d to handle years 
** 1996-2011.  'a bit used in another word is used as a 
** flag to indicate the field is using the new format 
** (see mods made to deck '7backone'7 to see how flag set). 
** for example'; 1998-26=1972 (o3664), o3664 $mask$ o17 
** (4 bits) = 4.     cmh 10/20/98 
          sx5    26d         subtract 26 years (1996 base)
*d,copymf.297,copymf.308
*deck,copypf
*i,copypf.1317
* /---   block      copypfx    00 000   82/10/20  21.55 
* 
*d,copypf.1322,copypf.1323
          sx1    x1+96d      (current year = yr+96)
          sx7    100d        see if past (19)99 
          ix7    x1-x7       subtract 100, + = year 20xx
          ng     x7,buildo1  if negative, not year 2000+
          sx1    x7          get 2 digit portion of yr 2000 
 buildo1  rj     cdd
*/ --------------------------------------------------------
* /---   block=06-e attfxx               2024/06/05. 17:49    source  out
*/ --------------------------------------------------------
*ident,attfxx
*deck,filex 
*d,uznsubf.140
*i,uznsubf.155
 t.faw    equ    tbintsv+9   file attribute word
*d,filex.2491 
*deck,ioput 
*d,ioput.494,ioput.496
*         this routine uses tbintsv+14. 
  
 exitsv   equ    tbintsv+14  save exit address
*d,ioput.680
*         this routine uses (*exitsv*)
*d,ioput.706
          sa6    exitsv 
*d,ioput.743
          sa4    exitsv      pick up specified station num
*d,ioput.764
          sa1    exitsv      load saved key 
*d,ioput.768
          eq     exitsv      execute top 30 bits of word
*d,ioput.782,ioput.784
          sa6    exitsv 
          eq     ndetp0      to same code as *detachp*
 .mds     endif 
* /---   block      detachp    00 000   86/01/26  23.40 
*d,ioput.822
*         this routine uses (*exitsv*)
*d,ioput.867
          sa6    exitsv 
*d,ioput.880
*                (exitsv) = 30/exit jump, 30/0
*d,ioput.901
          sa2    exitsv      (x2) = 30/exit jump, 30/0
*/ --------------------------------------------------------
* /---   block=06-f attdbg               2024/06/05. 17:49    source  out
*/ --------------------------------------------------------
*ident,attdbg 
*deck,filex 
*d,filex.1174 
 of720    sx7    12           file attached elsewhere 
*d,uznsubf.140
*i,uznsubf.155
 t.faw    equ    tbintsv+9   file attribute word
*d,filex.2491 
*d,filex.2606 
          ng     x1,dseopx    jump if an error
*d,filex.2811 
 dse2     sx6    22          reserve attach 
*i,filex.2818 
 dseopx   sx6    55          debug
          sa6    treturn
* 
*d,filex.3394 
 tferr2   sx7    32           file in use elsewhere 
*d,filex.3401 
 tferr2a  sx7    42           file in use elsewhere 
*deck,ioput 
*d,ioput.494,ioput.496
*         this routine uses tbintsv+14. 
  
 exitsv   equ    tbintsv+14  save exit address
*d,ioput.680
*         this routine uses (*exitsv*)
*d,ioput.706
          sa6    exitsv 
*d,ioput.743
          sa4    exitsv      pick up specified station num
*d,ioput.764
          sa1    exitsv      load saved key 
*d,ioput.768
          eq     exitsv      execute top 30 bits of word
*d,ioput.782,ioput.784
          sa6    exitsv 
          eq     ndetp0      to same code as *detachp*
 .mds     endif 
* /---   block      detachp    00 000   86/01/26  23.40 
*d,ioput.822
*         this routine uses (*exitsv*)
*d,ioput.867
          sa6    exitsv 
*d,ioput.880
*                (exitsv) = 30/exit jump, 30/0
*d,ioput.901
          sa2    exitsv      (x2) = 30/exit jump, 30/0
*/ --------------------------------------------------------
* /---   block=06-g datinfx              2024/06/05. 17:50    source 
*/ --------------------------------------------------------
*ident,datinfx
*deck,filex 
*d,uznsubf.140
*d,filexx.428 
 dserr2x  sx6    2           2 = bad record number
*d,uznsub1.265,uznsub1.268
          ng     x6,dserr2x  --- error if bad record number 
          mx2    -18         check if too big 
          bx2    x2*x1
          nz     x2,dserr2x  --- error if bad record number 
*deck,exec1 
*d,exec1.2221 
*         uses a/0,4
*d,exec1.2225,rewefx2.1 
          sx0    x4          unit info only 
          sa4    ecsuloc     get address of -uloc- table
          ix0    x4+x0       index to this unit 
*deck,filex 
*d,filexx.565 
          sa1    ilesun      load lesson number 
          bx5    x1          move it to *x5*
*deck,ioput 
*i,ioput.1998 
          sa5    a5          restore *x5* incase lost 
*/ --------------------------------------------------------
* /---   block=07-a fix                  2024/06/05. 17:50    source  out
*/ --------------------------------------------------------
*ident,fix
*deck,exec1 
*d,exec1.475
**debug 
 proc1    sx7    a5          *save* command pointer 
          sa7    lastcmd
          sa5    a5-1        load next command
**debug 
* proc1    sa5    a5-1        load next command 
*d,exec1.492
**debug 
 sproc1   sx7    a5          *save* command pointer 
          sa7    lastcmd
          sa5    a5-1        load next command
**debug 
* sproc1   sa5    a5-1        load next command 
*i,exec1.513
**debug 
 findme   data   6lfindme 
 lastcmd  bss    1
**debug 
*/ --------------------------------------------------------
* /---   block=07-b nolvl6               2024/06/22. 20:56    source 
*/ --------------------------------------------------------
*ident      nolvl6  wns.           23/11/01.
*/ problem';
*/ level 6 conden overlays do not get built in normal
*/ builds and we do not have the external source library
*/ for level 6.
*/ a crash happens because we run cybis in development
*/ mode which exposes the option to condense level 6 and
*/ it was assumed development mode cybis would have level
*/ 6 overlays installed as part of a special 
*/ internal development build process that we don'7t do.
*/
*/ solution';
*/ borrow paul konings nocmp patch to 
*/ disallow condensing micro plato level 6.
*/ do not crash on missing conden overlays
*/  (like central tutor or development level)
*deck cond
*i cond.152
          sx6    33          condense error code for *cmp not available*
          zr     x1,cmpgo3   if cmp absent
*i cond.306
          zr    x1,badlev   if this level not built into this conden
*/ end nolvl6
*/ --------------------------------------------------------
* /---   block=07-c ccode                2024/06/23. 11:37    source 
*/ --------------------------------------------------------
*/ 'allow -ccode- in non system lessons.
*/ --------------------------------------------------------
*ident      ccode  wns.           23/11/01.
*deck mcond2b
*d mcond2b.572
*deck mcond3b
*d mcond3b.572
*deck mcond4b
*d mcond4b.572
*deck mcond5b
*d mcond5b.572
*/ end of modset
*/ --------------------------------------------------------
* /---   block=07-d tbtcap               2025/04/01. 14:55    source  out
*/ --------------------------------------------------------
*/ add a terminal capabilities word to student bank
*/        'this patch is incompatible with the
*/        'other station bank mods.
*/        
*/        'not sure what incompatabilty is refered to above
*/        'works as long as next block is 'i'n'a'c't'i'v'e
*/        drs 2025-03-30
*/ --------------------------------------------------------
*ident     tbtcap  drs.           23/11/08.
*deck platxt
*i platxt.1262
 tbtcap   bss    1           terminal capabilites
 cp.fill  equ    0           fill bit
 cp.pal   equ    1           palette
 cp.styl  equ    2           styles
 cp.ftou  equ    3           fine touch
 cp.kerm  equ    4           kermit
 cp.trap  equ    5           trap/stretch
 cp.dsty  equ    6           define styles
 cp.lexe  equ    7           local exec
 cp.xor   equ    8           xor mode
 cp.img   equ    9           image
 cp.inhb  equ    10          terminal inhibit/allow
 cp.txt1  equ    11          terminal text edit 1
 cp.aud   equ    12          basic audio fucntions
*
*   bits 48 - 53 operating system id
*
 cp.tprt  equ    13          text screen print bit
 cp.pixt  equ    57          pixel touch on bit
 cp.chrd  equ    58          fill chord flag
 cp.filf  equ    59          fill flag
*edit platxt
*/ end platxt
*deck lex1
*i lex1.795
          sysnam tbtcap
*i lex1.680
          sysnam terscrn,terscrn
*/ end lex1
*deck pftext
*i zhboy.2
 terscrn  data   0
*
*         12/ plato x screen size
*         12/ plato y screen size
*         12/ terminal x screen size
*         12/ terminal y screen size
*          4/ reserved for protocol level flags
*          1/ ascii plato iv bit (no mode 4)
*          4/ mtutor version number
*          1/ cdc epap bit
*          1/ protocol level 1 flag
*          1/ color flag
*
 exal1    equ    58          level 1 ascii flag
*
 asciv    equ    52          ascii plato iv bit
*
 xtouchw  data   0           extended touch word
*
*         3/ state of input index 0..7
*         15/
*         6/ cursor bits, lower is touch
*         18/ x pointer loc
*         18/ y pointer loc
*
*
*
*edit pftext
*/ end pftext
* /---   block=07-e tbtcap               2025/04/01. 14:57    source  out
*deck lexdef
*i lexdef.142
          sym    ztlevel,70,95,icmpnam,sname7,ztlevel,s
          sym    ztosid,70,95,icmpnam,sname6,ztosid,s
          sym    ztxpps,70,95,icmpnam,sname6,ztxpps,s
          sym    ztypps,70,95,icmpnam,sname6,ztypps,s
          sym    ztxppc,70,95,icmpnam,sname6,ztxppc,s
          sym    ztyppc,70,95,icmpnam,sname6,ztyppc,s
          sym    zxmax,70,95,icmpnam,sname5,zxmax,s
          sym    zymax,70,95,icmpnam,sname5,zymax,s
          sym    zymin,70,95,icmpnam,sname5,zxymin,s
          sym    zxmin,70,95,icmpnam,sname5,zxymin,s
 
*edit lexdef
*/ end lexdef
*deck getvar
*i getvar.49
          entry  ztlevel
          entry  ztosid
          entry  ztxpps,ztypps,zxmax,zymax
          entry  ztxppc,ztyppc,zxymin
*i getvar.1988
 ztlevel  ps
          sa1    terscrn
          mx2    -1
          lx1    -1
          bx1    -x2*x1
          eq     ztlevel
 ztosid   ps
          rj     ztlevel
          zr     x1,ztosx
          sa1    tbtcap
          mx2    -6
          lx1    -48
          bx1    -x2*x1
          sx1    x1+1
          eq     ztosid
 ztosx    sx1    0
          eq     ztosid
 ztxpps   ps
          sa1    terscrn
          mx2    -12
          lx1    -24
          bx1    -x2*x1
          eq     ztxpps
 ztypps   ps
          sa1    terscrn
          mx2    -12
          lx1    -12
          bx1    -x2*x1
          eq     ztypps
 zxmax    ps
          sa1    terscrn
          mx2    -12
          lx1    -48
          bx1    -x2*x1
          sx1    x1-1
          eq     zxmax
 zymax    ps
          sa1    terscrn
          mx2    -12
          lx1    -36
          bx1    -x2*x1
          sx1    x1-1
          eq     zymax
 ztxppc   ps
          sx1    8
          eq     ztxppc
 ztyppc   ps
          sx1    16
          eq     ztyppc
 zxymin   ps
          sx1    0
          eq     zxymin
          
*/ end getvar
*deck pcftext
*d jbfgt.2
*i pcftext.65
 psyslth  equ    30          station bank length
*edit pcftext
*/ end pcftext
*/
*/        'modify the length of the station bank.
*/
*deck dsn1
*delete dsn1.191
          errnz  stbkl-30d  station bank length .ne. 30d
*/ end dsn
*/
*/ --------------------------------------------------------
*/ end of modset
* /---   block=07-f statbank-a           2024/06/05. 17:40    source  out
*/ --------------------------------------------------------
*/        'there is an error in this deck causing a
*/        ','p', type error during full assembly.
*/        'this is normally 28d if the station bank isn'7t
*/        modified.
*/        mod '7tbtcap'7 supersedes the need for this one.
*deck dsn1
*delete dsn1.191
          errnz  stbkl-28d  station bank length .ne. 28d
*/ end dsn
*/
*/ --------------------------------------------------------
* /---   block=07-g statbank-b           2024/06/05. 17:59    source  out
*/ --------------------------------------------------------
*/        'commented out the next line
*/ delete dsn1.204
*/
*/ this makes it fit, trimming a message
*/
*/        'commented out the next line
*/ delete dsn1.2186,dsn1.2191 
*/ end dsn
*/
*/ --------------------------------------------------------
* /---   block=08-a notesys              2024/06/05. 17:51    source 
*/ --------------------------------------------------------
*ident     notesys  drs.           23/11/09
*/ change notesys system lesson parameters
*deck sysless
*d sysl95a.181
          ltype  notesys,(bin,sys,wrt,d2,sysnv)
*/ end of modset
*/ --------------------------------------------------------
* /---   block=08-b pfy2k2               2024/06/23. 11:38    source 
*/ --------------------------------------------------------
*/ 'fix pf blabel formatting to mask year correctly
*/ --------------------------------------------------------
*/  (see yrfix)
*/ william schaub 21.02.23.
*/
*ident pfy2k2
*deck pf
*i pf.4801
          mx0    -7
*/ end pf
*/
*/ 'fix pf blabel write to handle 21st century
*/
*ident pfy2k
*deck pf
*d pf.4161
          pl     x6,cbl0     if 20th century
          sx6    x6+100      adjust for 21st
 cbl0     sa6    pdate
*/ end pf
*/
*/ 'extend pf blabel write to handle modify compatible labels
*/
*ident pfmod
*deck pf
*i pf.4122
          zr     x2,lbd1     if block label comment
          sa2    bline2      try alternate form of block label
          ix2    x2-x3
*d pf.4128
 lbd1     mx0    30
*/ place bline2 above bline because bline is used as
*/ an index
*/ this also prvents printout of both blabel first words
*i pf.5471
 bline2   data   10l*/ ---   b     modify compatible block label
*/ since a2 can be either blabel or blabel2
*/ make sure we are always referencing the right thing.
*d pf.4131
          sa2    bline+1
*/ print modify safe blabels if we are called with
*/ the pf read option and ,modify is specified.
*i pf.574
          sa1    bline2
          lx6    x1
          sa6    bline
*/ print modify style blabels if we are called with the
*/ pb read option and ,modify is specified
*i pf.707
          sa1    bline2
          lx6    x1
          sa6    bline
*/ end pf
*/ --------------------------------------------------------
* /---   block=08-c fontx                2024/06/05. 17:53    source  out
*/ --------------------------------------------------------
*ident    fontx              
*/ enable -font- on platoaccess.jar
*deck exec1
*i client.27
          sa1    terscrn
          mx2    -1
          lx1    -1
          bx1    -x2*x1
          sx0    x1
          nz     x0,client1  if ztlevel <> 0
*/ end of modset
*/ --------------------------------------------------------
* /---   block=08-d ptfont               2024/06/22. 20:41    source 
*/ --------------------------------------------------------
*/ turn on -font- for pterm
*/ --------------------------------------------------------
*ident ptfont
*deck pftext
*i arrows.5
sbtpterm equ    16          pterm for cyber1 software
*/ end pftext
*deck exec3
*i nexec3.757
          title  send font ext codes to ascii pterm only
***       fontext  -  sends ext codes to pterm
*
*         uses a - 1
*              b - 1,2
*              x - 0,1
*
*         input'; b1 = ext code
*                b2 = value to be added to ext
*
*
          entry  fontext
 fontext  eq     *           entry/exit
          sa1    stflag1     get terminal info word
          mx0    -ttbtn      set mask for term type field
          lx1    ttbtn-ttbts  position term type field
          bx0    -x0*x1      get term type
          sx0    x0-asctype  see if ascii term (ztttype=12)
          nz     x0,fontext  if not ascii, exit
          sa1    bankadd     get word holding term subtype
          mx0    -tsbtn      set mask to get data
          lx1    tsbtn-tsbts  position data to end of word
          bx1    -x0*x1      mask out term subtype
          sx0    x1-sbtwin   see if windows terminal
          zr     x0,fontext1 send -ext- code
          sx0    x1-sbtmac   see if macintosh system
          zr     x0,fontext1 send -ext- code
          sx0    x1-sbtpterm see if pterm terminal
          zr     x0,fontext1 send -ext- code
          eq     fontext     -- return
 
 fontext1 sx1    b1          -ext- code
          sx1    x1+b2       add additional value to -ext-
          outcode extcode    output code to formatter
          eq     fontext     return
*d font.39
          call   fontext,5000b,x1    font type code
*d font.49
 sendsiz  call   fontext,5100b,x1    font size code
*d font.53
          call   fontext,5200b,x1    font mode code
*/ end exec3
*deck tutorx
*d font.32
          call   fontext,5000b,1     default font
*d font.37,font.38
          call   fontext,5100b,0     default size
          call   fontext,5200b,0     default font mode
*d font.56
          call   fontext,5000b,x1
*d font.68
          call   fontext,5100b,x1
*d font.73
          call   fontext,5200b,x1
* /---   block=08-e packdir              2024/06/23. 08:33    source  out
*/ --------------------------------------------------------
*/ set the pack info length to 255 for 7000 part packs
*/ --------------------------------------------------------
*ident,pd7000    
*deck syscon
*d mf9500.2
 pitlth3  equ    256d        mf info table lng (3-part dir)
*/ end packdir
* /---   block=08-f ovlfix               2025/04/02. 15:03    source 
*/ --------------------------------------------------------
*/ 'adjust the maximum 'level 0 'overlay 'length
*/ --------------------------------------------------------
*ident ovlfix
*deck ftext
*d vgvt100.1
 lv0lth   equ    5500b       max level 0 overlay length
*/ end ovlthfx
* /---   block=08-g rvar leak            2024/06/22. 20:27    source 
*/ --------------------------------------------------------
*/ fix router variable leak if no router lesson
*/ --------------------------------------------------------
*ident rvleak
*deck tutorx
*d tutor1x.1370
          zr     x1,rout10
* /---   block=09-a call fin             2024/06/22. 20:45    source 
*/ --------------------------------------------------------
*/ disallow -call- in finish unit
*/ --------------------------------------------------------
*ident callfin
*deck exec8
*d exec8.3581
          finish             illegal in -finish- unit
* /---   block=09-b p5block              2024/06/22. 20:45    source 
*/ --------------------------------------------------------
*/ workaround for ascii ppt block erase bug
*/ --------------------------------------------------------
*ident p5block
*deck fovlay5
*d fovlay5.851
          pl     x1,sxy3     if not *send all parts*
          bx1    x3          show all fields as changed
 sxy3     bx6    x3*x1       extract upper bit of each field
*d fovlay5.1665,fovlay5.1666
          sx4    512         destroy x/y
          sx3    x4
          mx6    1           force full x/y send next time
          sa6    dangle
*i fovlay5.2711
          mx6    1           force full x/y send next time
          sa6    dangle
* /---   block=09-c pniemu               2024/06/22. 20:45    source  out
*/ --------------------------------------------------------
*/ add pni emulation to dtcyber
*/ --------------------------------------------------------
*ident pniemu
*deck msubs
*i msubs.10
*call comsrpv
*i msubsa.18
 pnioff   con    e.pni
          data   0
 
 pnidie   con    e.pni
          data   -0
 
 rsetall  vfd    42/0,6/s.rall,12/e.sock
 
 rpvdata  rpvblk doexit
          space  4,12
**        doexit - reprieve handler for plato termination
 
 doexit   sx1    rsetall
          ex1    x1          reset all sockets
          sa1    rpvdata+3
          mx2    -12
          bx2    -x2*x1      isolate error code
          sx2    x2-7
          zr     x2,exit1    if operator kill
          sx1    pnidie      turn off pni with *plato off*
          eq     exit2       and do that
 
 exit1    sx1    pnioff      turn off pni without message
 exit2    ex1    x1          shut down pni emulation
          reprieve rpvdata,reset,0  continue error processing
 
*i xwbplat.1
          reprieve rpvdata,setup,377b  catch everything
*i msubs.754
 
 pnireq   con    e.pni
          bss    1
 
*i msubs.1317
          bx6    x2          copy pni init pointer
          sa6    pnireq+1
          sx0    pnireq
          ex0    x0          turn on pni emulation
*/ end msubs
* /---   block=09-d nprtfix              2024/06/23. 08:59    source 
*/ --------------------------------------------------------
*/ make notesfile printing (nprt) work
*/ --------------------------------------------------------
*ident nprtfix
*deck nprt
*d nprt.12
     "idblks,idw(2048),ftitle(5),idinfo(20),ipinfo(10),
*d nprt.62,nprt.63
      print 12,month(mon),iday,iyr+1900
12    format(/48x,*notes beginning*,a10,i3,*, *,i4)
*d nprt.68
13    format(/35x,*file *,a10,* printed at *,a10,* on*,a10,1x,a2,*, 20*,
*d nprt.170
     "idblks,idw(2048),ftitle(5),idinfo(20),ipinfo(10),
*d nprt.196
20    print 30,mon,iday,iyr+1900,hrout,icolon,min,ape,
*d nprt.199
21    print 31,mon,iday,iyr+1900,hrout,icolon,min,ape,
*d nprt.202
22    print 32,mon,iday,iyr+1900,hrout,icolon,min,ape,
*d nprt.205
23    print 33,mon,iday,iyr+1900,hrout,icolon,min,ape,
*d nprt.209
30    format(12x,i2,*/*,i1,*/*,i4,3x,i2,a1,*0*,i1,1x,a2,5x,
*d nprt.211
31    format(12x,i2,*/*,i1,*/*,i4,3x,i2,a1,i2,1x,a2,5x,
*d nprt.213
32    format(12x,i2,*/*,i2,*/*,i4,2x,i2,a1,*0*,i1,1x,a2,5x,
*d nprt.215
33    format(12x,i2,*/*,i2,*/*,i4,2x,i2,a1,i2,1x,a2,5x,
*d nprt.241
     "idblks,idw(2048),ftitle(5),idinfo(20),ipinfo(10),
*d nprt.320
 dw       bss    2048        directory words
*d nprt.464,nprt.466
 nosub    sx2    x1-2048     cant be over 2047
          ng     x2,dbd1
          sx1    2047
*d nprt.870
 ncb      equ    10          number of ecs block buffers                
*/ end nprt
*/ 'fix tprint to print -use- commands
*ident tprtuse
*deck tprta
*yank ai27611
*/
* /---   block=09-e pptok                2024/06/22. 20:44    source 
*/ --------------------------------------------------------
*/ allow ppt commands without fuss
*/ --------------------------------------------------------
*ident pptok
*deck condc
*d vcppt.49,vcppt.66
*d vcppt.68,vcppt.71
*deck covlay2
*d covlay2.493
*d covlay2.733,covlay2.793
*/ end covlay2
* /---   block=09-f ciuasci              2024/06/22. 20:47    source 
*/ --------------------------------------------------------
*/ make ascii terminals work if ciu is also present
*/ --------------------------------------------------------
*ident ciuasci
*deck outform
*d miscfx1.5
+         eq     outf555     14 - ascii terminal
*/ end outform
* /---   block=09-g cerlpak              2024/06/22. 20:48    source  out
*/ --------------------------------------------------------
*/ use cerl-style real packs
*/ --------------------------------------------------------
*ident cerlpak
*deck mastor
*d jsnppu.11
          system png,,pngwrd
*/ end mastor
* /---   block=10-a logout               2024/06/22. 21:01    source 
*/ --------------------------------------------------------
*/ send out nopcode 3 when logout is being done, so the niu knows
*/ about that and can stop sending offkey.
*/ --------------------------------------------------------
*ident logout
*deck fovlay1
*i fovlay1.1178
          sx7    3
          packwrd x7         send *logging out* pterm nop
*deck fovlay3
*i fovlay3.1166
          sx7    3
          packwrd x7         send *logging out* pterm nop
*deck fovlay4
*i fovlay4.1308
          sx7    3
          packwrd x7         send *logging out* pterm nop
*deck main
*d main.1576
          pl     x2,pkeyt1   if higher than touch range
*i main.1578
*
* * *     check for *offky2*
*
 pkeyt1   sx2    x1-offky2
          nz     x2,pkeyt2   if not *offky2*
          outp   fincode     tell niu that we are logged out already
          call   patut
          sx1    next        treat it as next to sign in
          eq     pkeytype
*d main.1582
 pkeyt2   sx2    x1-abortk
*/ end logout
* /---   block=10-b dtxon                2024/06/22. 21:01    source  out
*/ --------------------------------------------------------
*/ add xon/xoff processing.  these keys are generated in pterm
*/ when its terminal word buffer is close to full.
*/ --------------------------------------------------------
*ident dtxon
*deck paramc
*i paramc.168
 xonkey   equ    1606b       xon  key value
 xofkey   equ    1607b       xoff key value
*/ end paramc
*/
*deck pftext
*i pftext.287
 xofbit   equ    58          bit 57 = output off
*d pftext.290
*                            bits 42-56 unused
*/ end pftext
*/
*deck main
*i main.1669
          sx2    x1-timeup
          zr     x2,pkeyp1
          sx2    x1-catchup
          zr     x2,pkeyp1
          sx2    x1-timeup
          mi     x2,pkeyp0   if keyset key
          eq     pkeyp1      all others leave xofbut alone
          sx2    x1-400b
          mi     x2,pkeyp1
          sx2    x1-3400b
          mi     x2,pkeyp0
          sx2    x1-3500
          mi     x2,pkeyp1
 pkeyp0   sa2    bankadd
          mx6    1
          lx6    xofbit      position to *xoff* bit
          bx6    -x6*x2      clear *xoff*
          sa6    a2
 pkeyp1   bss    0
*i main.1774
*
* check for *xofkey* and *xonkey*
*
          sx2    x1-xofkey
          zr     x2,xpxoff   if -xofkey-
          sx2    x1-xonkey
          zr     x2,xpxon    if -xonkey-
*i main.1903
*
 xpxoff   sa2    bankadd
          mx6    1
          lx6    xofbit      position to *xoff* bit
          bx6    x6+x2       set *xoff*
          sa6    a2
          eq     xpkey2      write back station bank
*
 xpxon    sa2    bankadd
          mx6    1
          lx6    xofbit      position to *xoff* bit
          bx6    -x6*x2      clear *xoff*
          sa6    a2
          eq     xpkey       process further to restart output
*/ end main
*/
*deck logicx
*i logicx.864
          sa1    bankadd
          lx1    60-xofbit
          mi     x1,jpe200   if *xoff* in effect
*/ end logicx
*/
*deck tutorx
*i xkreorg.369
          sa1    bankadd
          lx1    60-xofbit
          mi     x1,tfinoo   if *xoff* in effect
*i xkreorg.427
          sx2    x1-xonkey   check for *xon* key
          zr     x2,tfinp1
*i xkreorg.444
          sa1    bankadd
          lx1    60-xofbit
          mi     x1,tfinoo   if *xoff* in effect
*d xkreorg.463
 tfinoo   sb1    -1          -1 = wait for key
*/end tutorx
*/
*deck mainov
*i mainov.290
          mx1    1
          lx1    xofbit      position to *xoff* bit
          bx6    -x1*x6      clear *xoff*
*/end mainov
* /---   block=10-c dd60hlp              2024/06/22. 21:03    source 
*/ --------------------------------------------------------
*/ fix right screen display for console.
*/ --------------------------------------------------------
*ident dd60hlp
*deck dd60
*d dd60.1179,dd60.1181
,,    .    (    ))
*/ end dd60
* /---   block=10-d blkeras              2024/06/22. 21:04    source 
*/ --------------------------------------------------------
*/ remove filler nop*s after block erase for ppt terminals.
*/ --------------------------------------------------------
*ident blkeras
*deck fovlay4
*d fovlay4.577,fovlay4.591
*d fovlay4.593,fovlay4.601
*d fovlay4.628,fovlay4.633
*d fovlay4.635,fovlay4.638
*d fovlay4.1372,fovlay4.1410
          eq     outloop
* /---   block=10-e dterase              2024/06/22. 21:05    source 
*/ --------------------------------------------------------
*/ send nop code with data 2 to indicate output has been aborted
*/ (for -erase abort- and stop key).  that allows pterm to discard
*/ buffered output.  there can be a lot of that when it is processing
*/ -delay- nops or other timed data.
*/ --------------------------------------------------------
*ident dterase
*deck putilty
*i putilty.276
          sx7    2
          packwrd x7         send *abort output* pterm nop
*/ end putilty
* /---   block=10-f bdspsdm              2024/06/22. 21:06    source  out
*/ --------------------------------------------------------
*/ remove check for sdm= entry point in b display retrieval
*/ --------------------------------------------------------
*ident bdspsdm
*deck mrq1
*d mrq1.2683,mrq1.2684
*d mrq1.2937,mrq1.2949
*d mrq1.2985,mrq1.2986
*/ end mrq1
* /---   block=10-g cfo                  2024/06/22. 21:10    source  out
*/ reinstate the "cfo type-in" mrq request, so chess4p2 will work.
*ident cfo
*deck plasmrq
*i plasmrq.39
 mr.jcfo  equ    21          enter cfo type-in
*/ end plasmrq
*/
*deck mastor
*d mastor.2234
 mrqreq   bssz   6           *mrq* request area
*deck mastor2
*i mastor2.629
          sa1    param4
          bx6    x1
          sa6    mrqreq+3
          sa1    param5
          bx6    x1
          sa6    mrqreq+4
          sa1    param6
          bx6    x1
          sa6    mrqreq+5
*i mastor2.659
+         vfd    48/0lcfo,12/mr.jcfo
*/ end mastor2
*/
*deck mrq
*i mrq.147
*         request type = 21 = enter cfo message
*         12/21, 36/0, 12/0
*         42/job name, 18/0
*         60/msg
*         60/msg
*         60/msg
*         36/msg, 24/0
*
*i mrq.508
          reqtab jmact,0,1     21 = enter cfo type-in
*d mrq.511
*i mrq.512
 .nosv2   endif
*/ end mrq
*/
*deck mrq1
*d mrq1.4807
*                   20 = purge queue file (nos 1 only)
*                   21 = enter cfo type-in (nos 2 only)
*d mrq1.4814
          sbn    2
          mjn    *+3         if abort or cfo
*i mrq1.4839
 
          ldm    ii
          njn    jma200      cfo type-in
*i mrq1.4852
 
*
*         enter cfo type-in for specified job
*
 
 jma200   ldd    cn+4        pick up job status
          lpn    76b
          lmn    /ejt/exjs*2   check for executing
          njn    jmerr2      if not executing
          ldn    4
          std    d.t0
          rjm    loadppw     get address of request word
          adn    2           point to the typein data
          crm    cfobuf,d.t0 read four words of typein data
          sfa    ejt,cm+2    compute addr of ejt entry
          adk    sche        plus bias for scheduling data
          crd    cn
          ldd    cn+3        get cp number
          shn    7
          adn    flsw
          crd    cm          read ra from cp area
          ldd    cm+3
          shn    6
          adn    ccdr        form address of cfo area
          cwm    cfobuf,d.t0 write cfo message
          ldd    cm+3
          shn    6
          crd    cn          read job ra+0
          ldd    cn+3
          lpc    -5          clear cfo and pause bits
          std    cn+3
          ldd    cm+3
          shn    6
          cwd    cn          rewrite ra+0 for job
          ujp    mrqrx       success
 
 cfobuf   bss    4*5         space for cfo data (36 chars max)
*/ end mrq1
* /---   block=11-a bigkeys              2024/06/23. 08:34    source 
*/ --------------------------------------------------------
*/ make the key buffer larger and parameterize things right to get
*/ rid of hardwired constant offsets.
*/
*/ the old key buffer layout goes like this
*/        vfd    12/key0, 12/key1, 12/key2, 12/key3, 12/ppuindex
*/        vfd    36/ , 12/stop1code, 12/cpuindex
*/ and the offsets to the index fields (cpu offsets 0 and 1, ppu
*/ offsets 4 and 9) were written as simple numbers.  for that matter
*/ the wraparound was by masking the index with literal 3... and the
*/ size of the keybuf entry was handled as hardwired 2 via a shift of 1.
*/
*/ the new code does everything symbolically.  all you have to do to
*/ change the key buffer size is to specify a new value for nkeyshf.
*/ (the key buffer size is a power of two, nkeyshf is that power.)
*/ --------------------------------------------------------
*ident bigkeys
*/
*/ the symbol definitions come first, then the actual code.
*/
*deck syscon
*i syscon.72
*
*         key buffer length related parameters.
*         these were formerly defined in polls and several other
*         plato source files.
 
 nkeyshf  equ    3           station shift count to address key buffer
 
* derived values
 
 mkeyshf  decmic nkeyshf
 nkeylth  equ    1s"mkeyshf" length of key input buffer (cp words)
 pkeylth  equ    nkeylth*5   length of key input buffer (pp words)
 nkcpidx  equ    nkeylth-1   cp offset to word with cp index
 pkcpidx  equ    pkeylth-1   pp offset to cp index word
 pkstop1  equ    pkeylth-2   pp offset to stop1 and fastkey word
 nkppidx  equ    nkeylth-2   cp offset to word with pp index
 pkppidx  equ    pkeylth-6   pp offset to pp index word
 idxlim   equ    pkppidx     index limit (highest value + 1)
 
* macro for building table of cpu offset and shift given index
 
 kxmac    if     -mac,kidxtb  avoids warning in psys
 kidxtb   macro
 zzzzix   set    0
 zzzzwd   set    0
 zzzzsh   set    12
 kidxwd   dup    idxlim
          vfd    12/2000b+zzzzsh,48/zzzzwd
 zzzzsh   set    zzzzsh+12
          ifgt   zzzzsh,60,2
 zzzzsh   set    12
 zzzzwd   set    zzzzwd+1
 kidxwd   endd
 kidxtb   endm
 kxmac    endif
* /---   block=11-b bigkeys              2024/06/22. 21:20    source 
*/
*/ now the code changes
*/
*deck pftext
*d pftext.67
*/ end pftext
*/
*deck pio
*d pio.81
 keybshf  equ    nkeyshf       shift for key buffer dimension
*d pio.772
          ldn    pkeylth
*d pio.781
          ldm    ecsbuff+pkstop1  get stop1 code
*d pio.866
          ldm    ecsbuff+pkstop1  first check for stop1
*d pio.925
          ldn    pkeylth
*d pio.930,pio.931
 kyo210   ldm    ecsbuff+pkppidx  ppu index in key buffer
          sbm    ecsbuff+pkcpidx  cpu index in key buffer
*d pio.934
          adc    idxlim      adjust for wrap
*d pio.936
 kyo220   lmn    idxlim-1    check for index limit
*d pio.938
          ldm    ecsbuff+pkstop1  load -stop1- key value
*d pio.942
*d pio.947,pio.949
 kyo225   aom    ecsbuff+pkppidx  increment ppu key buffer index
          lmn    idxlim      check for wrap
          njn    kyo227      if not wrap
          stm    ecsbuff+pkppidx  wrap back to start of buffer
 kyo227   ldm    ecsbuff+pkppidx
          std    d.t4        set keybuf offset
*d pio.952
*/ ideally we would write just the one word that changed, but that
*/ involves a divide by 5 so we do not bother for now.
          ldn    pkeylth-5   d.t3 = number words to write
*d pio.1874
 ecsbsz   max    pkeylth,10
 ecsbuff  bss    ecsbsz      buffer for ecs read/write
*/ end pio
*/
*deck dd60
*d dd60.568
 kb2a     bssz   nkeylth     key buffer
*d dd60.644,dd60.648
          sx0    x4+lstud*nkeylth
+         re     nkeylth
-         rj     ecsprty
          sa3    a0+nkppidx  get ppu index word
          sa4    a0+nkcpidx  get cpu index word
*d dd60.652,dd60.653
          sx6    x6+1        increment pp index
*d dd60.655,dd60.662
          sb6    x6-idxlim
          mi     b6,kbi1     if not time to wrap
          sx6    0           wrap to start
 kbi1     bx7    x6-x0       check against cp index
          zr     x7,kbix     no room, exit
          bx7    x5*x3       get rest of word with pp index
          bx7    x7+x6       merge updated index
          sa7    a3          update pp index word
          sa3    x6+kidxtb   read word and shift for this index
          ux3,b7 x3
          sa3    x3+kb2a     fetch the right word
*d dd60.669,dd60.674
          sa6    a3
*d dd60.676,dd60.677
          sx0    x4+lstud*nkeylth
+         we     nkeylth-1   write ecs keybuf except for cpu index word
*i dd60.682
 
 kidxtb   kidxtb
*/ end dd60
* /---   block=11-c bigkeys              2024/06/23. 09:10    source 
*/
*deck msubs
*d msubs.293
          sx3    nkeylth     number of words per key buffer.
*d msubs.297
+         we     nkeylth     write out new buffer
*d msubs.477
 iiikey   bssz   nkeylth-1
*d msubs.2054
          sx7    nkeylth
*/ end msubs
*/
*deck polls
*d polls.12,polls.25
*d polls.64,polls.70
*    word 0    12 / key 0
*              12 / key 1
*              12 / key 2
*              12 / key 3
*              12 / key 4
*    ... ditto words 1 .. n-2
*
*    word n-1  12 / key k-3
*              12 / key k-2
*              12 / key k-1
*              12 / key k
*              12 / ppu key pointer
*
*    word n    36 / time and press key information
*i polls.79
*    where n is (1 $cls$ nkeyshf) - 1.
*d polls.279
          sa2    a0+nkppidx  x2 = key storage word (and ppu key index)
          sa4    a0+nkcpidx  x4 = cpu key word
*d polls.281
*d polls.362
          sx7    x5-idxlim   test for index limit
          mi     x7,notimw   if not wrap
          sx5    0           wrap back to start of buffer
 notimw   sa1    stflag1     test for new-type key processing
*d polls.369,polls.376
 notima   sa2    x5+kidxtb   read word and shift for this index
          ux2,b2 x2
          sa2    x2+keyinfo  fetch the right word
          lx6    x2,b2       shift key into bottom 12 bits
*i polls.383
          sx7    x5-idxlim   test for buffer wrap
          mi     x7,notima   if not wrap
          sx5    0           wrap back to start of buffer
*d polls.391,polls.398
          sa2    x5+kidxtb   read word and shift for this index
          ux2,b2 x2
          sa2    x2+keyinfo  fetch the right word
          lx6    x2,b2       shift key into bottom 12 bits
*d polls.457
 retcp    sx1    nkcpidx     offset to cpu index
*d pollrwx.14
          sa1    a0+nkcpidx  updated cpu key index word
*i polls.480
 
 kidxtb   kidxtb
*d polls.503,polls.504
          sa1    a0+nkppidx  ppu key word
          sa2    a0+nkcpidx  cpu key word
*d uq9600.21,uq9600.22
          sa1    a0+nkppidx  ppu key word
          sa2    a0+nkcpidx  cpu key word
*i uq9600.25
          pl     x6,keycnt   if no wrap
          sx6    x6+idxlim   adjust count for wrapped index
*d polls.570
          sa2    a0+nkcpidx  x2 = cpu key word
*d pollrwx.17
          sx1    nkcpidx     offset to cpu index
*d polls.1041
          sa1    keyinfo+nkcpidx  (x1) = cpu key buffer word
* /---   block=11-d bigkeys              2024/06/22. 21:29    source 
*d polls.1053
          sx1    nkcpidx     offset to cpu index
*d polls.1168
          sa5    a0+nkcpidx  x5 = cp word of buffer
*d pollrwx.40
          sx4    nkcpidx     offset to cpu index
*d polls.1232
          sa1    a0+nkppidx  load ppu key buffer word
*d polls.1234
          sa2    a0+nkcpidx  load cpu key buffer word
*d polls.1266
          we     nkeylth
*d polls.1269
          re     nkeylth
*d polls.1273
 iiikey   bssz   nkeylth-1
*/ end polls
*/
*deck exec6
*d exec6.4158
          sa1    a0+nkcpidx  x1 = cpu index word of keybuffer
*d exec6.4163
          sx1    nkcpidx     offset to cpu index
*d exec6.4165,exec6.4166
          sa0    a0+nkcpidx
+         we     1           write it back to ecs
*d exec6.4292
          sa1    a0+nkcpidx  x1 = cpu index word of keybuffer
*d exec6.4297
          sx1    nkcpidx     offset to cpu index
*d exec6.4299,exec6.4300
          sa0    a0+nkcpidx
+         we     1           write it back to ecs
*d exec6.4320,exec6.4322
*d exec6.4327
 fkkeybf  ovdata nkeylth
*/ end exec6
*deck pni2
*d jbfkey.154
          lx1    /plat/nkeyshf
*d jbfkey.156,jbfkey.157
          sa0    cmkbuf      address of cm copy of key buffer
          re     /plat/nkeylth read key buffer entry
*d jbfkey.159,jbfkey.160
          sa1    a0+/plat/nkppidx  net key word
          sa3    a0+/plat/nkcpidx  cpu key word
*d jbfkey.164,jbfkey.167
          sb6    x3-/plat/idxlim
          mi     b6,sky9     if not time to wrap
          sx3    0           wrap to start
 sky9     bx6    x3-x4       check against cpu index
*d jbfkey.172,pnirwx.24
          bx6    x7*x1       get rest of word with net index
          bx6    x6+x3       merge updated index
          sa6    a1          update net index word
          sa3    x3+kidxtb   read word and shift for this index
          ux3,b6 x3
          sa3    x3+cmkbuf   fetch the right word
          lx3    b6          put the key byte to update in low byte
          bx3    x3*x7       clear it out
          bx3    x2+x3       merge the key
          sb6    b6-60
          ax6    x3,b6       rotate key word back to the way it was
          sa6    a3
+         we     /plat/nkeylth-1 write ecs keybuf except for cpu index w
-         rj     epe
*i jbfkey.219
 
 cmkbuf   bss    /plat/nkeylth
 
 kidxtb   bss    0
          qual   plat
          kidxtb
          qual   *
 
*/ end pni2
*/
* /---   block=11-e sxtchw               2025/05/07. 17:38    source 
*ident sxtchw
*/ 04/30/2025 'w'n's
*/ add cybil callable function to stuff a word into xtouchw
*/ in the station bank in 'p'n'i2
*deck pni2
*i jbfgt.58
**        sxtch - store *xtouchw* in station bank
*         entry - (x1) = connection number (station)
*                 (x2) = address of xtouchw record
*         exit - (x6) = 0 if unable to store (false) 
*                       -1 if xtouchw stored (true)
 sxtch    entr   2
          bx6    x6-x6
          sa3    platoi
          zr     x3,sxtch2   if plato not initialized
          sa3    afb
          zr     x3,sxtch2   if no plato connection
          sx3    /plat/psyslth
          ix0    x1*x3       sta bank for cn
          sa3    ast         address of station banks
          ix0    x0+x3       add fwa of station bank
          bx4    x0          save sta bank pointer for cn
*         make sure this is the correct station bank
          sx3    /plat/stflags-/plat/ststart
          ix0    x0+x3       stflags for this cn
          rx3    x0          (-rxx- 1 wd read, may chg *a3*)
          sx3    x3
          ix3    x1-x3
          nz     x3,sxtch2   not sta bank for this cn
*         stuff *xtouchw*
          sx3    /plat/xtouchw-/plat/ststart
          ix0    x4+x3       xtouchw for this cn
          sa3    x2          fetch xtouchw
          bx6    x3          copy new xtouchw verbatim
          wx6    x0          (-wxx- 1 wd write, may chg *a6*)
          sx6    -1
 sxtch2   done
