Some comments on bitim.b1, a utility to create and print 1 or 22 one-line screen files to a 24-pin or bubble jet printer

Author(s): Larry Crawford
Publication: Update Magazine
Pub Details: Update January 1994
Date: January 1994
Pages: 21-24

Larry Crawford / [address omitted] / London Ont / Canada
[phone number omitted] Public Domain 10 Oct 93

For background information on 24-pin operation see the Tasword file “lbibkg.CT” or choose option [C] of the disk menu.

When loaded, a prompt will ask you to enter the name of the screen file. This demo disk contains “mag.C1” and “alb.C1”.

It will probably be prudent to have only one file on a disk with its name on the label so that you will know what to type in at this point.

Since the screen name must be in variable ‘s$’, never RUN the program after you have broken into it. Use <GO TO 1> instead. Should you inadvertently use <RUN> then GO TO <8888> after the error message and reenter the screen file name.

After you have entered the screen name, a menu will appear, offering a choice of 13 options:

               BIT-IMAGE MENU

        A: CREATE 1 FILE FROM SCREEN
        B: CREATE 22 FILES FROM SCREEN

        C: PRINT 1 FILE IN SINGLE DENSITY
        D: PRINT 1 IN DOUBLE DENSITY
        E: PRINT 1 IN TRIPLE DENSITY
        F: PRINT 1 IN HEX DENSITY

        G: PRINT 22 FILES IN SINGLE DENSITY
        H: PRINT 22 IN DOUBLE DENSITY
        I: PRINT 22 IN TRIPLE DENSITY
        J: PRINT 22 IN HEX DENSITY

        K: PRINT 1 FILE TO 2040 PRINTER
        L: PIRNT 22 FILES TO 2040

        M: DISK MENU

Six of these deal with one line file: you may create a file whose name will be the first 3 characters of the screen file name plus “1.C1”.

Yuu may print it to the large printer in one of four densities or the 2040 printer. The 2040 does not produce good quality printouts, of course, nor are circles round. It does provide a quick and easy way of checking the contents of the line file, especilly to see if it is inverse.

The others deal with a full screen: you may create 22 line files whose names will be first 3 characters of the sceen file name plus “n.C1” where n is the number of the line file. A message at the bottom of the screen inform you which file is being created or saved. The process of dealing with all 22 files is about 6 minutes.

You may print them to a large printer or the 2068. All 22 files will load and print in about 45 seconds.

When any of these options is selected, you will be prompted to choose between a normal or inverse file. Remember that a normal screen image is actually a negative so that if you want to print out a positive bit image copy, you will probably want to choose the inverse option.

The final option is to return to the disk menu.

SOME COMMENTS ON “bitim.B1”

LINE 10: Defines the BEEP subroutine ‘bp’. Assigns to ‘h$’ the first three characters of ‘s$’, the name of the screen file plus “.”. Sets the BORDER, PAPER, and INK colors. Sets the keyboard input to lower case.

LINE 20: The menu.

LINE 30: Inputs and error traps the menu choice.

LINE 35: Reboots the AUTOSTART if the <M> option was selected.

LINE 40: Prompts for an INVERSE? creation or printing of the file(s).

LINE 60: Sets the number of line files to be created. Transfers control to line 140 to create the file(s).

LINE 70: If the large printer is to be used, loads the code routine. Determines the number of lines to be handled.

LINE 80: Waits for the printer to be put on line before attempting to print. NOTE: the test value used here is 236. Change it if necessary to conform to your printer interface.

LINE 90: Defines the address that the code routine uses to determine the number of times a bit image DATA byte is to be sent to the printer (LET den=24394). Sets the left margin and Line Feed spacing.

LINES 100 to 140: Set the parameters for the density of the large printer bit image printout.

LINE 150: Determines the number of lines to be sent to the 2040 printer and jumps to 5000 to do so.

LINE 160: Displays the screen file if all 22 line files are to be printed. This is not needed but lets the user know what output to expect.

LINE 170: Sets up a loop to send ‘nf’ lines to the printer. Sets the address for the start of each line’s data to 26296 (5B00).

LINE 180: Defines the name of the line file and loads it into the 2068 printer buffer.

LINE 190: Sends codes to the printer to tell it how many bytes of bit image data to expect.

LINE 200: Calls the code routine at 24331 to send the data to the printer (see Tasword file “bidis.CT” for a disassembly of this routine). Terminates the loop. Returns to menu after all files have been sent.

LINES 500 to 530: Subroutine to send codes to the printer. NOTE: the test value of 236 in line 520 may need to be changed.

LINE 4000: The start of the “create-a-file” routine. This first line loads the screen file, initializes the line file number to zero, and defines the address of the first data byte as the beginning of the printer buffer.

LINE 4005: Sets up an ‘s’ loop to look after the 3 sections of the upper screen. Sets up an “l” loop to take care of the 8 print lines in each of the top two sections and the 6 lines in the bottom one. Increments the line file counter and tests it to see if all the desired lines have been created. If so, control passes back to the menu.

LINE 4010: Assigns to ‘f$’ the line file name. This will be the first three characters of the screen file name plus the line number plus “.C1”.

Initializes the pixel column counter, ‘k’, to -1. This will be incremented 256 times for each of the print lines.

Sets up the scan line loop, ‘i’, which points to the first to last pixel scan lines in steps of 256.

Sets up the print column loop, ‘j’, to point to each of the 32 columns in steps of one.

Assigns to the data byte, ‘b’, the contents of the screen file pointed to by ‘i’ and ‘j’.

LINE 4015: If an inverse file was requested, address 26671 will contain a value of 1 and the data byte will be subtracted from 255 to change all its zeros to ones and vice versa.

LINE 4020: Pokes the byte into the printer buffer and repeats the process for the next column and scan line.

Saves the resulting 256 bytes.

LINE 4030: Repeats for each of the 8 print lines in the 3 thirds of the screen except for the last one: line 4005 returns to the menu after the sixth print line of the bottom third.

LINES 5000 to 5030: The “send-to-2040” subroutine. Lprints the required number of bit image files after converting them to inverse if requested.

LINE 7000: The BEEP subroutine.

LINE 8888: The entry point when the program is first loaded. Prompts for the name of the screen file to be used, then passes control to line 1 to initialize variables and call up the menu.

LINE 9999: Saves the program to run at line 8888.