nikola-wan
Veteran Member
While searching my boxes of 4050 tapes, I found a tape labeled NICE UTILITIES and remembered I had previously captured and posted all the files in this directory in my repository five years ago:
https://github.com/mmcgraw74/Tektronix-4051-4052-4054-Program-Files/NICE_UTILITIES
File 13 was labeled "Fast Graphics to Plotter" written by Carl Hovey in Dec 1982 - and I remembered Carl Hovey was the author of the Tektronix 4051 Assembler document: program 11 in Tekniques V7 N4 Tape1!
I tried to run it and found it required the 4051 FAST GRAPHICs ROM Pack CALL "IMAGES" which I did not have at that time, so I put the program away.
I examined the CALL "EXEC" routine yesterday and looked at Carl's comments in the program and thought - I should be able to modify his program to display some of my R12 picture files.
His routine was called with this statement:
CALL "EXEC",B$,M,X,Y,X$
B$ was dimensioned as 3 characters and his program extracted 3 characters at a time from A$ which had previously been filled with the FAST GRAPHICS picture data from an ASCII file.
I then remembered I had lots of trouble with FAST GRAPHICS when I got a 4052R12 Graphics Enhancement ROM PACK and found the CALL "IMAGES" command would only work on the internal magnetic tape drive tapes - not GPIB devices including my Flash Drive.
Using the BASIC INPUT command to read the FAST GRAPHICS/R12 *.DAT image files did not work since INPUT terminates a string when a CR character is detected.
I worked around that issue by converting the ASCII DAT image files into BINARY files but encountered a different issue - 4050 BASIC limits BINARY strings to 8192 bytes, and most of the FAST GRAPHICS picture files are much larger than 8KB. I solved that limitation by dividing each image string into blocks. My original R12 viewer program READs binary string blocks and appends each string to form the complete image string that can be displayed with CALL "RDRAW".
However - the largest R12 DEMO TAPE file "Solar System" is 27KB which is the largest image that can be loaded on a 40551 with 32KB of RAM when you include the viewer program.
My binary block based technique to load the images in my original FAST GRAPHICS/R12 PICTURE viewer program still had the same size limitation until I developed a technique to allow each individual data block to be displayed immediately. This technique satisfies the Fast Graphics/R12 requirement that the first vector MUST be a MOVE. I address that requirement in my latest files by taking the last vector in a block and converting it to a MOVE and inserting it at the beginning of the next block - regardless of whether the vector was a MOVE or DRAW.
I wanted to try Carl's assembly program with the 4051 Emulator - and since I was unable to use the example file, I decided to use my Snoopy picture file. Since I have experimented with various binary block sizes, I examined my PICTURE viewer and found that it concatenates 257 byte blocks to create a single string which is viewed with a single CALL "RDRAW" command. I don't remember why I chose 257 bytes as the block size - since the GPIB and MAG TAPE buffers only hold 256 bytes - therefore the BASIC ROM has to perform two reads to get the data for the block.
Another Fast Graphics/R12 image requirement is a string to be displayed MUST have a length evenly divisible by three or you get an error. 257 and 256 are NOT evenly divisible by three but 255/3=85. For my latest R12 technique to allow each block to be immediately displayed I need to leave 3 bytes of space for the initial MOVE vector from the previous block.
Carl's program solves another FAST GRAPHICS/R12 limitation of only displaying to the FAST GRAPHICS to the CRT by NOT using a FAST GRAPHICS command to display the vector but using a PRINT statement. The 4050 PRINT statement can use the primary address of the display (32) or a GPIB plotter like the 4662 - or even the Option 01 backpack serial interface (40) to the 4662 plotter. Carl's routine speeds up the conversion of the three ASCII characters in an R12 vector to the 8-byte floating point format for ALL 4050 BASIC program numeric variables.
I have attached a zip of my modified program that currently does not include Carl's code to change the scale of the plot if using a 4662/4663 plotter.
I also attached a zip file containing my disassembly of Carl's 4051 assembly code. I am a little puzzled by the stack references and put question marks on the variable names where the index register seemed to be pointing to the B$ variable. Since Carl's code pulls variable address pointers from the stack - I have included snippets of the CALL "EXEC" document I found and translated from German to English in my disassembly in the next post.
https://github.com/mmcgraw74/Tektronix-4051-4052-4054-Program-Files/NICE_UTILITIES
File 13 was labeled "Fast Graphics to Plotter" written by Carl Hovey in Dec 1982 - and I remembered Carl Hovey was the author of the Tektronix 4051 Assembler document: program 11 in Tekniques V7 N4 Tape1!
I tried to run it and found it required the 4051 FAST GRAPHICs ROM Pack CALL "IMAGES" which I did not have at that time, so I put the program away.
I examined the CALL "EXEC" routine yesterday and looked at Carl's comments in the program and thought - I should be able to modify his program to display some of my R12 picture files.
His routine was called with this statement:
CALL "EXEC",B$,M,X,Y,X$
B$ was dimensioned as 3 characters and his program extracted 3 characters at a time from A$ which had previously been filled with the FAST GRAPHICS picture data from an ASCII file.
I then remembered I had lots of trouble with FAST GRAPHICS when I got a 4052R12 Graphics Enhancement ROM PACK and found the CALL "IMAGES" command would only work on the internal magnetic tape drive tapes - not GPIB devices including my Flash Drive.
Using the BASIC INPUT command to read the FAST GRAPHICS/R12 *.DAT image files did not work since INPUT terminates a string when a CR character is detected.
I worked around that issue by converting the ASCII DAT image files into BINARY files but encountered a different issue - 4050 BASIC limits BINARY strings to 8192 bytes, and most of the FAST GRAPHICS picture files are much larger than 8KB. I solved that limitation by dividing each image string into blocks. My original R12 viewer program READs binary string blocks and appends each string to form the complete image string that can be displayed with CALL "RDRAW".
However - the largest R12 DEMO TAPE file "Solar System" is 27KB which is the largest image that can be loaded on a 40551 with 32KB of RAM when you include the viewer program.
My binary block based technique to load the images in my original FAST GRAPHICS/R12 PICTURE viewer program still had the same size limitation until I developed a technique to allow each individual data block to be displayed immediately. This technique satisfies the Fast Graphics/R12 requirement that the first vector MUST be a MOVE. I address that requirement in my latest files by taking the last vector in a block and converting it to a MOVE and inserting it at the beginning of the next block - regardless of whether the vector was a MOVE or DRAW.
I wanted to try Carl's assembly program with the 4051 Emulator - and since I was unable to use the example file, I decided to use my Snoopy picture file. Since I have experimented with various binary block sizes, I examined my PICTURE viewer and found that it concatenates 257 byte blocks to create a single string which is viewed with a single CALL "RDRAW" command. I don't remember why I chose 257 bytes as the block size - since the GPIB and MAG TAPE buffers only hold 256 bytes - therefore the BASIC ROM has to perform two reads to get the data for the block.
Another Fast Graphics/R12 image requirement is a string to be displayed MUST have a length evenly divisible by three or you get an error. 257 and 256 are NOT evenly divisible by three but 255/3=85. For my latest R12 technique to allow each block to be immediately displayed I need to leave 3 bytes of space for the initial MOVE vector from the previous block.
Carl's program solves another FAST GRAPHICS/R12 limitation of only displaying to the FAST GRAPHICS to the CRT by NOT using a FAST GRAPHICS command to display the vector but using a PRINT statement. The 4050 PRINT statement can use the primary address of the display (32) or a GPIB plotter like the 4662 - or even the Option 01 backpack serial interface (40) to the 4662 plotter. Carl's routine speeds up the conversion of the three ASCII characters in an R12 vector to the 8-byte floating point format for ALL 4050 BASIC program numeric variables.
I have attached a zip of my modified program that currently does not include Carl's code to change the scale of the plot if using a 4662/4663 plotter.
I also attached a zip file containing my disassembly of Carl's 4051 assembly code. I am a little puzzled by the stack references and put question marks on the variable names where the index register seemed to be pointing to the B$ variable. Since Carl's code pulls variable address pointers from the stack - I have included snippets of the CALL "EXEC" document I found and translated from German to English in my disassembly in the next post.










