home *** CD-ROM | disk | FTP | other *** search
/ Outlet 54 / outlet-54.mgt / s3 < prev    next >
Text File  |  2021-04-18  |  20KB  |  1 lines

  1.        _084C_LD_DATA_1: put a destination pointer on the 80-byteat the end of the variables area                                        - get the length of the array on tape from the second WSheader                                                                  - add the three bytes for the initial parameters                - get the variable letter from the first WS header; thiswas specified in the BASIC                                              - call 1655 MAKE ROOM to make space at the end of the   variables area; it leaves a variables pointer just below the newspace                                                                   - move on this variables pointer                                - put in the variable letter                                    - put the length in the next two bytes                          - move the pointer on again; this is the destination forthe bytes from tape                                                     - put it in IX as the start pointer                             - set the carry flag for LOAD                                   - make a header/data index FF for data                          - jump back to LD BLOCK.                                       _0873_LD_PROG (loading a program): put a pointer on the  80-byte at the end of the variables area                                - get the length of the new program plus variables from the second WS header                                                    - stack it; it will be used more than once                      - call 19E5 RECLAIM 1 to delete from the address in 5C53PROG to the 80-byte; the address from PROG is now in DE                 - call 1655 MAKE ROOM to make a space for the new       length. The header pointer was parked in 5C5F X PTR for the     RECLAIM 1 and MAKE ROOM calls                                           - move on the pointer left by MAKE ROOM just before the space just made                                                         - get the "program only" length from the second WS      header                                                                  - add it to the MAKE ROOM pointer                               - put this address in 5C4B VARS                                 - get the hi byte of the LINE number from the second WS header                                                                  - AND it with 11000000b/C0h                                     - if the result isn't zero jump on to LD PROG 1; it musthave been 80h signalling "no LINE specified". Any LINE X with   the hi byte of X more than 00111111b, ie X more than 3FFFh/     16383d, will have this effect                                           - get the lo byte                                               - put the LINE number in 5C42 NEWPPC and zero in 5C44   NSPPC; signalling GO TO the start of that line                         _08AD_LD_PROG_1: recover the program/variables length andthe start pointer                                                       - set the carry flag; for LOAD                                  - make a header/data index FF; for data                         - jump back to LD BLOCK.                                       _08B6_ME_CONTRL: get the program/variables length from   the second header                                                       - add one                                                       - call 0030 BC SPACES to make room for the data block,  plus an end marker, in the work space; everything from tape willbe loaded into the work space, and MERGEd into the existing     program from there                                                      - put an 80-byte in the last space to mark the end              - put the start and length pointers in the correct      registers for LD BLOCK                                                  - set the carry flag for LOAD                                   - make a header/data index FF for data                          - call LD BLOCK as a subroutine; instead of exiting to  it as in the other CONTRL routines                                      - (the program/variables from tape are now in the work  space) recover the pointer to the start of the work space               - get from 5C53 PROG a BASIC pointer to the start of theprogram area.                                                          _08D2_ME_NEW_LP: read the hi byte of the line number of  the BASIC line at the work space pointer; in hi-lo format               - AND it with 11000000b/C0h                                     - if the result isn't zero jump on to ME VAR LP; the    "line number" is more than 3FFFh/16383d so it must be either the80-byte or the first variable letter.                                  _08D7_ME_OLD_LP (there are still BASIC lines to MERGE):  if the hi byte of the line in the work space doesn't match the  one in the program area jump on to ME OLD L1                            - compare the lo bytes.                                        _08DF_ME_OLD_L1: put the pointers back on the hi bytes           - if the work space line number (HL) is equal or lower  jump on to ME NEW L2; the work space line is to be MERGEd in theprogram                                                                 - (the existing line number is lower than the one in thework space) call 19B8 NEXT ONE to move the BASIC pointer on to  the start of the next existing line; leaving the work space     pointer where it is                                                     - loop back to ME OLD LP.                                      _08EB_ME_NEW_L2 (a line is to be MERGEd from the work    space): call ME ENTER; see below, after 0923 ME VAR L2                  - jump back to ME NEW LP.                                      _08F0_ME_VAR_LP (ME NEW LP jumps on to here when it findsthe first variable letter or the 80-byte in the work space):            - read the variable letter in the work space                    - if it is the 80-byte, return; all the lines and       variables have been MERGEd                                              - (a variable letter found in the work space) save the  work space pointer                                                      - get the address from 5C4B VARS as a BASIC pointer.           _08F9_ME_OLD_VP: read the variable letter in the BASIC           - if it is the 80-byte jump on to ME VAR L2; this is theend of the variables area and nothing matched                           - if it matches the variable letter in the work space   jump on to ME OLD V2.                                                  _0901_ME_OLD_V1 (no match yet): call 19B8 NEXT ONE to getthe next BASIC variable letter                                          - loop back to ME OLD VP.                                      _0909_ME_OLD_V2 (variable letter in the variables area   matching the one in the work space): AND the variable letter in the BASIC with 11100000b/E0h                                            - check the result against 01100000b/A0; the marker for long names                                                              - if it isn't a long name jump on to ME VAR L1; the     match is complete                                                       - (long names) get the work space pointer and save the  BASIC pointer.                                                         _0912_ME_OLD_V3: move on both pointers                           - check the next code of the long name                          - if they don't match jump on to ME OLD V4                      - (everything matches so far) if the hi bit of the code is zero loop back to ME OLD V3                                          - (hi bit set, the last characters of the name match)   jump on to ME VAR L1; it is the work space code which is        checked, but they must be the same, eg "hell" and "hello" aren'tcounted as matching.                                                   _091E_ME_OLD_V4 (mismatch of long names): recover the    BASIC pointer                                                           - jump back to ME OLD V1.                                      _0921_ME_VAR_L1 (the variable in BASIC is to be deleted):make a delete flag FF for ME ENTER.                                    _0923_ME_VAR_L2 (also entered from ME OLD VP when no     match of variable letters was found, with the 80-byte in the    delete flag): get the work space pointer and BASIC pointer              - increment the delete flag; making 00 for "delete", 81hfor "don't", but any non-zero value counts as "don't"                   - set the carry; for a variable MERGE                           - call ME ENTER; see just below                                 - loop back to ME VAR LP; find another variable in the  work space.                                                            _092C_ME_ENTER (formally a free-standing subroutine, but called only from ME VAR L2 with carry and from ME NEW L2 above  with NC; the carry is a line/variable "l/v" flag. In either caseZ is a delete flag, signalling that line numbers or variable    letters match, so the old l/v is to be deleted) if the delete   flag shows NZ jump straight on to ME ENT 1; no deletion                 - save the pointers and flags; 5C5F X PTR is again used as a parking lot                                                        - call 19B8 NEXT ONE to get the length of the l/v in theexisting program or variables area                                      - call 19E8 RECLAIM 2 to delete this length from the    existing BASIC                                                          - recover the pointers and flags.                              _093E_ME_ENT_1: save the BASIC pointer and flags again           - call 19B8 NEXT ONE to find the next l/v start in the  work space                                                              - save the work space pointer in 5C5F X PTR                     - save 5C53 PROG; if a line is inserted at the very     start of the program it will move 5C53 PROG on                          - if the l/v flag shows carry jump on to ME ENT 2;      variable                                                                - (program line) call 1655 MAKE ROOM to make a space forthe line_before the BASIC pointer; it is on the following line  in the program area                                                     - move on the MAKE ROOM pointer to the start of the     space just made                                                         - jump on to ME ENT 3.                                         _0955_ME_ENT_2 (variable): call 1655 MAKE ROOM to make   space for the variable_at the BASIC pointer; it is on the end ofthe variables area.                                                    _0958_ME_ENT_3: recover the work space pointer, the      length of the l/v in the work space, and 5C53 PROG                      - copy the l/v from the work space to the BASIC pointer;leaving the BASIC pointer just after the end of the new l/v             - get back the work space pointer and length                    - save the BASIC pointer                                        - call 19E8 RECLAIM 2 to delete the l/v from the work   space; the routine clears the work space as it goes, keeping thedanger of memory overflow to a minimum, but the 80-byte end     marker remains, to be cleared by the call to 16BF SET WORK at   1B29 STMT L 1 in the statement loop                                     - recover the BASIC pointer and return; to ME NEW L2 or ME VAR L2.                                                             _0970_SA_CONTRL (the jump to here was from 075A SA ALL): call 1601 CHAN OPEN with stream minus 3 to open channel K               - call 0C0A PO MSG to print the "Start tape ..." messagein the lower screen                                                     - set bit 5 of TV FLAG; "clear the lower screen"                - call 15D4 WAIT KEY to wait for any key to be pressed; there is no check for BREAK                                             - save the header pointer                                       - make a length counter; 11h bytes for a header                 - make a header/data index 00 for a header                      - call 04C2 SA BYTES to save the header                         - recover the header pointer                                    - make a delay counter for 32h/50d HALTs.                      _0991_SA_1_SEC: HALT                                             - loop back to SA 1 SEC till the counter goes to zero;  one second                                                              - (pause finished) get the length of the data block fromthe WS header                                                           - make a header/data index FF for a data block                  - recover the start pointer for the data block                  - exit into SA BYTES.                                          Exit: RETs from LD BLOCK and ME VAR LP will be to 1B76   STMT LOOP                                                               - the RET from ME ENT 3 is an internal RET, staying     within the routine                                                      - into 04C2 SA BYTES from SA CONTRL, which again will   RET to 1B76 STMT LOOP.                                                 Output parameters: none.                                        Rems:                                                            Introduction 17d byte header describes following block          04C2 SA BYTES signalled by 00 flag in A register                04F2 SA SYNC 2 flag is first byte saved                         0556 LD BYTES loads header, later file                          058F LD SYNC loads or verifies header                           05B3 LD FLAG type must match first byte on tape                 0605 SAVE ETC constructing the header                           068F SA V TYPE puts type flag in header area                    06A0 SA SCR$ length and start for SCREEN$ in header area        06F9 SA CODE 4 length and start for CODE in header area         0710 SA TYPE 3 enters type for CODE/SCREEN$                     073A SA TYPE 0 length and start for PROG in header area         075A SA ALL ready to copy header from tape                      0767 LD LOOK H finds a header on tape and loads it              078A LD TYPE only types 00, 01, 02, 03 accepted                 07AD LD CH PR name checks with name required                    07CB VR CONTRL checks length from header                        07E5 VR CONT 1 start - use header if zero specified             0808 LD CONTRL length from header for PROG or array             084C LD DATA 1 array name from header area                      0970 SA CONTRL saving header                                    294B V END mistake: SAVE ... DATA can save simple string                                                                    SAVE/LOAD blocks/header/pointer, SAVE, LOAD, VERIFY AND      MERGE COMMAND ROUTINES see 0605 SAVE ETC                                                                                           SA V NEW 0685 (0605 SAVE ETC)                                      Jumps from:                                                      0652 SA DATA                                                                                                                SA V OLD 0672 (0605 SAVE ETC)                                      Jumps from:                                                      0652 SV DATA                                                    0692 SA DATA 1                                                                                                              SA V TYPE 068F (0605 SAVE ETC)                                     Jumps from:                                                      0685 SA V NEW                                                                                                               SA 1 SEC 0991 (0605 SAVE ETC)                                      Jumps from:                                                      auto                                                           Rems:                                                            04C2 SA BYTES called from 099E (actually it is the exit                       routine)                                                                                                      SA 8 BITS 0525 (04C2 SA BYTES)                                     Jumps from:                                                      0507 SA START                                                                                                               S BIN (S DECIMAL) subroutine 268D                                   The notes call this routine by the two different names, S BIN and S DECIMAL, in different parts of the listing. There   seems to be no good reason for this.                                    Entered twice from the scanning function table at 2596  and also from 2684 S ALPHNUM if an expression is found beginningwith a digit. It is used to read an actual number from the BASICline, during syntax checking or run time.                               The number may start                                           - with a digit, and perhaps include a decimal point or anE-format exponent                                                      - with BIN                                                      - with a decimal point; see under 2F46 PF NOT E in 2DE3  PRINT FP.                                                               Numeric expressions such as variables are not read by S DECIMAL.                                                                There are two quite separate parts to the routine, one  for run time and one for syntax checking; syntax checking       inserts a number marker and the 5-byte FP form of the number    after its representation in the BASIC line, run time ignores theBASIC and just reads the FP format version.                            Input parameters: none.                                         Action: if the syntax/run flag is set jump on to S STK   DEC; run time                                                           - (syntax checking) call 2C9B DEC TO FP to put the      number in FP form on the calculator stack                               - make a pointer to the BASIC after the number                  - make a length byte 06                                         - call 1655 MAKE ROOM to put six spaces in the BASIC    line                                                                    - put the number marker 0E in the first space                   - copy the FP form off the stack into the remaining five        - call 0077 TEMP PTR1 to put the address just after the FP form in 5C5D CH ADD                                                  - exit to 26C3 S NUMERIC.                                      _26B5_S_STK_DEC (run time) make a BASIC pointer to the   first code of the number.                                              _26B6_S_SD_SKIP: move on the pointer                             - if the code at the pointer is not 0D number marker    loop back to S SD SKIP                                                  - (number marker found) move the pointer on to the firstbyte of the FP form                                                     - call 33B4 STACK NUM to read the FP form on to the     calculator stack                                                        - put the BASIC pointer in 5C5D CH ADD; STACK NUM leavesit on the byte following the FP form.                                  Exit: into 26C3 S NUMERIC either from S DECIMAL or S SD  SKIP; this signals "numeric result" and exits back into the     SCANNING loop.