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

  1.         - (it matches) clear the carry flag [unnecessary!] and  return.                                                                _1998_EACH_S_2 (the loop returns to here from EACH S 6   below): increment the BASIC pointer and read the next code.            _199A_EACH_S_3: call 18B6 NUMBER to jump the BASIC       pointer over number markers and the following 5-byte number             - put the pointer in 5C5D CH ADD                                - if the character isn't 22h " jump on to EACH S 4              - (quotes character) decrement the quotes flag.                _19A5_EACH_S_4: if the character is 3A colon jump on to  EACH S 5                                                                - if it isn't CB THEN jump on to EACH S 6.                     _19AD_EACH_S_5 (colon or THEN): if bit zero of the quotesflag is zero jump back to EACH S 1; the flag is even, this is   the end of a statement.                                                _19B1_EACH_S_6 (not colon or THEN, or in quotes): if the character isn't 0D newline jump back to EACH S 2                        - (newline) decrement the statement counter; this is theend of the line                                                         - set the carry flag and return; even if the quotes flagis odd, which could only happen in a REM command.                      Exit: RET, from EACH S 1 or EACH S 6.                           Output parameters: HL holds the address sought, A the    byte at that address                                                    - D is zero if the D'th statement has been found                - E is unchanged.                                               - the carry flag shows C if the end of the line has beenreached without a "find"                                                - the zero flag shows Z if the D'th statement has been  found, NZ if a match to E has been found.                              Called from:                                                     1BD1 NEXT LINE                                                  1DA3 LOOK P 2                                                   2825 SF NOT FD                                                 Exit from:                                                       1E39 PASS BY                                                                                                                EACH S 1 1990 (198B EACH STMT)                                     Jumps from:                                                      19AD EACH S 5                                                                                                               EACH S 2 1998 (198B EACH STMT)                                     Jumps from:                                                      19B1 EACH S 6                                                                                                               EACH S 3 199A (198B EACH STMT)                                     Jumps from:                                                      1990 EACH S 1                                                                                                               EACH S 4 19A5 (198B EACH STMT)                                     Jumps from:                                                      199A EACH S 3                                                                                                               EACH S 5 19AD (198B EACH STMT)                                     Jumps from:                                                      19A5 EACH S 4                                                                                                               EACH S 6 19B1 (198B EACH STMT)                                     Exit from:                                                       19A5 EACH S 4 (198B EACH STMT)                                                                                              EAR bit/state see ports                                             Bit 6 of the input from port FE. Set for "off", zero for"on".                                                                                                                               ECHO E system variable 5C82                                        Bytes: 2                                                         In 111D ED COPY, "echoes the end" of the last line of   BASIC in the lower screen which has just been overwritten by a  new one. It contains a position value in the lower screen just  after the end of the last line written there. When a change is  made in the line, or a new line is brought down for editing, thelower screen isn't cleared, but the new version or line simply  overwrites the old; ECHO E is used to check whether spaces are  required to complete the overwriting                                   Written by:                                                      0AF0 PO ST E                                                    117E ED C END                                                  Read by:                                                         111D ED COPY                                                    2161 IN VAR 4                                                                                                               ED AGAIN 0F30 (0F2C EDITOR)                                        Jumps from:                                                      107F ED ERROR                                                                                                               ED BLANK 1150 (111D ED COPY)                                       Jumps from:                                                      115E ED SPACES                                                                                                              ED C DONE 117C (111D ED COPY)                                      Jumps from:                                                      1150 ED BLANK (twice)                                                                                                       ED C END 117E (111D ED COPY)                                       Exit from:                                                       117C ED C DONE (111D ED COPY)                                   1167 ED FULL                                                                                                                ED CONTR 0F6C (0F2C EDITOR)                                        Jumps from:                                                      0F38 ED LOOP                                                                                                                ED COPY subroutine 111D                                             Prints out one line from the editing or the input area  in the lower part of the screen.                                        BASIC input isn't made directly to the screen but to theediting area when inputting a BASIC line, or to the work space  when responding to an INPUT command. All character inputs,      cursor moves, deletions, etc take effect in those areas first   and only afterwards are copied to the screen.                           The copying to screen occurs every time 15D4 WAIT KEY iscalled, ie whenever the Spectrum has dealt with a BASIC command and is awaiting further input from the keyboard:: WAIT KEY sets the "copy line" flag, bit 3 of TV FLAG, called "mode flag" in   the notes, and its WAIT KEY 1 loop calls 10A8 KEY INPUT, which  copies the line to lower screen first, before checking the      keyboard; ED COPY zeroes the flag. In effect, the input line is recopied every time a key is pressed.                                   Most of the subroutine is concerned with juggling with  the print position values to make sure the new copy of the inputappears in the right place in the lower screen and properly     overwrites what was there before; the lower screen isn't clearedbetween keystrokes, no doubt to avoid slowing down the keyboard response. For the print position coordinate system, see DISPLAY AREA.                                                                  Input parameters: none                                           - channel K is open, ie input from 10A8 KEY INPUT,      output to lower screen                                                  - 5C82 ECHO E holds the print position after the end of the existing display in the lower screen, which is to be        overwritten.                                                           Action: call 0D4D TEMPS to use the permanent colours; in 5C48 BORDCR for the lower screen                                        - zero TV FLAG bits 3 and 5; "don't copy input line" and"don't clear lower screen after keystroke"                              - load the machine stack with:                                 the old value from 5C8A S POSNL; call it "S PL1". This isalways the first print position in the lower screen - but it maybe on any line of the screen except the top two                        the old value from 5C3D ERR SP; the error address put    there by 0F30 ED AGAIN or 213A IN VAR 1                                1167 ED FULL; the return address for the time being. Thisis also put in 5C3D ERR SP as the return address after an       editing error, usually "Out of memory" or "Out of screen"              the print position from 5C82 ECHO E; on top of the stack         - call 1195 SET DE (misprinted SET HL) to get pointers  to the start and end of the editing area or work space,         whichever is being used                                                 - call 187D OUT LINE2 to print out the line indicated bythese pointers                                                          - call 18E1 OUT CURS to add the cursor if it is at the  end of the line; OUT LINE2 has already printed it if it is      anywhere else. This puts 5C8A S POSNL at the end of the printed line ("S PL2").                                                         - recover the 5C82 ECHO E value from the stack and stackthe line-end S PL2                                                      - call 0D4D TEMPS again in case the input has changed   the colours.                                                           _1150_ED_BLANK: check the print position line number from5C82 ECHO E hi against the one in S PL2 hi                              - if 5C82 ECHO E has a bigger line number, ie is furtherup the screen, jump on to ED C DONE; the new line is longer             - (5C82 ECHO E is lower down the screen) jump on to ED CSPACES                                                                  - (both on same line) check the column numbers; lo bytes        - if 5C82 ECHO E is bigger, ie more to the left, jump onto ED C DONE.                                                          _115E_ED_SPACES: call 09F4 PRINT OUT to print a space            - jump back to ED BLANK.                                       _1167_ED_FULL (an error in the copying of the line to thelower screen will cause a jump to here, but not an ordinary     syntax error in the line, which just produces a flashing cursor from 187D OUT LINE2 called earlier; ED FULL is usually entered  as the result of an "Out of screen" error): call 03B5 BEEPER to make a "rasp"; the duration is set by 5C38 RASP, which can be   changed, but the pitch is fixed                                         - put FF in 5C3B ERR NR; "OK"                                   - get the current value of 5C8A S POSNL; "S PL4",       wherever output has got to when the error occurred                      - jump on to ED C END.                                         _117C_ED_C_DONE (if the copied line was longer than the  overwritten one 5C8A S POSNL points to S PL2, the byte after it;if not, spaces have been output to overwrite the old line and   5C8A S POSNL points to "S PL3", the first print position after  the spaces): recover S PL2 which was stacked near the end of ED COPY; the end of the line that was copied                               - drop the return address ED FULL.                             _117C_ED_C_END: recover the entry value of the stack     pointer and put it back in 5C3D ERR SP                                  - recover the starting print position S PL1                     - call 0DD9 CL SET with it; the next line copied will goto the same position                                                    - put the new end-of-line value in 5C82 ECHO E; either SPL2 or S PL4; misprinted "old value" in the notes                       - zero 5C5F X PTR; in case a flashing cursor was        printed.                                                               Exit: RET.                                                      Output parameters: none                                          - 5C82 ECHO E holds the line-end position of the newly  copied edit/input line.                                                Called from:                                                     10A8 KEY INPUT                                                  2161 IN VAR 4                                                                                                               ED CUR subroutine 1011                                              Merely stores the current value of HL in 5C5B K CUR.           Exit from:                                                       1007 ED LEFT                                                    100C ED RIGHT                                                                                                               ED DELETE subroutine 1015                                           Called from the editing keys table 0FA5 by 0F92 ED KEYS in response to 0C DELETE; part of the 0F2C EDITOR loop. Deletes the character before the cursor in the BASIC line in the editingarea or work space. If the code before the cursor is the        parameter of an embedded colour control, including TRUE VIDEO orINVERSE VIDEO, the colour control code is deleted, leaving the  parameter; this effect is produced in 1031 ED EDGE called by    1007 ED LEFT.                                                           Not otherwise called from ROM; could be called from m/c,but of doubtful usefulness.                                            Input parameters: HL points to the cursor position in theediting area or work space                                              - the return address 0F38 ED LOOP is on top of the      stack.                                                                 Action: call 1031 ED EDGE, which moves the cursor left           - make a reclaim counter of one.                               Exit: to 19E8 RECLAIM 2, which reclaims one character at the cursor position; in the ROM call, it will return to 0F38 ED LOOP.                                                                  Output parameters: HL holds the new cursor position in   the editing area or work space.                                                                                                     ED DOWN subroutine 0FF3                                             Called from the editing keys table 0FA5 by 0F92 ED KEYS in response to 0A "down arrow"; part of the 0F2C EDITOR loop. Inediting, moves the current line down one BASIC line. In input   mode, no action except in INPUT ... LINE, when it produces the  "STOP in INPUT" error report; in INPUT ... LINE_all tokens,     including the STOP token, are accepted as input.                        Not otherwise called from ROM; could be called from m/c,but of doubtful usefulness.                                            Input parameters: HL points to the cursor position in theediting area or work space                                              - for the ROM call, the return address 0F38 ED LOOP is  on top of the stack.                                                   Action: if bit 5 of FLAGX is set jump on to ED STOP;     input mode                                                              - (editing mode) set a pointer on 5C49 E PPC                    - call 190F LN FETCH to get the next line number after  the one in 5C49 E PPC and put it in it; the new "current line"          - exit to ED LIST.                                             _1001_ED_STOP: put the error number 10h in 5C3A ERR NR;  "STOP in input"                                                         - exit to ED ENTER.                                            Exit: (editing mode) into 106E ED LIST, producing a new  listing. Return will be to 0F38 ED LOOP                                 - (input mode) into 1024 ED ENTER. With normal inputs   the error number is ignored and the EDITOR immediately called   again; but in INPUT ... LINE the error report gets printed. The error stack pointer isn't changed for INPUT ... LINE in 2129 IN PR 3, but remains on the usual address of 1303 MAIN 4; for otherinputs it is changed to 213A IN VAR 1, where error numbers are  cancelled.                                                             Output parameters: none.                                                                                                     ED EDGE subroutine 1031                                             Moves the editing cursor one place left, except                - at the start of a line it doesn't move                        - if it would land on the parameter of an embedded       control code it is moved back to the control code itself.               Rather than stepping back from the present cursor       position, the subroutine steps on from the start of the line    till it reaches the cursor position, retaining at each step a   record of the place where the cursor should go if the next step turns out to be the cursor position; call it the "trial         position". This slightly roundabout method is used in case the  BASIC line or input contains embedded INK to TAB controls such  as 16h,x,y (AT x,y); actually embedded ATs and TABs are         impossible when input is from the keyboard, but they might occurin inputs from peripherals, or of course from user m/c. [I thinkthe notes are wrong in calling this a mistake.]                        Input parameters: HL holds the present cursor position inthe editing area or work space                                          - the address 0F38 ED LOOP is next below the return     address on the stack.                                                  Action: set the carry flag and call 1195 SET DE; this    points DE at the address in 5C59 E LINE or 5C61 WORKSP, making atrial position on the start address of the editing areq or work space                                                                   - check the start address against the cursor pointer;   the INC HL merely corrects for SCF/SBC/ADD, putting the cursor  pointer HL where it was before                                          - if the cursor is on the start, drop the return addressand return to 0F38 ED LOOP; no action, the cursor can't move    back.                                                                  _103E_ED_EDGE_1: put a new BASIC pointer on the trial    position                                                                - step the pointer on one; keeping the trial position   unchanged                                                               - read the character at the trial position                      - AND it with 11111000b/F0h; the result will be 10h for codes 10h -> 1Fh, the INK to TAB control codes                          - if the result isn't 10h jump on to ED EDGE 2                  - (control code found) move the pointer on again; the   trial position is still on the control code, the pointer is on  the first parameter                                                     - subtract 17h from the control code and if there was   carry add one; this makes zero from 16h AT and 17h TAB only             - if it isn't AT or TAB jump on to ED EDGE 2