home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / mdos / 80column_funnelweb / psrv.txt < prev    next >
Text File  |  2006-10-19  |  20KB  |  466 lines

  1.         
  2.         
  3.         
  4.                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  5.                 FUNNELWEB - PROGRAM SERVICES for ASSEMBLY USAGE 
  6.                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  7.         
  8.                               Version  4.40                     
  9.                              -------------
  10.         
  11.         
  12.              The FUNNELWEB system is held together by a reference block
  13.         at the top of high memory.  This has grown somewhat haphazardly
  14.         over the years, but at this stage of the history of the TI 99/4a
  15.         computer, plans for complete tidying up and revision have been
  16.         shelved although almost all functional improvements, and more,
  17.         previously intended for that grand revision have now been
  18.         incorporated in Vn 4.40 of FUNNELWEB.  
  19.         
  20.              The information and facilities available include BLWP
  21.         vectors for a variety of services, indirect BL routine pointers,
  22.         and various data, pointer, and flag words and bytes.
  23.         Specifications of various useful BLWP and BL routines and
  24.         associated data/flag items follow.  Some others, mostly data and
  25.         flags, are specified in FWDOC/REPT.   The XOP instruction is
  26.         poorly supported on the 99/4a, and is left for application
  27.         programs to use.  
  28.         
  29.         
  30.         (A)  BLWP UTILITY ROUTINE VECTORS 
  31.         ~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  32.         
  33.            
  34.          (1)  DSRLNK EQU  >FFD4 
  35.          ---  ----------------- 
  36.            
  37.              This provides a bare-bones DSRLNK function equivalent to
  38.         that in the TI-Writer Editor but corrected to be compatible with
  39.         multiple RS232 cards.  It is for file access only and does NOT
  40.         take a following DATA 8 or DATA >A instruction.  This seemed
  41.         like a good idea in pre-historic times when FUNNELWEB was only a
  42.         TI-Writer interface and has stuck for reasons of consistency
  43.         ever since.  Never mind, this sort of thing happens all the time
  44.         - MS-DOS still smells like CP/M and Intel's i486 microprocessor
  45.         still suffers gigantic hangovers fron the 8080.  
  46.            
  47.              After the usual setup of a PAB in VDP and PAB pointer in
  48.         PAD, call the DSRLNK as 
  49.            
  50.                    BLWP @DSRLNK              
  51.                    JEQ  error handler        
  52.                    ..                        
  53.            
  54.              Further error trapping from the PAB error bits and GPL
  55.         status is up to the programmer.  FUNNELWEB utilities regularly
  56.         use this DSRLNK for subprogram access by the code sequence
  57.            
  58.             DSRTYP EQU  >7A                  
  59.                                              
  60.                    MOV  @DSRLNK+2,R11        
  61.                    INCT @DSRTYP(R11)         
  62.                    BLWP @DSRLNK              
  63.                    JEQ  DSERR                
  64.                                              
  65.                    DECT @DSRTYP(R11)         
  66.                    success exit              
  67.            
  68.             DSERR  DECT @DSRTYP(R11)         
  69.                    failure exit              
  70.            
  71.              The offset value DSRTYP will be maintained at this value.
  72.         All exits must restore the offset value correctly.  
  73.            
  74.            
  75.          (2)  KSCANA EQU  >FFD0     
  76.          ---  -----------------     
  77.              
  78.              This is an enhanced KSCAN routine which may be used in
  79.         place of the normal E/A utility.  It provides some extra
  80.         functions transparently by setting processor status bits, which
  81.         may then be tested by various conditional Jump instructions as
  82.         required.  There are 6 condition bits available, and the tests
  83.         check these separately.  
  84.            
  85.                    BLWP @KSCANA 
  86.                    JNC -->> <escape> --> Jump 
  87.                    JOP -->> <No Key> --> Jump 
  88.                    JNO -->> <Proc'd> --> Jump 
  89.                    JEQ -->> <OldKey> --> Jump 
  90.                    JGT -->> <Enter>  --> Jump 
  91.                    JH  -->> <Redo>   --> Jump (New key only) 
  92.            
  93.              <Escape> senses both <fctn-9> and <ctrl-C>, and <proceed>
  94.         checks both <fctn-6> and <ctrl-A>.   Finally an unconditional
  95.         JMP may be used to loop on the keyscan after one or more other
  96.         tests.  
  97.            
  98.            
  99.          (3)  FILENT EQU  >FFCC      
  100.          ---  -----------------      
  101.         
  102.              This provides a single line Editor typically used for entry
  103.         of file and device names, and may be used in text mode as well
  104.         from Vn 4.40 onwards.  The flashing cursor has auto-repeat with
  105.         acceleration, and the timing parameters are set on entry to
  106.         FUNNELWEB.  Editing keys are as described for filename entry.
  107.         FILENT waits on entry until the previous key is released.
  108.         Typical calling sequence is 
  109.         
  110.                    BLWP @FILENT       
  111.                    DATA <scrpos>      
  112.                    BYTE <init offset> 
  113.                    BYTE <length>      
  114.         
  115.              The initial offset gives the initial position of the cursor
  116.         in the entry window, with null being the first position.  The
  117.         CPU buffer is assigned after entry to the routine, immediately
  118.         following the workspace.  The workspace is at >8302 in the PAD
  119.         area, so the maximum buffer length can extend at most to the end
  120.         of the DSR transient area.  A calling sequence that allows
  121.         another workspace/buffer area to be assigned is 
  122.         
  123.                 BLWP @FWFILN        
  124.                 DATA <scrpos>       
  125.                 DATA <ofs,len>      
  126.                 ..                  
  127.         
  128.          FILNT  EQU  $
  129.                 MOV  @FILENT+2,R11  FILENT code pointer in R11       
  130.                 RT                  Return via FILENT RTWP           
  131.         
  132.          FWFILN DATA FEWSP,FILNT     User "FILENT" BLWP vector 
  133.          FEWSP  BSS  >20             New workspace             
  134.          FILBFR BSS  <as needed>     Follows new workspace     
  135.         
  136.              This is a lot simpler than writing your own routine, and
  137.         may be necessary if you are already using the PAD area.  Several
  138.         auxiliary flag locations are associated with use of FILENT.  
  139.         
  140.              LOWCAS EQU >FF22    Lower case allowed 
  141.              HEXDIG EQU >FF24    HEX digits only    
  142.              ESFLAG EQU >FF60    <escape> flag/pointer 
  143.         
  144.         
  145.              When LOWCAS is null, the normal condition, all entries are
  146.         converted to upper case as in the Editor SF/LF.  FILENT always
  147.         resets LOWCAS to null on exit.  SETO of LOWCAS before calling
  148.         FILENT allows lower case alpha characters to slip through.  If
  149.         HEXDIG is set before entry only valid hex digits can be entered
  150.         and deletes produce "0" instead of blanks.  Write a valid hex
  151.         entry on the screen first as this is not checked. 
  152.         
  153.              If ESFLAG is null then the <escape> key is ignored
  154.         internally and the key value passed out.  SETO of ESFLAG is
  155.         reserved for internal purposes.  Any other value is treated as
  156.         an <escape> address pointer.  First instruction in the <esc>
  157.         routine should be a LWPI as the <esc> sensing occurs in the
  158.         internal CURSOR (see later) routine and will exit with the
  159.         FILENT registers set. 
  160.         
  161.         
  162.          (4)  DELSPR EQU  >FFC8   
  163.          ---  -----------------   
  164.         
  165.              This one just writes byte >D0 to VDP memory at >300 to shut
  166.         off the sprite list in Graphics mode I with normal E/A table
  167.         positions.  It is useful in quick cleanups after switching back
  168.         from Text mode.  Just call as is.  
  169.         
  170.         
  171.          (5)  VMBWD  EQU  >FFBA   
  172.          ---  -----------------   
  173.         
  174.              VMBWD gives a VMBW function from in-line data, which saves
  175.         program space when using fixed value data.  Null length is just
  176.         ignored.  Call as 
  177.         
  178.                 BLWP @VMBWD       
  179.                 DATA <scrpos>     
  180.                 DATA <CPU data>   
  181.                 DATA <length>     
  182.         
  183.              The primary FUNNELWEB workspace is at >FF7C, and R9 of this
  184.         workspace always points to VMBWD so that it may be called from
  185.         this workspace as BLWP *R9 making a 4 word total call. 
  186.         
  187.         
  188.          (6)  VMBRD  EQU  >FFB6  
  189.          ---  -----------------  
  190.         
  191.              This is the VDP read version and is essentially similar to
  192.         VMBWD.
  193.         
  194.         
  195.          (7)  VSBRD  EQU  >FFB2  
  196.          ---  -----------------  
  197.         
  198.              The calling sequence for this is 
  199.         
  200.                 BLWP @VSBRD      
  201.                 DATA <scrpos>    
  202.         
  203.         and it returns the byte in VDP memory at <scrpos> to the MSB of
  204.         R0 (not the usual R1 in E/A code).  
  205.         
  206.         
  207.          (8)  VFILL  EQU  >FFAE  
  208.          ---  -----------------  
  209.         
  210.              This fills a block of VDP RAM with the byte value in the
  211.         MSB of R0.  The FUNNELWEB main workspace FWREGS EQU >FF7C
  212.         maintains R8 as a pointer to this so that it may be called as
  213.         BLWP *R8 etc.  Standard calling sequence is 
  214.         
  215.                LI   R0,<MSB value> 
  216.                BLWP @VFILL         
  217.                DATA <scrpos>       
  218.                DATA <length>       
  219.         
  220.         
  221.          (9)  VMBWR  EQU  >FED4   
  222.          (10) VMBRR  EQU  >FED0   
  223.          (11) VSBWR  EQU  >FECC   
  224.          (12) VSBRR  EQU  >FEC8   
  225.          ---- -----------------   
  226.         
  227.              This bunch of VDP utilities is equivalent to the standard
  228.         E/A utility set in usage.  The VM routines check for and ignore
  229.         null length values in R2. 
  230.         
  231.         
  232.          (13) VSTRW  EQU  >FEC4   
  233.          ---- -----------------   
  234.         
  235.              This writes the body of a string with leading length byte
  236.         to VDP.  Call as 
  237.         
  238.                LI   R0,<string ptr> 
  239.                BLWP @VSTRW          
  240.                DATA <scrpos>        
  241.         
  242.              If the length byte of the string is null then the call is
  243.         ignored.  
  244.         
  245.         
  246.          (14) CURSOR EQU  >FEC0   
  247.          ---- -----------------   
  248.         
  249.              The CURSOR routine is called internally by FILENT, but may
  250.         also be called externally.  The calling sequence is 
  251.         
  252.                LI   R6,<scrpos>   
  253.                BLWP @CURSOR       
  254.         
  255.              CURSOR flashes at the screen position specified in the
  256.         calling R6, and returns the key-value in the MSB of the calling
  257.         R2, and this is left in raw state at console KEYRT (>8375) .
  258.         See FILENT for a discussion of <escape>.  Normally CURSOR
  259.         provides the up-case function for FILENT, so the LOWCAS flag is
  260.         effective here also.  It is not cleared however except by the
  261.         <escape> path.  If you want to use CURSOR externally with hex
  262.         digit validation, you will need to supply your own validation
  263.         routine.  A table of hex digits "01..EF" is provided at 
  264.         
  265.              HXTAB  EQU  >FEA4 
  266.         
  267.              The cursor flash rate and auto-delays are slaved indirectly
  268.         to the VDP vertical interrupt rate.  On entry to FUNNELWEB the
  269.         number of console keyscans that occur in an interval of 14
  270.         vertical interrupts is counted and stored at  
  271.         
  272.              REPETS EQU  >FEE4     
  273.         
  274.              This does not account for the difference between PAL and
  275.         NTSC consoles, but this will be minor compared to possible
  276.         Geneve to 99/4a difference. 
  277.         
  278.         
  279.          (14) DSRREN EQU  >FEBC  
  280.          ---- -----------------  
  281.         
  282.               DSRREN is intended to give a direct DSR re-entry from
  283.         saved values, as is done in the E/A object loader, or more
  284.         comprehensively in LINEHUNTER.  It re-enters the last DSR ROM at
  285.         the same entry point directly without having to search for it.
  286.         All PAB information necessary after this DSR entry must be
  287.         supplied as normal.  It is used in DiskReview (80-col) as the
  288.         new speedup for Vn 4.40 of the Myart file viewer.  It is of
  289.         course not necessary to set the DSRTYP again for sub-program
  290.         (eg sector read) re-entry as this is only needed to find the
  291.         entry point in the original search.  
  292.         
  293.              The relevant DSR values are stored in a 4 word block
  294.         starting at 
  295.         
  296.              SAVENT EQU >FF46 
  297.         
  298.         on every full DSRLNK call.  
  299.         
  300.         
  301.          (15) QDCODE EQU  >FEB8   
  302.          ---- -----------------   
  303.         
  304.              This is mostly of use internally after the AID key has been
  305.         detected in the path with SETO of ESFLAG (>FF60).  It checks the
  306.         value at AIDFL (>FF3A) and if null returns directly, else it
  307.         branches to the address pointed to by AIDFL.  Usually this is a
  308.         QD test/load/branch routine. 
  309.         
  310.         
  311.          (16) SETGRD EQU  >FEB4  
  312.          ---- -----------------  
  313.         
  314.              This sets the GROM address using the system GROM pointer in
  315.         GPL R13, so that Module Library banking is supported.  Call as 
  316.         
  317.               LI   R0,<grom address>  
  318.               BLWP @SETGRD            
  319.         
  320.         
  321.         (B)   INDIRECT BL ROUTINE POINTERS 
  322.         ~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  323.         
  324.              All of these routines are conveniently called by 
  325.         
  326.               MOV  @BLPTR,R11  
  327.               BL   *R11        
  328.         
  329.         together with whatever register and/or in-line data is
  330.         appropriate for the particular BL call. 
  331.         
  332.         
  333.          (1)  CFILE# EQU  >FFA6        Uses R0,R1 
  334.          ---  ----------------- 
  335.         
  336.         This takes a trailing DATA item >0n00 where "n" is the number of
  337.         file buffers to be set aside in VDP as would be done with CALL
  338.         FILES(n) from BASIC.  The routine is compatible with V-9938
  339.         based systems, and rewrites MAXMEM (>8370) to suit.  A new VDP
  340.         header is written for TI/CorComp disk controllers and VDP
  341.         cleared above that to the top of the disk DSR area.  No range
  342.         checking is done on "n".  
  343.         
  344.         
  345.          (2)  KEY    EQU  >FFA4         Uses R2  
  346.          ---  -----------------  
  347.         
  348.              This keyloop enables interrupts, follows the previous
  349.         prescription for <escape> and ESFLAG (>FF60), and calls QDCODE
  350.         if AID is pressed.  The key return is placed in the MSB of R2
  351.         and left unchanged at KEYRT (>8375).  
  352.         
  353.         
  354.          (3)  RESTR  EQU  >FFA2        Uses  R0.R1,R15  
  355.          ---  -----------------   
  356.         
  357.              This does various housekeeping tasks to set up the E/A
  358.         Graphics I mode for the FUNNELWEB Central Menu screen.  It
  359.         resets the VDP registers to E/A default, rewrites the color
  360.         table, clears the screen, calls DELSPR, restores the CHR(>81)
  361.         pattern to underline, and restores the key-unit to 5.  
  362.         
  363.         
  364.          (4)  RDDEV  EQU  >FFA0        Uses R0,R1,R2,R3  
  365.          ---  -----------------  
  366.         
  367.              The RDDEV routine handles the details after screen entry
  368.         of a file or device name, saving the device name to CPU RAM, and
  369.         building a PAB in VDP for DSRLNK.  RDDEV is called externally as 
  370.         
  371.                MOV  @RDDEV,R11       Get pointer   
  372.                BL   *R11             Go to routine 
  373.                DATA <screen ptr>     Entry pointer on screen 
  374.                DATA <cpu ram bfr>    CPU RAM buffer for name 
  375.                DATA <vdp PAB adr>    VDP address for PAB     
  376.                DATA <cpu PAB data>   PAB data storage address 
  377.                ..                    
  378.         
  379.              The first data item is the VDP pointer for the filename as
  380.         entered on screen.  RDDEV parses this up to the first space and
  381.         enters it with leading length byte at the CPU RAM buffer pointed
  382.         to by the second data item.  It then builds a PAB in VDP at the
  383.         address in the third data item, using PAB data in CPU RAM
  384.         pointed to by the fourth data item.  The CPU RAM buffer may well
  385.         be a continuation of the PAB data, but need not be.  While at it
  386.         RDDEV clears the GPL status byte (>837C) and loads SCNAME
  387.         (>8356) for DSRLNK.  
  388.         
  389.         
  390.          (5)  QDLOAD  EQU  >FF3C    Uses R0,R1,R2,R10,R12  
  391.          ---  ------------------  
  392.         
  393.                System files with 2 character filenames in E/A program
  394.         file format may be loaded without executing by QDLOAD.  A
  395.         typical calling sequence is 
  396.         
  397.                MOV   @QDLOAD,R11    Get pointer  
  398.                BL    *R11           Execute      
  399.                DATA  'UL'           2-char filename 
  400.                DATA  ULPOS          Load position in CPU 
  401.                DATA  ULLEN          Load length  
  402.                JMP   <error return> 
  403.                ..                   
  404.         
  405.              Successful loads step over the error branch.  The normal
  406.         E/A header is ignored in favor of the load target position and
  407.         length.  The maximum file length allowed is >1100 which is long
  408.         enough for QD or QF.  The file is loaded from the FUNNELWEB boot
  409.         path as for other system files.  
  410.         
  411.          (4)  FILCLN  EQU  >FEDC    Uses R0,R1,R10,R14 
  412.          ---  ------------------  
  413.         
  414.                This routine cleans up the mailbox (>A000 - >A050) area,
  415.         supplying the Utility pathname if nothing starting like a valid
  416.         filename is found.  
  417.         
  418.         
  419.         (C)  DATA POINTERS  
  420.         ~~~  ~~~~~~~~~~~~~  
  421.         
  422.              Other BL routines, data, code fragments, and pointers are
  423.         for internal system use and may be subject to change in function
  424.         or auxiliary conditions.  Some not already mentioned which may
  425.         be useful are 
  426.         
  427.              NAMBUF EQU  >FF62    
  428.         
  429.              The space from NAMBUF to FWREGS (>FF7C) is used a filename
  430.         buffer by the various loaders.  It is long enough to accomodate
  431.         length byte and 25 character name (DSK.volname.filename or
  432.         whatever else fits).  Increase in this was the one change that
  433.         would have forced major incompatibilities with previous
  434.         versions, and so it has been left as is for better or for worse.  
  435.         
  436.              BTLN   EQU  >FF58    
  437.         
  438.              This points to the length byte of the boot pathname and all
  439.         references to system filenames are by offsets from this value.
  440.         The Editor printer device name, as a survival from much earlier
  441.         versions, though part of this block has its own pointer at
  442.         EDPRNT EQU >FF1E.  All these path/file and device names are
  443.         stored with leading length byte, unlike the workfile name in the
  444.         mailbox at >A000 which is stored without length byte as required
  445.         by the Editor.  
  446.         
  447.              INCOL  EQU  >FF26    
  448.         
  449.              The word value here is an index, range 0-9, into the 10
  450.         byte table of color bytes for use in VReg #7, and pointed to by
  451.         COLRS EQU >FF1C.  Standard Funnelweb system practice is always
  452.         to use this table as the source of color combinations, and to
  453.         use INCOL as index.  This helps avoid unexpected and jarring
  454.         color changes on return. 
  455.         
  456.              CPUDEL EQU  >FEE2   
  457.         
  458.              The value here estimates CPU speed as seen from normal
  459.         expansion RAM by counting a loop against the VDP interrupt
  460.         timer.  It is handy as a value for CPU delay timing of beeps and
  461.         bloops.  Use REPETS (see earlier) for keyloop timings. 
  462.         
  463.         
  464.  
  465. ÇÄÇ╬ïÉòƒ⌐│╜╟╒╒╒╒╒╒╒╒ÇôÇæÇ╦ïÉòƒ⌐│╜╟╒╒╒╒╒╒╒╒Çô
  466.