Club 100 Library - 415/939-1246 BBS, 937-5039 NEWSLETTER, 932-8856 VOICE HISTLD.100 and HISTPT.100 are used to time and analyze BASIC programs. The relative time spent in each program line is recorded. This data can be viewed graphically after the user's program has finished. This type of histogram is used to determine where a program spends its time. Concentrating on speeding up slow sections of code should significantly speed up the entire program. BASIC Program Line Number Histogram Generation and Viewing Copyright Polar Engineering and Consulting 1985 HISTLD.100 checksum: 90,679 HISTPT.100 checksum: 124,546 Introduction: HISTLD.100 and HISTPT.100 are used to time and analyze BASIC programs. The relative time spent in each program line is recorded. This data can be viewed after the user's program has finished. HISTLD.100 generates the necessary machine code to log and analyze the timing information. HISTPT.100 displays the timing information graphically or in a file "HIST%.DO". This type of histogram is used to determine where a program spends its time. Concentrating on speeding up slow sections of code should significantly speed up the entire program. Producing a histogram: 1) DOWNload HISTLD.100 and HISTPT.100. Save both on cassette for future use. 2) RUN "HISTLD" to create HISTML.CO. Save "HISTML.CO" on cassette or disk for future use. Use HISTLD if you need to relocate HISTML. 3) LOAD "prog", the program you want to analyze. In the first line of the program insert: RUNM"HISTML". Be sure that the HISTML machine code does not interfere with any machine code your program may be using. HISTML uses 2309 bytes starting at its low address. 4) RUN "prog", to generate the timing information. 5) RUN "HISTPT", to view the timming informaion. Histogram resolution: Timing information is logged for up to 1000 lines (or groups of lines). If the largest line number less than 1000, each line will be timed individually. If the largest line number is more than 999 and less than 10000, lines which are not multiples of ten will be timed together with other lines in the same decade. If the largest line number is more than 9999, lines which are not multiples of one hundred will be timed together with other lines in the same century. Special timing consideration: No time is logged while a program waits for keyboard input. An interactive program can be properly analyzed without considering input reaction time. Time spent in a line or a group of lines timed together can never exceed approximately 262 seconds. This means that lines which are executed for longer than that will only show 262 seconds, but will be displayed with an arrow head. HISTPT help: HISTPT displays the relative timing information graphically or in a file. Press "P" for interactive plot viewing. Press "S" to dump timing statistics into HIST%.DO. Interactive plot viewing allows you to view the histogram for all lines or a range. The scale of the histogram can also be adjusted. After each plot a ">"character will appear in the upper left corner of the screen. Press F8 to return to the menu. Press ENTER to change the viewing parameters. Press "Z" (or "z") to zero timing information for a range of lines. You will be prompted for the desired range. Zeroing times can be very useful when you are only interested in analyzing a portion of your program.