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

  1.         Because the argument before the operator may itself be  an expression containing functions or operators, binary         operators have to be given a priority ranking; functions and    unary operators have these too, but it could have been avoided  for them. In fact all the functions have the maximum possible   priority, but not all the unary operators.                              The distinction is made in a different way when         referring to the operation subroutines called by the calculator literals; here_binary_operations means those which are entered  with two arguments on the calculator stack - they are literals 1to 17h - and_unary_operations those which are entered with only one.                                                                    The difference is in the stack pointers: HL always      points to the the sole argument of a unary operator, but to the "second value", ie the last but one on the stack, for a binary  operator. DE always points five bytes further on, which is the  stack end in 5C65 STKEND for a unary operator but the first byteof the last value for a binary operator.                                2712 S CONT 1 next code may be binary operator                  2723 S OPERTR codes alloted to binary operators                 2734 S LOOP machine stack holds operators and functions         3293 RE ST TWO full FP forms required for binary ops            335B CALCULATE eg addition                                      3380 FIRST 3D HL points to first operand, DE to second                        ("last value")                                    33A1 delete counts as binary; "conjuring trick" result          343C exchange - a binary operation                              346A abs - a unary operation                                    3524 no-&-no - a binary operation                               352D str-&-no - a binary operation                              359C strs-add - a binary operation                              3851 to-power - a binary operation                                                                                          binary point see "." (2D) after end of alphabet                                                                                 binary representation of numbers see BIN key                                                                                    BIN DIGIT 2CA2 (2C9B DEC TO FP)                                    Jumps from:                                                      auto                                                                                                                        binding see 24FB SCANNING                                                                                                       BIN END 2CB3 (2C9B DEC TO FP)                                      Jumps from:                                                      2CA2 BIN DIGIT                                                                                                              BITS ZERO 3283 (3214 truncate)                                     Jumps from:                                                      3272 NIL BYTES                                                                                                              blanking of BASIC lines                                             If the line just copied to the lower screen for editing is shorter than whatever was there before, the difference is    filled with spaces.                                                     1150 ED BLANK jump forward if not required                                                                                  block graphic characters see graphics keys                                                                                      block of data see program area                                                                                                  BORDCR system variable 5C48 see also 2294 BORDER, colours          Bytes: 1                                                         Contains the attributes for the lower screen, in the    usual fbpapink format. Despite its name BORDCR isn't normally   used to colour the border, only the lower screen; but its PAPER colour is set to match the colour of the border. It is read by  0E44 CL LINE to colour the lower screen after clearing, and by  0D4D TEMPS whenever attributes are required for the lower       screen.                                                                 The ROM never puts FLASH or BRIGHT 1 in BORDCR, nor any INK colour except black or white; it is set to 00111000b, black ink on white paper, by 1219 RAM SET, and set to the paper colourof user's choice, with black or white contrasting ink, by 2294  BORDER.                                                                 However its paper colour is output to port FE by 0F35   SA/LD RET to restore the border colour after sending stripes to it, and by 03B5 BEEPER to avoid changing the border when        outputting speaker signals                                              POKing BORDCR, 23624d, from BASIC or m/c can produce a  lower screen of different colour from the border, with any      coloured ink and even with FLASH or BRIGHT. The border won't be affected. However, in the 128K Spectrum any key input will      change the border to match the paper colour of the lower screen.       Written by:                                                      1219 RAM SET                                                    22A6 BORDER 1                                                  Read by:                                                         03B5 BEEPER                                                     053F SA/LD RET                                                  0D4D TEMPS                                                      0E4D CL LINE 2                                                 Rems:                                                            0D6E CLS LOWER copied to ATTR T                                 2294 BORDER saved in BORDER 1                                                                                               BORDER key (E7) see also commands, functions and operators, KEYBOARD SCANNING                                                       The B key in K mode produces the command BORDER; it mustbe followed by a numeric expression whose value is positive and less than eight. If it isn't an integer, it will be rounded to avalue from zero to seven when it is taken off the stack by 2DD5 FP TO A. The command is read by 1B29 STMT L 1 referring through the syntax offset table 1A48 to the syntax parameter table 1A7A.1AF5 P BORDER causes a jump via 1C82 CLASS 06, which collects   the colour parameter, 1C10 CLASS 00 and 1C16 JUMP C R to the    executive routine 2294 BORDER.                                          Unlike the colour commands INK to OVER, BORDER cannot be"embedded" in a PRINT command.                                          03B5 BEEPER border colour moved to bits 2-0 of A                03D6 BE H&L LP border unchanged by OUT (FE) A                   04D0 SA FLAG border made RED                                    04DB SA LEADER border striped RED/CYAN by "edges"               04EA SA SYNC 1 border on RED, off CYAN                          04F2 SA SYNC 2 mic off and border CYAN                          0507 SA START mic on and border BLUE                            0511 SA BIT 2 mic off and border YELLOW                         051C SA OUT border alternates BLUE/YELLOW                       053F SA/LD RET border restored to original colour               0556 LD BYTES border made WHITE then RED                        056C LD START if "edge" found, then border CYAN                 058F LD SYNC changes border to BLUE/YELLOW                      05E3 LD EDGE 2 enterd with border colour in C register          05ED LD SAMPLE border changed when "edge" found                 11CB START/NEW make border white on start-up                                                                                BORDER subroutine 2294 see also colours                             Sets PAPER and contrasting INK for the border; the      executive routine of the BORDER command. Not otherwise called   from ROM. Can be called from m/c with the colour on the         calculator stack, but it is simpler to call 229B (OUT (+FE),A), with the colour code in A instead of on the calculator stack            Besides sending the colour to the output port to change the border on screen, the subroutine makes an attribute byte andstores it in 5C48 BORDCR, in the usual fbpapink format, with theborder colour in pap, contrasting black or white in ink, and    zeroes in f and b: this is used to colour the lower screen.            Input parameters: the colour specification is the last   number on the calculator stack; it must be 7 or less.                  Action: call 1E94 FIND INT1 to get the colour byte from  the stack                                                               - if it is 8 or more report "Integer out of range"              - output it to port FE                                          - move it three bits left to the pap position, with zeroto the lo bits; 00000pap becomes 00pap000                               - read bit 5, the hi bit of the colour number                   - if it is set jump on to BORDER 1; white, yellow, cyan or green                                                                - (magenta, red, blue or black) XOR the colour byte with00000111b/07h; this reverses ink from white to black.                  _22A6_BORDER_1: put the colour byte in BORDCR.                  Exit: RET.                                                      Output parameters: A contains the colour byte.                                                                               BORDER 1 22A6 (2294 BORDER)                                        Jumps from:                                                      2294 BORDER                                                                                                                 BOTH NULL 3572 (353B no-l-eql)                                     Jumps from:                                                      356B SECND LOW                                                                                                              brackets see also 28h "(" and 29h ")" at end of alphabet            20C1 IN ITEM 1 handles INPUT followed by brackets                                                                           BREAK key (no code) see also KEYBOARD SCANNING                      BREAK is "space" with caps shift on the original        Spectrum, but most later models have a separate BREAK key,      though caps shift space still works. Pressing the BREAK key     produces zero signals in port 7FFE and FEFE. They are read by   subroutine 1F54 BREAK KEY, see below.                                   0525 SA 8 BITS return if pressed                                053F SA/LD RET read for last time                               056B LD BREAK return if pressed                                 05E3 LD EDGE 2 zero flag set by                                 05ED LD SAMPLE read with EAR through port 7FFE                  0C88 PO SCR 2 jump to REPORT D if pressed                       0EFD COPY L 1 stop motor etc if pressed                         133C MAIN 5 continue from next statement after BREAK            1376 MAIN 7 jump after BREAK indicated by NSPPC                 1B76 STMT RET tested after each statement                       1B7D STMT R 1 continues if no BREAK                                                                                         'BREAK - CONT repeats' message (144F) see 0552 and 0D00     REPORT D                                                                                                                            'BREAK into program' message (14CC) see 1B7B REPORT L                                                                           BREAK KEY subroutine 1F54                                           Returns with NC if BREAK is down. Can be used to break  into m/c programs; often useful for debugging.                          BREAK is produced by "space" with caps shift: caps shiftzeroes bit zero of port FEFE, space zeroes bit zero of port     7FFE, so only if both signals are being received does BREAK     count as being pressed.                                                 Routines in 05ED LD SAMPLE and 0C88 PO SCR 2 read port  FFFE only and accept either BREAK or SPACE as effective BREAKs  to stop reading of cassette tape or to stop listing on the      "scroll?" message. This is done direct, without calling BREAK   KEY.                                                                   Input parameters: none.                                         Action: read port 7FFE, bit zero; space key                      - if it isn't zero return with carry; no break                  - read port FEFE, bit zero, caps shift; if BREAK is     being pressed, both bits are zero.                                     Exit: RET.                                                      Output parameters: A corrupted, others unchanged                 - returns with NC signalling BREAK.                            Called from:                                                     0EFD COPY L 1                                                   1B76 STMT RET                                                                                                               BREG system variable 5C67; nb equal to STK END hi + 1            1. The "B register" of the calculator, see 0028 FP CALC,   used mainly as a loop counter.                                       2. Also used as temporary store for the current line flag  when automatic listing, see 1835 LIST ALL; one till the current line has been printed on screen, then zero.                            Bytes: 1                                                        Written by:                                                      1865 OUT LINE 1                                                 335E GEN ENT 1                                                  367A dec-jr-nz                                                 Read by:                                                         0C55 PO SCR                                                     338E ENT TABLE (2 bytes at STK ENDhi, so BREG is hi                            byte)                                            33A2 fp-calc-2                                                 Rems:                                                            335B CALCULATE use of                                           335E GEN ENT 1 dual use of                                      3362 GEN ENT 2 entry point when BREG is counter                 3453 G LOOP left undisturbed                                                                                                BRIGHT key (DC) see also colours, commands, functions and   operators, KEYBOARD SCANNING, 0246 extended mode table (c)              The B key in E mode with either shift produces the tokenBRIGHT. It can be used either as a BASIC command or as a print  control item within a PRINT etc statement. In either case it    causes any new printing on the screen to appear with enhanced orreduced brightness; it must be followed by a parameter, one for "BRIGHT on", zero for "off", eight for "no change" in the new   position on the screen.                                                 As a command, it is read by 1B29 STMT L 1 referring     through the syntax offset table 1A48 to the syntax parameter    table 1A7A. 1AEE P BRIGHT causes a jump to 1C96 CLASS 07        (PERMS), the executive routine for all the colour item commands INK to OVER.                                                            As a print control item, execution is from within the   PRINT executive routine 1FCD PRINT; each new expression         following the PRINT command is checked by a call to 1FFC PR ITEM1 from 1FE5 PRINT 3. If it is BRIGHT, this in turn calls 21F2 COTEMP 3, from 2024 PR ITEM 3; here the token code DC is convertedto the "embedded" control code 13h, which is then sent through  the output routine followed by the parameter one or zero.               The way this works when printing on screen can be seen  at 09F4 PRINT OUT; indexing with 13h for BRIGHT into the controlcharacter table at 0A11 produces an indirect jump to 0A7A (0A1E + 5C) PO 1 OPER. See the index description of this subroutine   for the rather tricky way in which it collects the parameter andsends execution to 0A87 PO CONT, which finally executes the     BRIGHT command.                                                                                                                     BRIGHT control code (13h) see also 0382 K 8 & 9 under 0333 KDECODE                                                                  The 9 key in E mode without shift produces the print    control item "BRIGHT on": PRINT "[E mode 9] hello" has just the same effect as PRINT BRIGHT 1;"hello", and [E mode 9] in the    BASIC program will cause everything following it to be listed   BRIGHT. Similarly the 8 key in E mode produces BRIGHT off; and  with caps shift, though not with symbol shift, the 9 and 8 keys produce FLASH on or off respectively. There is no provision for control items similar to BRIGHT 8 or FLASH 8.                           The keyboard scanning routines initially return codes asfollows:                                                                     Key 9 without shift,   BRIGHT on:  03                           Key 8 without shift,   BRIGHT off: 02                           Key 9 with caps shift, FLASH on:   01                           Key 8 with caps shift, FLASH off:  00               These values are also put in 5C08 LAST K.                              However these codes are changed by 10A8 KEY INPUT, whichputs 13h in the A register for BRIGHT or 12h for FLASH, and 00  or 01 for off or on in the C register. The channel address is   switched so that A and C are returned in series, and both are   put in the BASIC line.                                                  When the BASIC line is printed out by 1855 OUT LINE,    either in a listing or in the lower screen for editing, the     BRIGHT or FLASH command is implemented for the remainder of the print, but the presence of the codes isn't otherwise indicated. It can be detected by cursor moves: the cursor moves over the   two bytes in one jump when going left, but takes two jumps goingright due to a mistake in the ROM, see 100C ED RIGHT. DELETE    must be used twice to delete the control code and its parameter.        Such BRIGHT and FLASH controls can be incorporated in   variable names, eg to give them prominence in the listing: they are ignored when reading the variable for evaluation, but see   the minor error described under 28B2 LOOK VARS.                         The BRIGHT or FLASH control codes 13h/19d and 12h/18d   can be incorporated in strings:                                              10 LET a$=CHR$ 18 + CHR$ 1 + "hello!"                           20 PRINT a$                                         has just the same effect as                                                       10 PRINT FLASH 1;"hello!"                     and similarly with CHR$ 19 for BRIGHT. This is much more usefulwhen printing from m/c.                                                 007D SKIP OVER only one skip forward                            0382 K 8 & 9 token codes become 00-03                           0A6D PO TV 2 controls need 1 operand                            0A7A PO 1 OPER changes output routine                           0A87 PO CONT jump for 1-operand keys                            103E ED EDGE 1 not split from parameter by cursor               10A8 KEY INPUT changed to final code