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

  1.         1B6F SEPARATOR checks for presence of separator                                                                             Table of syntax parameters 1A7A see syntax offset table     above                                                                                                                               Table of tokens 0095                                                A message table, similar to the report messages table,  see above, and similarly read by 0C41 PO SEARCH from 0C14 PO    TABLE. There are 5Bh/91d entries. In this case the first message"?" is only one character; so the table starts with a byte with one bit set, and the introductory 80-byte isn't needed.         [Actually this first message never gets used.]                          Introduction - token expansion through table                                                                                TABLE SEARCH SUBROUTINE see 0C41 PO SEARCH                                                                                      T ADDR system variable 5C74                                        Bytes: 2.                                                        Holds the address where the next item in the syntax     parameter table at 1A7A and following is to be found. See under table of syntax offsets above. Loaded from this table by 1B52   SCAN LOOP and incremented after each subroutine is executed by  1B55 GET PARAM. The actual jump to the address is made in 1C16  JUMP CR.                                                                Also used in 0605 SAVE ETC as a temporary store for an  operation flag indicating which of the four commands SAVE, LOAD,VERIFY or MERGE is at present being executed; the value on      entering the subroutine will have been 1AE0, 1AE1, 1AE2 or 1AE3,one more than the addresses of P SAVE etc in the syntax         parameter table, since T ADDR got incremented in 1B52 SCAN LOOP.So reducing its lo byte by E0 (0605 SAVE ETC) leaves a flag     zero, one, 2 or 3 as appropriate.                                       This flag is used whenever it is necessary to exclude   certain operations from the general routine: eg you can't SAVE  with a null name (0629 SA BLANK), you can't MERGE ... DATA (0652SA DATA) etc.                                                           Used in a rather similar way by 1C96 PERMS: the lo byte of the addresses for the INK TO OVER commands, after having beenincremented in 1B65 GET PARAMS, is EC for INK to F1 for OVER.   Take away 13h makes D9 to DE, the token code, which is fed into 21FC CO TEMP 4 to send it to print output.                             Written by:                                                      0605 SAVE ETC                                                   1B55 GET PARAM                                                 Read by:                                                         0605 SAVE ETC                                                   0629 SA BLANK                                                   0652 SA DATA (twice)                                            06A0 SA SCR$                                                    06C3 SA CODE (twice)                                            06E1 SA CODE 1                                                  0723 SA LINE 1                                                  075A SA ALL                                                     07AD LD CH PR                                                   07F4 VR CONT 2                                                  1B52 SCAN LOOP                                                  1C16 JUMP C R                                                   1C96 PERMS                                                                                                                  TAN key (B4) see also commands, functions and operators,    KEYBOARD SCANNING, 022C extended mode table (b)                         The E key in E mode without shift produces the function TAN: it requires one numeric operand X, and the value of the    function is tan X. X is in radians, see under 3783 get-argt.            On execution, 24FB SCANNING quickly leads to 26DF S     NEGATE. This converts the key code B4 first to 05, then to E1,  and adds the priority 10h/16d. Code and priority 10E1 are now   pushed on to the machine stack (270D S PUSH PO) while the       expression following TAN is evaluated.                                  When the code is taken off the stack (2734 S LOOP) it isconverted 2773 S TIGHTER) from E1 to 21, the calculator offset  for 37DA tan.                                                                                                                       tan subroutine 37DA                                                 Called from 0028 FP CALC with the literal 21h; the      executive routine of the TAN function. Not otherwise called in  ROM, but can be called direct from m/c.                                 Given X in radians returns tan X. If you aren't sure    about radians, see under 3783 get-argt.                                Input parameters: HL points to the first byte of X               - DE holds the address of the stack end                         - X must be the last value on the calculator stack, evenfor direct calls.                                                      Action: use the calculator to compute SIN X/COS X, which is always equal to TAN X; the division subroutine will report   "Number too big" if COS X is zero. This happens for TAN pi/2,   which equals "infinity".                                               Exit: RET.                                                      Output parameters: HL and DE unchanged                           - TAN X on the stack, replacing X.                             Rems:                                                            3449 series-06 indirectly used in calculation                                                                               "Tape loading error" message see 0806 REPORT R                                                                                  temporary colour items                                              Rather confusingly used to mean "colour control code" at21E2 CO TEMP 2. See colours.                                                                                                        TEMPORARY COLOUR ITEMS SUBROUTINE see 0D4D TEMPS                                                                                temporary colours see colours                                                                                                   temporary memory area see 5C68 MEM                                                                                              TEMP PTR 1 subroutine 0077                                          See 0074 CH ADD+1.                                             Called from:                                                     1E0A READ 1                                                     26BD S BIN                                                     Rems:                                                            0074 CH ADD+1 used to set CH ADD temporarily                                                                                TEMP PTR 2 subroutine 0078                                          See 0074 CH ADD+1.                                             Called from:                                                     1E0A READ 1                                                    Rems:                                                            0074 CH ADD+1 used to set CH ADD temporarily                                                                                TEMPS subroutine 0D4D see also colours                              Copies the permanent attribute values from 5C8D ATTR P  to 5C8F ATTR T. This is done each time a PRINT etc command is   executed, eg at 1FCF PRINT 1; if the ATTR T values aren't       changed by an embedded colour item, those which came from ATTR Pare implemented, but the values in ATTR T are always used in anyactual print.                                                           The subroutine is also used elsewhere, eg to make sure  the permanent colours are used in clearing the screen or in     displays to the lower screen, etc.                                     Input parameters: none.                                         Action: make a zero byte                                         - get a value from 5C8D ATTR P/MASK P; one byte each            - if bit zero of TV FLAG is zero jump on to TEMPS 1;    upper screen                                                            - (lower screen) replace MASK P with a zero byte and    ATTR P with the value from 5C4B BORDCR.                                _0D5B_TEMPS_1: put the values in 5C8F ATTR T/MASK T              - get 5C91 P FLAG; its even bits flag "temporary" PAPER 9, INK 9, INVERSE and OVER, its odd bits flag the same things   "permanently"                                                           - if the NZ flag is showing from the read of TV FLAG bitzero jump on to TEMPS 2; lower screen                                   - (upper screen) rotate the flags one place to the rightfor a setting byte; putting the "permanent" bits in the         "temporary" positions.                                                 _0D65_TEMPS_2: XOR/AND/XOR the original flag byte with   the rotated byte using 1010101b/55h as a mask; for the lower    screen the flag byte hasn't been changed, so this changes       nothing. For the upper screen it replaces the even bits with    what were the odd bits. See masks. The hi bit is bit 7, the lo  bit is bit zero, so the mask has "holes" in the even bits; the  rotated flag byte is used as a setting byte, and its even bits, copied from the odd bits of the original flag byte, go through  the "holes" to replace the even bits of the original flag byte          - put the new byte in P FLAG.                                  Exit: RET, from 0D65 TEMPS 2.                                   Output parameters: HL holds P FLAG                               - A corrupted, no others changed.                              Called from:                                                     0D02 PO SCR 4                                                   0D6E CLS LOWER                                                  0DAF CL ALL                                                     111D ED COPY (twice)                                            1C96 PERMS                                                      1CDE CLASS 09                                                   1FCF PRINT 1                                                   Exit from:                                                       1646 CHAN S 1                                                   22DC PLOT                                                       2477 LINE DRAW                                                                                                              TEMPS 1 0D5B (0D4D TEMPS)                                          Jumps from:                                                      0D4D TEMPS                                                                                                                  TEMPS 2 0D65 (0D4D TEMPS)                                          Jumps from:                                                      0D5B TEMPS 1                                                                                                                terminator see BASIC line                                                                                                       TEST CHAR 001C (0018 GET CHAR)                                     Exit from:                                                       0018 GET CHAR                                                   0020 NEXT CHAR                                                                                                              TEST FOR SCROLL SUBROUTINE see 0C55 PO SCR                                                                                      TEST NEG 307C (3014 addition)                                      Jumps from:                                                      3055 SHIFT LEN                                                                                                              TEST NORM subroutine 3155 see also CALCULATE                        The common exit routine of the four arithmetic          operations, addition, subtract, multiply, divide. Entered with aresult mantissa and exponent which may require_normalization;   also with two pointer addresses on the machine stack.                   The_normal_form of an FP number has a mantissa less thanone and more than or equal to a half; but the hi bit, which     would always be set for this range of values, is used as a sign bit, zero for positive and one for negative. When one FP number is added to, subtracted from, multiplied or divided by another, the result produced by the routines often has a mantissa less   than a half or more than one, but if it is more than one it is  corrected in the main routines. Normalization consists of       repeatedly doubling the mantissa and decrementing the exponent, till the mantissa is within range. After this has been done a   correct sign bit is inserted.                                           Normalizing is performed with an exponent already in    standard form, ie ranging from 01 for a true exponent -7F, to FFfor a true exponent +7F. If one number is subtracted from an    almost equal number, or two small numbers are multiplied        together, or a small number is divided by a large one, the      normalized exponent may well come out less than 01,             corresponding to a true exponent less than -7F.                         An FP number less than 01 00 00 00 00 is considered     equivalent to zero; see under overflow. The result must be      returned as zero if the normalized exponent is less than zero,  or it is zero and the mantissa is less than half; but is roundedup to 01 00 00 00 00 if it is zero and the mantissa is more thana half. 01 00 00 00 00 is equal to 2**-127d * 0.5d or 2**-128d, a little less than 3E-39; its true exponent is -7Fh/-127d and   its true mantissa one half. Its negative is 01 80 00 00 00, and the true mantissa is 80 00 00 00 in either case.                        If the exponent in the input parameters is already      small, decrementing it in normalization may again bring it down to zero, in which case the result is again returned as zero or  01 00 00 00 00.                                                        Input parameters: HL points to the position for the      result, usually the last value on the calculator stack                  - a normalised exponent byte is already in position in  the first place of the result                                           - the second place holds a sign flag: its hi bit is one for negative, zero for positive, as it will be in the normalizedresult, its other bits are immaterial                                   - 32d bits of the mantissa are in D'E'DE; this is a truemantissa, without indication of sign, and it may have leading   zeroes, which a normalized mantissa can't have                          - a 33rd and 34th bit are in the hi bits of A after     multiplication or division; after addition/subtraction A is zero        - the carry flag is NC after addition/subtraction; aftermultiplication/division it will be C if the standard FP form    exponent came out at less than 01, ie less than -7F in true     form. This exponent will be 00 or FF/minus one, never less              - there are two addresses on the machine stack above thereturn address, the two calculator stack pointers, which were   stacked in 30F0 MULT LONG, 31AF division or 303E FULL ADDN.            Action: if the carry is NC jump on to NORMALISE                  - (exponent is zero or minus one) test the exponent bytefor zero.                                                              _3159_NEAR_ZERO (the normalizing loop jumps back to here if the exponent gets decremented to zero): make a signal byte   80h                                                                     - if the exponent is zero jump on to SKIP ZERO; with 80hin the signal byte.                                                    _315D_ZERO_RSLT (exponent is minus one; or loop back to  here if the normalizing loop finds 32d zeroes in the mantissa): zero the signal byte.                                                  _315E_SKIP_ZERO: AND the hi byte of the mantissa with thesignal byte; the resulting signal is zero if the exponent is    zero or the mantissa has a leading zero, but 80h if the mantissais one half or more_and the exponent is minus one                       - call 2FFB ZEROS 4/5, which copies the signal byte in Land zeroes the mantissa D'E'DE; it doesn't change the signal    byte                                                                    - rotate the signal byte left; its hi bit goes to its lobit and also to carry, making 00 or 01-and-carry from 00 or 80h         - put this in the exponent place                                - if there is carry jump on to OFLOW CLR; the signal was80h. The signal byte will be put in the hi byte of the mantissa,so the number has been rounded up to 01 80 00 00 00, which will be corrected to 01 00 00 00 00 if it is positive                        - (zero signal) zero the second result byte; the sign   byte, negative zero isn't allowed. The number will now be 00 00 00 00 00 zero                                                           - jump on to OFLOW CLR.                                        _316C_NORMALISE (the exponent isn't zero or less, but    there may be leading zeroes in the mantissa): make a digit      counter 20h/32d to count the 32d digits of the mantissa.               _316E_SHIFT_ONE: check the hi bit of the mantissa                - if it is one jump on to NORML NOW; the mantissa is nowone-half or more                                                        - (a leading zero) shift D'E'DEA one place left; note   the fifth byte A, which is zero after additions and subtractionsbut has two more or less meaningful hi bits after multiplica-   tions or divisions. In multiplications or divisions the result  mantissa must be between a quarter and one, because the         mantissas of X and Y were both between half and one; so the     result mantissa can't need shifting more than one place, and thelower bits of A never get used. [The note "A is rotated         circularly ... " etc is mystifying to say the least, and I      suspect meaningless.]                                                   - decrement the exponent                                        - if it reaches zero jump back to NEAR ZERO                     - loop back to SHIFT ONE, counting down the digits              - (the loop has counted down to zero) jump back to ZERO RSLT; there were no bits set in the mantissa at all. This will  happen eg as a result of "X - X".                                      _3186_NORML_NOW: rotate one more bit left out of the     fifth byte; it will only be set if it is the 34th bit from a    multiplication or division                                              - if it was zero jump on to OFLW CLR                            - (carry from bit 34) call 3004 ADD BACK, which adds thecarry into the mantissa to round it up                                  - if this doesn't produce the zero flag jump on to OFLW CLR                                                                     - (zero flag means the mantissa was FF FF FF FF, now    rounded up to OO OO OO OO) make the mantissa 80 00 00 00 and    increment the exponent                                                  - if this makes zero report "Number too big"; the       exponent was FF.