80-Bus News

  

March–April 1984, Volume 3, Issue 2

Page 37 of 51

POKE – Easiest shown as an example: POKE&C000,252,253,254,255 etc. This places the hex code for 252d into location C000H,253d into C001H,254d into C002 etc.

DOKE – As for POKE above only, of course, in double byte form.

LIST – Followed by up to three values. The first value is the line to list from, the second is the number of lines to list at a time before pausing and the third is the line number to list up to. The default value of lines to list at a time, as supplied is 65535 but this can be altered to suit your taste. e.g. LIST 300,10,1000 will list lines 300 to 1000 pausing every 10 lines until a key is hit to display the next ten. The value of ten lines at a time will remain until set otherwise by a command such as LIST,5 when the whole program will start to be listed pausing every 5 lines displayed. A nice feature of XBASIC is that it is not necessary to press ESC to abort a listing. During a pause, any of the cursor keys will abandon the listing while at the same time moving the cursor in the desired direction in order to make an edit. Listings are made obvious that they are XBASIC format by the fact that the start of each line is indented by two spaces on the VDU. Another interesting point is that graphic characters are listed as their true representation rather than their reserved word counterpart.

MON – Abreviated form of the MONITOR command available in ROM BASIC.

POS – POS(J) where J is an expression which must evaluate to an integer in the range 0 to 255 is used to obtain the current output column or row position according to the value of J.

POS(0) returns the print column count up to a maximum of 255 when it is zeroed. It is independent of screen size. It is a command mainly used in conjunction with printers.

POS(1) returns the current column position of the cursor on the VDU.

POS(2) returns the current row position of the cursor on the VDU. The latter two are designed to be used alongside the PRINT@ facility.

PRINT@ – Allows printing of expressions at specified points on the screen. Similar in use to the ROM BASIC SCREEN command except that the coordinates 0,0 are from the top left of screen. The coordinates may be up to 255 and in this case wrap-around will occur.

PRINT# – When data files are open PRINT# followed by strings or numerical variables will allow writing to the file.

INPUT# – As above but in the reverse direction! Superbly easy to use.

SET – As for ROM BASIC except as with the PRINT@ command above the coordinates 0,0 are at top left. Incidentally, the SET command is not followed by the coordinates within brackets as it must be within ROM BASIC. Similar rules apply to the RESET command.

RND – RND(1), as for ROM BASIC, returns a random number in the range 0 to 1 although it is a true random number, the routine making several uses of access to the refresh register of the Z80 CPU.

RND(0) returns the last random number produced.

RND(I) where I is in the range 2 to 65535 will return an integer random number ranging from 0 to I-1. e.g. RND(9) produces an integer random number in the range 0 to 8.

Page 37 of 51