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

  1.         [Note the minor error in ROM: the last line but one     before GO TO 2 should probably be CP 27h. The effect isn't      serious: if you command GO TO X, with X more than 9999d but lessthan the incorrect F000h/61440d used, the command isn't         executed, but you get the "OK" report when you should get the   "Integer out of range" report.]                                        Input parameters: none                                           - the expression for the line number has been evaluated and put on the calculator stack.                                       Action: call 1E99 FIND INT2 which takes the number off   the stack into the BC register                                          - make the statement number zero                                - check the hi byte of the line number against F0;      should have been 27h                                                    - if it is too big report "Integer out of range".              _1E73_GO_TO_2 (entry here from the 1DAB NEXT, 1E5F       CONTINUE and 1F23 RETURN command routines): put the line and    statement numbers in the system variables.                             Exit: RET.                                                      Output parameters: none                                          - 5C42 NEWPPC and 5C44 NSPPC have their new values.            Called from:                                                     1EA1 RUN                                                        1EED GO SUB (misprinted GO TO 1)                               Rems:                                                            1384 MAIN 8 affects the value of NSPPC                          1DAB NEXT jumps into GO TO subroutine                                                                                       GO TO 1 misprint for 1E67 GO TO in 1EED GO SUB                                                                                  GO TO 2 1E73 (1E67 GO TO)                                          Exit from:                                                       1DAB NEXT                                                       1E5F CONTINUE                                                   1F23 RETURN                                                                                                                 graphic form, graphics codes/characters see graphics keys                                                                       GRAPHICS key (0F) see also KEYBOARD SCANNING, 0260 control  code key table (d)                                                      The 9 key with caps shift in K, L or C mode works the   GRAPHICS control in editing or INPUT mode. [There is a rare     misprint in the old Spectrum handbook, page 224, where the indexsays it is the zero key.]                                               Turns on G mode, in which                                      - key 9 again, with or without shift, will turn it off          - zero will DELETE                                              - one to eight will produce the graphic forms                   - A to U will produce user-defined graphics                     - V to Z rather surprisingly produce E-mode tokens RND,  INKEY$, PI, FN and POINT; see under 0333 K DECODE.                      Later models of the Spectrum mostly have a special GRAPHkey, but 9 with caps shift still works.                                 0260 control code table (d)                                     0FA8 editing keys table - ineffective                           107C ED GRAPH - ineffective (see under symbol code)                                                                         graphics keys (80 -> 8F) see also KEYBOARD SCANNING                 The one -> eight keys in G mode produce the sixteen     _graphics_forms or_block_graphics, codes 80 -> 8F: without      shift, the TRUE VIDEO forms, with either shift the INVERSE VIDEOforms.                                                                  The 8 * 8 character bits of the graphic characters take a rather simple form: the top four bytes of a character are all the same, and so are the bottom four, and each byte is either   00, 0F, F0 or FF. They aren't therefore stored in memory like   the other characters, which would have used 80h/128d bytes;     whenever one is to be printed it is "drawn" in eight bytes of   the calculator memory area and copied from there to the screen  or printer. See 0B38 PO GR 1 under 09F4 PRINT OUT.                      0389 K GRA DGT look up through 034A K LOOK UP                   0B24 PO ANY prepare to print graphics form                      0B38 PO GR 1 construct form in calculator memory                0B3E PO GR 2 check code required                                0B4C PO GR 3 construct form                                     0F38 ED LOOP accept graphic codes                                                                                           graphics mode see 5C41 MODE                                                                                                     greater-0 subroutine 34F9 see also logical value                    Called from 0028 FP CALC with literal 37; checks the    sign of the last value on the calculator stack, and replaces thenumber with one if it is positive, zero if it is zero or        negative.                                                               Also called direct as GREATER 0. In direct calls the    number checked may be any FP number, not necessarily on the     stack.                                                                 Input parameters: HL points to the first byte of the FP  number X; this will automatically be the last number on the     stack in calls from FP CALC.                                           Action: call 34E9 TEST ZERO                                      - if X is zero return immediately; the zero result is   already on the stack                                                    - put FF in the A register.                                    Exit: immediate RET if X zero                                    - with X non-zero, into 3507 SIGN TO C, which in turn   exits into 350B FP 0/1. With FF, SIGN TO C flags carry, which FP0/1 changes to a one on the calculator stack.                          Output parameters: A holds FF, others unchanged.                Called through FP CALC from:                                     1DE2 NEXT 1                                                     2DE3 PRINT FP                                                   3713 ln                                                         371C VALID                                                      3783 get-argt                                                   385D XISO                                                      Called as GREATER 0 from:                                        358C END TESTS                                                                                                              GRE.8 373D (3713 ln)                                               Exit from 3713 ln through                                        371C VALID (twice)                                                                                                                                   -----                                                                                                  header area, header information, header of save/load block  see 0605 SAVE ETC                                                                                                                   hertz see timing                                                                                                                HL AGAIN 30BC (30A9 HL=HL*DE)                                      Jumps from:                                                      30B1 HL LOOP                                                                                                                HL END 30BE (30A9 HL=HL*DE)                                        Exit from:                                                       30B1 HL LOOP (twice) (30A9 HL=HL*DE)                                                                                        HL=HL*DE subroutine 30A9                                            Multiplies together the contents X and Y of two         registers, without error messages but with a flag for overflow. Can readily be called from m/c.                                         It works by binary "long multiplication": make a zero   accumulator, then read the bits of X from hi to lo, doubling theaccumulator each time and adding Y to it if the bit is one. The calculator couldn't be used, because the calculator relies on   this subroutine for small integer multiplication.                      Input parameters: HL holds X and DE holds Y; the numbers to be multiplied.                                                      Action: make a bit counter of 10h/16d                            - make an accumulator set to zero.                             _30B1_HL_LOOP: double the accumulator; shifting it right one bit                                                                 - if this makes carry jump on to HL END; overflow               - (no carry) rotate the lo byte of X left one bit with  the zero from carry into its lo bit and its hi bit into carry           - rotate the hi byte left with carry to its lo bit and  its hi bit to carry                                                     - if the carry shows NC jump on to HL AGAIN; hi bit zero        - (hi bit was one) add Y to the accumulator.                   _30BC_HL_AGAIN: loop back to HL LOOP counting down the   bit counter to zero.                                                   _30BE_HL_END: recover the original BC.                          Exit: RET.                                                      Output parameters: the result is in HL                           - if there has been an overflow the C flag is set;      result more than FFFFh/65535d                                           - BC and DE unchanged.                                         Called from:                                                     2AF4 GET HL*DE                                                  30CA multiply                                                                                                               HL LOOP 30B1 (30A9 HL=HL*DE)                                       Jumps from:                                                      30BC HL AGAIN                                                                                                               housekeeping tasks                                                  An expression used once or twice in the notes to mean   "putting everything back to normal".                                    0D94 CL CHAN restore chan K and system variables                0DAF CL ALL call CL CHAN                                                                                                    hz (= hertz) see timing                                                                                                                                  -----                                                                                                  I CARRY 2AE8 (2ACC INT EXP1)                                       Jumps from:                                                      2ACD INT EXP2                                                                                                               IF key (FA) see also commands, functions and operators,     KEYBOARD SCANNING, logical value                                        The U key in K mode produces the command IF. The "IF    statement" must be an expression with a logical value: a numericexpression or comparison, not a string. There must be a         statement following the IF statement, introduced by THEN, not bythe usual colon; the statement following THEN is only executed  if the logical value of the IF statement is non-zero, positive  or negative. There needn't actually be anything after the THEN: "IF xxxx THEN" is good syntax by itself, though vacuous.                The command is read by 1B29 STMT L 1 referring through  the syntax offset table 1A48 to the syntax parameter table 1A7A.1A81 P IF causes jumps                                                 - to 1C82 CLASS 06 which evaluates the expression;              - back to 1AB2 to check that the "THEN" is present;       and via 1C11 CLASS 05 and 1C16 JUMP C R to the executive       routine 1CF0 IF.                                                                                                                    IF subroutine 1CF0 see also logical value                           Called only from the statement loop through 1A81 P IF inthe syntax parameter table: the executive routine for the IF    command.                                                               Input parameters: none                                           - the value of the expression between IF and THEN has   been calculated and is the last value on the calculator stack;  zero means the expression is false, non-zero means it is true.         Action: drop the return address 1B76 STMT RET                    - in syntax checking, jump on to IF 1 to check the      syntax of the THEN statement                                            - use the calculator to delete the last value, which    leaves DE pointing to its first byte                                    - call 34E9 TEST ZERO                                           - if there is carry exit to 1BB3 LINE END; false.              _1D00_IF_1 (true): exit to 1B29 STMT L 1.                       Exit: if the value was zero 1BB3 LINE END transfers      execution to the next line                                              - if true 1B29 STMT L 1 executes the statement after theTHEN.                                                                  Output parameters: none.                                                                                                     IF 1 1D00 (1CF0 IF)                                                Jumps from:                                                      1CF0 IF                                                                                                                     IN key (BF) see also commands, functions and operators,     KEYBOARD SCANNING, 0246 extended mode table (c)                         The I key in E mode with either shift produces the      function IN; it requires one numeric operand X, and the value ofthe function is the present reading of port X.                          On execution, 24FB SCANNING quickly leads to 26DF S     NEGATE. This converts the key code BF first to 10, then to EC,  and adds the priority 10h/16d. Code and priority 10EC are now   pushed on to the machine stack (270D S PUSH PO) while the       expression following IN is evaluated.                                   When the code is taken off the stack (2734 S LOOP), it  is converted (2773 S TIGHTER) from EC to 2C, the calculator     offset for 34A5 in.                                                                                                                 in subroutine 34A5                                                  Called only from 0028 FP CALC with literal 2C to executethe BASIC IN command. No point in calling from ROM or m/c, the  IN instructions are more effective.                                    Input parameters: none                                           - the port number is the last value on the calculator   stack.                                                                 Action: call 1E99 FIND INT2 to get the last value in BC  and check it for range                                                  - read from port BC into register A.                           Exit: via 34B0 IN PK STK to 2D28 STACK A, which puts A onthe stack.                                                             Output parameters: A holds the reading from the port             - the port number has been removed from the stack.                                                                          IN ASSIGN subroutine 21B9                                           When you respond to an INPUT command by typing an       expression into the work space, this subroutine is called twice:first to check the syntax, and then again to evaluate the       expression and assign it to the variable. This doesn't apply to INPUT ... LINE, which works differently.                               Input parameters: none                                           - there must be an expression in the work space and a   variable of the correct type ready for assignment; ie its       address in 5C4D DEST must be in the variables area.                    Action: put the BASIC pointer 5C5D CH ADD on the start ofthe work space in 5C61 WORKSP                                           - read the first code in the work space                         - if it is E2 STOP jump on to IN STOP                           - (not STOP) get FLAGX; its bit 6 is the INPUT numeric/ string status flag                                                      - call 1C59 VAL FET 2 to read the expression and assign it; it reports an error if its status doesn't match the flag            - read the next character                                       - if it is 0D newline return                                    - report "Nonsense in BASIC".                                  _21D0_IN_STOP (STOP found): return in syntax checking;   anything at all can follow STOP in an INPUT, its syntax isn't   checked                                                                 - (run time) report "STOP in INPUT".                           Exit: RETs in IN ASSIGN and IN STOP.                            Output parameters: none.                                        Called from:                                                     2148 IN VAR 2                                                   2174 IN VAR 5                                                                                                               IN CHAN K subroutine 21D6                                           Checks if channel K is current channel. See channels andstreams.                                                                In the simple Spectrum no input is possible except      through channel K; with peripherals attached this is possible,  eg through a network, and this subroutine is used in the INPUT  command routine to inhibit the copying of inputs to the screen.        Input parameters: none.                                         Action: read the fifth address starting from the address in 5C51 CURCHL                                                          - check it with 4B "K".                                        Exit: RET.                                                      Output parameters: a Z flags "this is channel K"                 - A holds the channel letter                                    - HL its address after 5C51 CURCHL.                            Called from:                                                     2161 IN VAR 4                                                                                                               INDEXER subroutine 16DC see also tables                             Reads tables such as the channel code look-up, CLOSE/   OPEN stream look-up, operators, etc. Each entry in the table    must be two bytes, an_index and an_offset: the index code is    compared with the code being looked up, the offset may be any   single-byte value, but in many cases is added to the address of the index code to give a jump address for a subroutine. The     table always has an_end_marker, zero in the byte after the last entry pair; except in the meaningless "close stream look-up     table" at 1716.