Bob’s Notebook: Short utility programs

See all articles from Sinc-Link v3 n4
Author(s): Bob Mitchell
Publication: Sinc-Link
Pub Details: Sinc-Link v3 n4 (Volume 3, Issue 4)
Date: July/August 1985
Pages: 9, 11

HEX TO DECIMAL & DECIMAL TO HEX CONVERSION PROGRAM

Sometimes, when working with machine code, you will find this utility handy. So MERGE it with the program you are developing.

Note: POKE 23617,236 changes the cursor to a flashing ‘?’

Hex to decimal & decimal to hex conversion listing
Hex to decimal & decimal to hex conversion listing

TIP

If you want to limit an input to numbers between 0 and 65535, add the following after any INPUT statement:

RANDOMIZE n

where n = the INPUT variable name.

If the input value exceeds these limits, you will get an Integer out of range report.

TIP

To SCROLL text one line at a time,

Use RANDOMIZE USR 2059

Use this in a loop for several lines [eg. FOR i=1 TO 6: RANDOMIZE USR 2059:NEXT i

TIP

Want to toggle upper/lower case? Use RANDOMIZE USR 3139 in your programs.


The following utility program will let you copy all 24 lines from screen to printer.

In fact, you can COPY any given number of lines from the top of the screen by changing one value: POKE 63002,n where n = the required number of lines times eight. [eg. POKE 63002,40 will COPY only the first five lines.

COPY 24 lines listing
COPY 24 lines listing

PUT SOME FLASH & COLOUR INTO YOUR LISTINGS

Using the extended mode ‘E’ (Caps Shift & Symbol Shift)

>with Caps Shift held DOWN.

 a) 1 to 7 = INK colours
 b)    8   = FLASH OFF
 c)    9   = FLASH ON
 d)    0   = INK OFF

>with Caps Shift NOT held down.

 e) 1 to 6 = PAPER colours
 f)    7   = PAPER OFF
 g)    8   = BRIGHT OFF
 h)    9   = BRIGHT
 j)    0   = BLACK
For INVERSE:

  Use j) + a)7 to start;
      f) + d   to stop.

For Combinations PAPER & INK:

  Use e) + a)  to start;
      f) + d)  to stop.

Note:

  If a line is already in INV
  VIDEO, treat INK as PAPER
  and PAPER as INK.

HOW TO INCREASE THE SIZE OF AN ARRAY WITHOUT LOSING ITS CONTENTS

1. DELETE all the program lines
   [DELETE 1,9999]
2. Assuming the array is
   R$(200,32):
     Type in the following:
      10 DIM T$(300,32)
      20 FOR X=1 TO 200:
      LET T$(X)=R$(X):NEXT X
3. ENTER 'GO TO 0'
     [This will move all the
      data into the new array.]
4. Now type in the following:
      10 DIM R$(300,32)
      20 FOR X=1 TO 200:
      LET R$(X)=T$(X):NEXT X
5. ENTER 'GO TO 0'

     [This will move the
      data into the newly
      sized original array.
6. SAVE "name" DATA R$()
7. ReLOAD the original program.
8. ENTER 'DIM R$(300,32'
9. ReLOAD the data
   [LOAD "" DATA R$()]
10. Adjust variables for
    number of records and
    last number entered.

This program may also be used to downsize an array when you want to reduce the data in file.

ON ERR : HOW TO USE

Determine the LINE at which the program auto-starts.

Just after this line put in a line: ON ERR GO TO 9990

Now add lines as follows:

9990 ON ERR RESET
9991 PAUSE 100
9992 ON ERR GO TO 9990
9993 ON ERR CONTINUE

Line 9991 may be replaced by other routines [eg. GO SUB 9900]


This program will let you save a screen to address 57000 and bring it back to the screen in an instant

Use RANDOMIZE USR 65300 to upload

and RANDOMIZE USR 65312 to download

SCREENSAVE listing
SCREENSAVE listing

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.