PO CHANGE subroutine 0A80 Mainly an exit routine for 0A75 PO 2 OPER - see index entry - but also called within that subroutine. Called from: 0A87 PO CONT Exit from 0A75 PO 2 OPER through one of: 0A6D PO TV 2 0A7D PO TV 1 PO CHAR 0B65 (09F4 PRINT OUT) Part of the PO ANY routine, used as an entry point by the call at PO RIGHT. Called from: 0A3D PO RIGHT PO CHAR 2 0BCA (09F4 PRINT OUT) Exit from: 0B52 PO T&UDG PO CHAR 3 0B76 (09F4 PRINT OUT) Jumps from: 0B6A PO CHAR PO COMMA 0A5F (09F4 PRINT OUT) Exit from: 09F4 PRINT OUT via 0A11 control character table, when input code was 06 (PRINT comma). PO CONT subroutine 0A87 See OA7A PO 1 OPER, of which this subroutine is a continuation, reached by the unorthodox method of making it temporarily the output address for the current channel. Made output routine and so called from 15F7 CALL SUB by: 0A6D PO TV 2 0A7A PO 1 OPER PO EACH 0C22 (0C0A PO MSG) Jumps from: 0C14 PO TABLE auto PO ENTER 0A4F (09F4 PRINT OUT) Exit from: 09F4 PRINT OUT via 0A11 control character table, when input code was 0D (ENTER). PO FETCH subroutine 0B03 See under 09F4 PRINT OUT. Called from: 09F4 PRINT OUT 0A5F PO COMMA (unnecessary call) 0AC3 PO FILL 0B24 PO ANY Exit from: 09F4 PRINT OUT 0B5F PO T PO FILL OAC3 (0A7A PO 1 OPER) Exit from: 0A5F PO COMMA 0A75 PO 2 OPER and 0A7A PO 1 OPER through 0AC2 PO TAB PO F PR 0B1D (09F4 PRINT OUT) Exit from: 0B03 PO FETCH PO GR 1 subroutine 0B38 See under 09F4 PRINT OUT. Called from: 0B24 PO ANY PO GR 2 0B3E See under 09F4 PRINT OUT. Called from: 0B38 PO GR 1 Exit from: 0B38 PO GR 1 PO GR 3 0B4C (09F4 PRINT OUT) Exit from: 0B38 PO GR 1/0B3E PO GR 2 Jumps from: auto POINT key (A9) see also commands, functions and operators, KEYBOARD SCANNING, 0284 extended mode table (f) The 8 key in E mode with symbol shift produces the function POINT; it requires two numeric operands in brackets (X,Y), and the value of the function is one if the pixel at PLOT coordinates X, Y is INK colour, zero if it is PAPER colour; ie what actually shows on screen, regardless of whether it is produced by INVERSE commands, etc. On execution, 24FB SCANNING indexes into the scanning function table at 25AC to find the executive routine 267B S POINT. POINTERS subroutine 1664 Corrects as necessary, whenever space is made or reclaimed in memory, the fourteen_system_pointers, all 2-byte RAM addresses: 5C4B VARS the start of the variables area 5C4D DEST the start of the "variable in assignment" 5C4F CHANS the start of the channel data 5C51 CURCHL the start of the channel in use 5C53 PROG the start of the BASIC program 5C55 NXTLIN the start of the next BASIC line to be executed 5C35 DATADD the end of the last DATA item used 5C59 E LINE the start of the editing area 5C5B K CUR the cursor address in the editing area 5C5D CH ADD the BASIC pointer 5C5F X PTR the next address after an error in BASIC 5C61 WORKSP the start of the temporary work space 5C63 STKBOT the bottom of the calculator stack 5C65 STKEND the end of the stack and the start of spare space. They are consecutive svs, and listed here in ascending order; but the addresses aren't in sequence, they would run CHANS, CURCHL, PROG, ... and the sequence of some of them will vary from time to time. As can be seen from the memory map on page 165 of the Spectrum handbook, page 142 of the Plus 2 handbook, if bytes areinserted in or deleted from the Microdrive maps, all fourteen ofthe pointers have to be adjusted; if they are inserted in or deleted from anywhere higher up, 5C4F CHANS won't be changed butsome of the ones higher up will be; see also under memory map inthis index. The last part of the subroutine calculates the block size for the LDIR or LDDR instruction which will follow the subroutine call: the block to be moved is from the change address up to the_old value of 5C65 STKEND, plus one because thebyte at the address in 5C65 STKEND itself is also to be moved. Input parameters: BC holds the "increment number"; the number of bytes by which the pointers are to be incremented, negative if they are to be decremented - HL holds the "change address"; the one_below where thechange is to be made. Action: make a "pointer pointer" to the first sv 5C4B VARS - make a counter 0Eh/14d to count the pointers. _166B_PTR_NEXT: get the pointer at the pointer pointer and compare it with the change address - if it is below or on the change address jump on to PTRDONE; this pointer needn't be changed - (it is above the change) increment the pointer by the increment number - put it back in the sv at the pointer pointer _167F_PTR_DONE: move on the pointer pointer - decrement the counter - if it isn't yet down to zero loop back to PTR NEXT forthe next sv - (all the pointers have been checked) subtract the change address from the last pointer checked, which was the one in 5C65 STKEND; this is the size of the block to be moved - add one to include 5C65 STKEND itself. Exit: RET, from 167F PTR DONE. Output parameters: HL is restored to its input value, thechange address - DE holds the_old value from 5C65 STKEND - BC holds the number of bytes to be moved by the LDIR or LDDR command - A is restored to its input value. Called from: 1655 MAKE ROOM 19E8 RECLAIM 2 pointer (save/load block) see program/data block pointer to system variables see 1664 POINTERS POINT LP 22D4 (22CB POINT SUB) Jumps from: auto POINT SUB subroutine 22CB See 267B S POINT. Called from: 267B S POINT POINT SUBROUTINE see 22CB POINT SUB POKE key (F4) see also commands, functions and operators, KEYBOARD SCANNING The letter O key in K mode produces the command POKE, which requires two numeric parameters. POKE X,Y puts the value Yin the RAM address X. POKE is a command, with two operands; PEEKis a function, with one. The command is read by 1B29 STMT L 1 referring through the syntax offset table 1A48 to the syntax parameter table 1A7A.1AB1 P POKE causes a jump via 1C7A CLASS 08 - which collects thetwo parameters - 1C10 CLASS OO and 1C16 JUMP C R to the executive routine 1E80 POKE. POKE subroutine 1E80 Called only from 1AB1 P POKE in the syntax parameter table; executes the BASIC POKE X,Y command. Could be called fromm/c, but unlikely to be useful, as LD (BC),A etc achieve the same object. Input parameters: none - X and Y (last) are the last two values on the calculator stack. Action: call 1E85 TWO PARAM to put X in BC and Y in A; the execution is then just LD (BC),A. Exit: RET. Output parameters: BC and A as shown; the two values havebeen removed from the calculator stack. PO MSG subroutine 0C0A see also messages, tables Prints the A'th message in a message table; for example the report messages at 1391. The actual printing out is done by the calls to 0010 PRINT A 1 in PO SAVE. The messages may each be of any length, but there can beat most 256d of them in any one table; the end byte of each message is an_inverted_character, ie it has its hi bit set. The codes of the message are therefore restricted to the values zero-> 7Fh/127d; so messages cannot contain tokens, but besides letters, numbers and symbols, they can consist of or contain sequences such as 22,0,0,16,6 (decimals), equivalent to BASIC AT 0,0; INK 6 A useful subroutine for m/c programmers, especially for "computed messages" or messages which are required more than once in a m/c program. A little care is needed in handling_leading_spaces, since the subroutine is geared to print a single space before some of the tokens. A leading space will be printed if bit zero of FLAGS is zero and if the call to 0C41 PO SEARCH from PO TABLEreturns with no carry; ie if - the message number is 20h/32d or more, and - the first code of the message is 41h/65d or more, ie a letter or certain symbols. If your message table has more than 32d entries it will be necessary to set bit zero of FLAGS to avoid a leading space for the later ones. The tables in ROM, except for the tokens table, are limited to 32d entries; there is no saving in bytes by using longer or shorter tables. In the token table at 0095, the only tokens printed witha leading space are OR, AND, LINE, THEN, TO, STEP and the command tokens; not <=, >= and <>, whose first code is less than41h/65d. At the start of an input line and after a space, the cursor or a TAB, the flag is set to suppress the leading space, but after a colon it will appear. [In the notes on 1865 OUT LINE1, 1925 OUT SP 2 and 1A1B OUT NUM 1 "leading spaces" refers a little confusingly to something slightly different: that when a line has a number lessthan 1000d, the line number is printed "right justified", with one space before the numbers 100 -> 999d, two before 10 -> 99d and three before 1 -> 9.] _Trailing_spaces, a space printed after the message, are never printed by calls to PO MSG; PO TOKENS will print them in some cases, but it only prints messages from the tokens table at0095. A call to 0C13, 3 bytes after PO TOKENS, with your own message address in DE, will produce a trailing space if - the last code of the message is "$", or a letter, or one of the symbols following "Z" and "z" in the ASCII coding - and the message number is 3 or more. This is done on exit to PO SAVE. In handling the tokens, this means the subroutine printsa trailing space after all tokens excluding the first three RND,INKEY$ and PI, and excluding <=, >=, <>, OPEN (hatch) and CLOSE (hatch). Input parameters: DE holds the base address of the message table; this address should hold a byte with bit 7 set, otherwise PO SEARCH will step on till it finds such a byte and count that as the base of the table - A holds the message number; the first message in the table being number zero. Action: put a zero signal on the machine stack to suppress the trailing space - jump on to PO TABLE. _0C10_PO_TOKENS (the entry point for printing out tokens RND -> COPY): get the base address of the token table - put the message number on the stack as trailing space signal. _0C14_PO_TABLE: call 0C41 PO SEARCH, which finds the start of the indexed message; it returns with carry to signal "no leading space" - if carry is set jump on to PO EACH - (leading space enabled) make a space byte 20h - if bit zero of FLAGS is zero call 0C3B PO SAVE to print the space; the leading space flag. _0C22_PO_EACH: read a code from the message - zero its hi bit - call 0C3B PO SAVE to print it out - read it again and double it; this sets the carry flag if the code is 80h or more, ie if its hi bit is set to signal "last character" - if it was < 80h/129d loop back to PO EACH to read the next code - (the last code has been printed) get the trailing space signal from the machine stack - if the last code was 24h/36d "$", which after doublingwill be 48h/72d, jump on to PO TRSP; tokens INKEY$, SCREEN$, VAL$, STR$, CHR$. All these except INKEY$ always have a trailingspace - if the last code after doubling was less than 82h/130dreturn; tokens <=, >=, <>, OPEN and CLOSE with hatch don't have a trailing space. _0C35_PO_TRSP: if the trailing space signal is two or less, return; tokens RND, PI, INKEY$ and non-token messages never have a trailing space - (trailing space required) make a space byte and exit. Exit: RET, from PO EACH or PO TRSP, if no trailing space is printed, otherwise into 0C3B PO SAVE to print the space. Output parameters: 20h in A if space is to be printed. Called from: 078A LD TYPE 0970 SA CONTRL 0C88 PO SCR 2 1219 RAM SET 133C MAIN 5 (twice)