Home
Faster_Basic_for_the_OSI
Contents
1. 1 Section of the multiplication routine from Microsoft s disk BASIC written for Ohio Scientific computers This section can be replaced with a single ROR instruction ROR 73 where the dollar sign denotes a hexadecimal 73 The replacement ac complishes the same task in much less time LOC CODE MNEMONIC TIME uS 1946 A9 80 LDA 00 2 1948 90 02 BCC 194C 3 194A A9 80 LDA 80 2 194C 46 73 LSR 73 5 194E 05 73 ORA 73 3 1950 85 73 STA 73 3 that on the average the instruction at hexadecimal 194A is executed only half of the time This sequence is also in a loop that is repeated for all 8 bits of a multiplier byte requiring a time of 680 us for each subroutine call Finally the subroutine is called four sometimes five times for each floating point multiplication Thus a total of 2 72 ms is used for each floating point multiplication However the entire listing can be replaced by the single instruction ROR 73 This instruction requires only 5 ps to execute for a total time of 800 ps for each floating point multiplication a saving of 1 92 ms for each call to the multiplication routine My own tests with the changes have indicated that BASIC requires approximately 4 9 ms to complete a floating point multiplication on a 9 digit number whereas with the changes it takes only 3 1 ms This is an increase in speed of 37 Here s Why S 100 CONTROLLER BOARD S 100 REAL TIME CLOCK BOARD 159
2. J Circle 272 on inquiry card Litton Systems For Business 6809 SOFTWARE POWER TOOLS BY MICROWARE OS 9 MULTIPROGRAMMING OPERATING SYSTEM true multitasking real time operating system for timesharing software development database process control and other general applications This versatile OS runs on almost any 6809 based computer WE UNIX like file system with hierarchical directories byte addressable random access files and full file security Versatile easy to use input output system is hardware in dependent and expandable E Powerful shell command interpreter features 1 0 redirection multiple job stream processing and more In cludes a complete set of utility commands E OS 9 Level Two uses hardware memory management and can address over one megabyte of memory Also includes pipes and filters for inter process data transfers E OS 9 Level One runs on systems without memory management hardware having up to 56K memory _JOS 9 Level Two 495 Level One 195 BASIC09 PROGRAMMING LANGUAGE SYSTEM xtended BASIC language compiler interpreter with integrated text editor and debug package Runs standard BASIC programs or minimally modified PASCAL programs E Permits multiple named program modules having local variables and identifiers Modules are reentrant position independent and ROMable W Additional control statements for structured programming IF THEN EL
3. computers and don t have BASIC permanently stored in read only memory there is a way to change Ohio Scien tific s disk BASIC to use the ROR instruction If you are using the OS 65D disk operating system the program in listing 4 will permanently change your BASIC for 8 inch disks It simply loads a part of the BASIC interpreter into memory POKEs in the required changes and stores the changed code back on disk For 5 inch disks statement 80 should be changed to read 80 DISK CA 4200 03 1 and statement 150 should be 150 DISK SA 03 1 4200 8 PUT TIME AND REMOTE CONTROL IN YOUR APPLE II The THUNDERCLOCK PLUS is two peripheral systems on one card for your APPLE II OR II PLUS An accurate reliable real time clock calendar and an interface for the popular BSR X 10 Home Control System The THUNDERCLOCK clock calendar makes accurate time and date available to your programs month date day of week hour minute and second in any of four software selectable formats On board batteries keep your THUNDERCLOCK running when your APPLE II is turned off for up to four years before battery replacement On card 1K firmware makes reading or setting the time easy from APPLESOFT or INTEGER BASIC PASCAL or assembly language programs And it provides software selectable interrupts at any of three rates 64 256 or 2048 interrupts second THE PLUS Add THUNDERWARE S X 10 ULTRASONIC INTERFACE OPTION to your THUNDERCLOCK and your
4. for foreground background operation Complete software in BASIC to Set and Read clock Listing 2 Part of a routine accessed by the addition and sub traction routines in Ohio Scientific s disk BASIC This section can be replaced by the single instruction ROR 02 X LOC CODE MNEMONIC TIME uS 1854 A9 00 LDA 00 2 1856 90 02 BCC 185A 3 1858 A9 80 LDA 80 2 185A 56 02 LSR 02 X 6 185C 15 02 ORA 02 X 4 185E 95 02 STA 02 X 4 Other routines that access the multiplication routines also execute more rapidly For instance the logarithm routine takes approximately 34 8 ms to complete a 9 digit logarithm with the changes it takes only 21 9 ms This is also an increase in speed of 37 Similar mistakes were found in a section of the nor malization routine starting at hexadecimal 1854 accessed by the addition and subtraction routines see listing 2 This sequence is repeated two more times It can all be replaced by the instruction ROR 02 X Another interesting section of the routine occurs at hexa decimal 1879 see listing 3 This can be replaced by the instruction ROR A which takes only 2 ps to execute The actual increase in speed for the addition and subtraction routines with the changes installed was too difficult to measure since the routines are fairly rapid compared to the BASIC loops and other program segments used to test Circle 360 on inquiry card OWEST PRICE BEST QUALIT NORTH STAR InterSystems N
5. this program didn t know what he was doing How many times have you seen a program and said that Well I never thought I would say it while looking at the Microsoft multiplica tion routines written for Ohio Scientific s BASIC Multiplication routines written in software are slow especially when accurate to 9 digits Programmers are always trying to optimize mathematical routines for speed That s why I was surprised that the main loop for the multiplication routine contained line after line of inef ficient instructions To comprehend the problem you need to understand how a software multiplication routine works For multiplication of large numbers the process is similar to the longhand method taught in school The two numbers to be multiplied the multiplier and the multiplicand are stored in the floating point accumulator and the alternate floating point accumulator respectively These ac cumulators are usually 4 to 5 bytes in length and preferably located in page 0 memory The low bit of the multiplier is checked to see if it is set if it is the multipli cand is added to the product initially 0 if it is not no addition occurs Next both the multiplier and the product are shifted 1 bit right or alternately the multiplier is shifted right and the multiplicand is shifted left and the low bit on the multiplier is checked again This process is repeated for each bit in the multiplier Four bytes are required for 9 digit
6. 08 232 24 96 40 DATA 102 115 102 116 102 117 102 118 102 189 152 50 DATA 74 208 214 96 60 REM SET UP USR FUNCTION AND PUT AND GET ROUTINES 70 POKE 8778 192 POKE 8779 36 80 POKE 9432 243 POKE 9433 40 90 POKE 9435 232 POKE 9436 40 100 REM DISK ADDRESS 1800 0C00 NUMBER OF BYTES 0200 110 REM RAM ADDRESS 7800 120 CB 9889 FOR I l TO 8 READ D POKE CB I D 130 REM CALL IN A PORTION OF BASIC TO 7800 140 ER USR 0 160 Al 30804 REM 30804 7854 170 A2 31046 REM 31046 7946 180 REM POKE IN THE CORRECTED CODE 190 FOR I 0 TO 12 READ D POKE Al I D NEXT I 200 FOR I 0 TO 14 READ D POKE A2 I D NEXT I 210 REM SAVE THE CORRECTED BASIC BACK ON DISK 220 ER USR 1 CLOSE 230 END NEXT I
7. ECT COLOR RAINBOW 385 ERMINALS Z 19 725 E om CENTRAL DATA 64K RAM 599 EZ 80 Machine Language Tutor 25 ITHACA MEMORY 8 16 bit64K 845 EZ CODER Translates English to BASIC INTERTU BE IIl only 725 SEATTLE MEMORY 8 16 BIT 16K 4Mhz 71 275 ECOSOFT FULL ACCOUNTING PKG DIP 81 PRINTER 395 SSM KITS Z 80 CPU 221 315 only VIDEO BRD V83 4Mhz 412 BOX OF DISKETTES 29 ANADEX PRINTER DP 9500 1 1349 SECRETARY WORD PROCESSOR CAT NOVATION MODEM 169 The Best 99 TARBELL DISK CONTROLLER DD 445 TEXTWRITER III Book Writing Program MICROTEK 675 ECONORAM 2A 8K ASSM 179 112 NSSE 1 22 amp P01 TERRIFIC PROGRAMS GOFAST NORTH STAR BASIC Speeder ONLY 10 EACH Upper 71 NEC PRINTER 2569 NORTHWORD 294 MAILMAN 234 Which Computers are BEST TRACTOR THIMBLE RIBBON INFOMAN 364 BROCHURE FREE TARBELL COMPUTER PHONE North Star Documentation AA soa AMERICAN SQUARE COMPUTERS BEATS ADV PRICES S quare r a E Computers 919 889 4577 KIVETT DR JAMESTOWN N C 27282 919 883 1105 CP M is a registered trademark of Digital Research Inc Circle 16 on inquiry card BYTE May 1981 239 Listing 3 Section from the normalization routine used by the addition and subtraction routines in Ohio Scientific s disk BASIC This section can be replaced by the instruction ROR A LOC CODE MNEMONIC TIME uS 1879 08 PHP 3 187A 4A LSR A 2 187B 28 PLP 4 187C 90 02 BCC 1880 3 187E 09 80 ORA 80 2 1880 c8 INY them I did notice that BASIC testing lo
8. ENCASED CONTROLLER 184 TRS 80 Apple II etc ENCASED CONTROLLER amp REAL TIME CLOCK TRS 80 Apple II etc 269 APPLE CLOCK BOARD 129 send check SCITrONics Inc or money 523 S Clewell St P O Box 5344 order to Bethlehem PA 18015 215 868 7220 Please list system with which you plan to use peripheral Master Charge and Visa accepted PA residents add sales tax COD s accepted 238 May 1981 BYTE Publications Inc From Ballet on Broadway to Billiards in Dallas TE poopie are ng unique ways to use the Powerful SciTronics REMOTE CONTROLLER Whether it s the intricate lighting for a Broadway Ballet or the sim ple remote lighting of pool tables in a Dallas billiards hall people are finding out SciTronics Remote Controller can meet their needs Controls 256 BSR remote switches not just 16 Hardware driven requires minimum software No ultrasonic link prevents erratic operation 159 No BSR command module necessary Real Time Clock gives Remote Controller an added dimension Real Time Clocks are now available to make your remote controller even more powerful The RTC feature allows for energy consumption scheduling event scheduling and much more Your imagination is your only limitation when it comes to the ways which this RC RTC combination can be used Real Time Clocks feature H Lithium battery back up 4 Crystal controlled accuracy 002 Clock generates interrupts seconds minutes hours
9. ORPORATED P O Box 13322 Oakland CA 94661 Circle 410 on inquiry card ete The Monroe Educational Computer What takes the Educational Computer to the head of the class is that so many of its standards wind up as costly extras on other microcomputers Features like e 96K of system RAM including 32K of user RAM e over 320 000 bytes of built in flexible disc storage e typewriter style upper and lower case keyboard 10 key numeric pad e 8 key row of user definable keys providing 16 additional keyboard functions e extended BASIC language e three serial RS232 ports for communications printers and peripherals e high and low resolution color graphics with color text Monroe gives you much more than hardware You will have access to a full range Monroe developed software library that makes this computer so versa tile so powerful it will serve educational needs from Fr primary to secondary to college levels I Monroe Systems For Business BYTE 5 81 With Monroe you ll never be left alone with a computer and l The American Road l nowhere to go for help The Educational Computer will be sold f Morris Plains NJ 07950 i leased serviced and personally installed through Monroe s 350 J Att Monroe Education Center i branch offices nationwide Tepe For full details fill out the coupon and send to Monroe I I Education Center ts I I Educational facility Address l l City H MONROE 7 b
10. SE FOR NEXT REPEAT UNTIL WHILE DO LOOP ENDLOOP EXITIF ENDEXIT E Allows user defined data types and complex data structures Five built in data types byte integer 9 digit floating point string and boolean W Runs under OS 9 Level One or Level Two L 195 OTHER OS 9 FAMILY SOFTWARE E Stylograph Screen Oriented Word Processor E Interactive Assembler E Macro Text Editor E Interactive Debugger BASIC 9 and OS 9 are trademarks of Microware and Motorola UNIX is a trademark of Bell Laboratories Most software is available on ROM or diskette in versions for many popular 6809 computers Contact Microware for specific availability For compatible hardware see GIMIX ad page 142 MICROWARE Microware Systems Corp Dept B2 5835 Grand Avenue Des Moines Iowa 50304 515 279 8844 TWX 910 520 2535 242 May 1981 BYTE Publications Inc Circle 263 on inquiry card System Notes I have not been able to test these changes for the 5 inch systems and I suggest that you exercise caution in using them For systems that use the OS 65U operating system the program in listing 5 should be used to change your BASIC Ohio Scientific often boasts of supporting the fastest BASIC of any of the popular personal computers and it can give you a great sense of satisfaction to make it run even faster I have run BASIC with these changes for four months and have noticed that all of my
11. TRS 80 Models amp Ill SuperSoft LISP allows the TRS 80 to become a complete Artificial Intelligence laboratory It is the tool that takes you to the frontier of Com puter Science The SuperSoft LISP is a complete and full im plementation It is NOT a subset It contains an efficient garbage collector which optimizes the usage of user RAM and supports the TRS 80 graphics Below are some features Runs in 16k level II with only 6K overhead Fully implements atom property list structure PROG is supported FUNARG device is implemented Efficient garbage collection Complete with LISP editor and trace Allows complete range of single precision numeric data Works with old as well as new ROMs Contains 97 functions e Sample Programs The LISP package is supplied on tape or discette and with a complete user manual cassette version 75 00 requires 16K level II Disk version requires 16K disk 100 00 manual only 15 00 All Orders and General Information SUPERSOFT ASSOCIATES P O BOX 1628 CHAMPAIGN IL 61820 217 359 2112 Technical Hot Line 217 359 2691 answered only when technician is available SuperSoft First in Software Technology TRS 80 TRADEMARK TANDY CORP 236 May 1981 BYTE Publications Inc Faster BASIC for the Ohio Scientific John A Sauter Department of Biochemistry 5426 Med Sci I University of Michigan Ann Arbor MI 48109 I don t believe it The guy who wrote
12. loop IEEE 488 and high speed serial inputs Q T cover reduces noise to an office comfort level This is an optional feature to our standard sound dead ening case 1K standard buffer permits the 88G to print while receiving data The optional 2K buffer allows a 1920 character dump to the printer freeing the CRT Letter Quality Capability The 88G provides a selectable 11 x 7 serif style dot matrix for correspondence printing Cost Effective The 88G has more features than any other impact printer in its price class First compare the quality of the 88G then compare the price the 88G wins Single unit price is less than 800 Optional Ampi Micro Peripherals Inc 4426 South Century Drive Salt Lake City Utah 84107 801 263 3081 imk The Printer People California VITEK 714 744 8305 Colorado PLS Associates 303 773 1218 Florida GMI Distributors 305 894 3354 Ilinois Coombs amp Associates 312 298 4830 Massachusetts Eastmark 617 449 0050 Minnesota Bohlig amp Associates 612 922 7011 New Jersey Hansen amp Hughes 201 652 7055 Oregon Microwave 503 620 8150 Utah PLS Associates 801 466 8729 Type A Line 801 521 5310 International England Russet Instruments Ltd 0734 868147 Telex 849721 Phoenix Sigma International 602 994 3435 Telex 165 745 Sigma France IER Tel 333 67 81 Telex 620 289 Canada Norango 416 449 2761 Circle 248 on inquiry card BYTE May 1981 System Notes ee Listing
13. ops often executed approximately 10 faster with the changes I attribute this to the faster addition routine I suspected that the division routines would also con tain errors but discovered that the ROL instruction was used wherever it was needed The ROR instruction isn t necessary in division I immediately contacted Ohio Scientific and Microsoft to inform them of the problem Both replied with an ex planation that restored my faith in big name software companies Apparently earlier versions of the 6502 microprocessor did not include an ROR instruction but as customer demand grew MOS Technology incorpor ated an ROR instruction in later versions of the 6502 Un fortunately some of the earlier Ohio Scientific computers had already been sold with the old microprocessor Therefore Microsoft wrote its BASIC without any ROR THUNDERCLOCK PLUS instructions to make the software compatible with the earlier versions of the computer Listings 1 2 and 3 are actually macro expansions of the ROR instruction Macros are one line pseudoinstructions placed in an assembly language source listing When processed they are replaced by a predefined set of assembly language instructions and assembled into machine lan guage GW Microsoft assured me that this was done only for the KIM and Ohio Scientific computers All other versions of 6502 BASIC were written using the ROR instruction For those who have later versions of Ohio Scientific
14. orth Star Horizon 2 ITHACA INTERSYSTEMS 2A 2 5 Disk Drives 32K Double Den Factory assem amp tested Factory guaranteed List 3095 ony 2274 POWERFUL NORTH STAR BASIC FREE SUPERB FOR BUSINESS amp SCIENCE FACTORY ASSEMBLED amp TESTED LIST ONLY HORIZON 1 32K DOUBLE DEN 2695 1980 HORIZON 2 32K QUAD DENSITY 3595 2674 HORIZON 2 64K QUAD HARD DISK 9329 7149 HORIZON RAM ASSM 16K 389 32K 579 HORIZON RAM KIT SALE 16K 314 32K 469 HORIZON DISK DRIVE SALE DOUB DEN SAVE 315 NORTH STAR HARD DISK 18 Mb 4999 3929 PASCAL PLUS 14 18 OR 36 DIGIT PRECISION 249 SUPERBRAIN ZENITH Z 80A CPU 4 MHz 64K Dynamic RAM Front panel V O with interrupts FDCII Disk Controller 20 slot motherboard List 3595 You Pay Only 2795 PASCAL Z THE FASTEST PASCAL 375 GET READY FOR ITHACA S Z 8000 8086 16 BIT CPU amp SUPPORT CARD SEATTLE 575 MORROW 8 DISK DISCUS 2D CP M 600K ONLY 938 DISCUS 2 2 CP M 1 2 MEGA B 1259 ADD DRIVES 2D 650 2 2 975 2D DUAL CP M ONLY 1555 MORROW HARD DISK 26 000 000 BYTES LIST 4995 ONLY 3995 CP M IS INCLUDED SAVE ON MEMORY AND PROGRAMS SYSTEMS MEMORY 64K A amp T 4mHz RCA COSMAC VP 111 99 RCA COSMAC SUPERBRAIN QD 64K 2 89 48K List 3995 only 2995 List 2895 only 2299 599 VP 711 199 SYSTEMS MEMORY 64K BANK SEL
15. programs can send all 22 BSR X 10 commands so you can remotely control lights and appliances A full 128 dim bright levels And a powerful disk software package The THUNDERWARE SCHEDULER software lets you create schedules to control lights appliances security systems or almost any other electrical device The software includes SCUTIL the SCHEDULER utility that lets you make or change a schedule and SCHED executes your schedules in real time using the THUNDERCLOCK SCHED runs in the background so you can run other programs in the foreground The THUNDERCLOCK PLUS is a SYSTEM for your APPLE II Supported by intelligent easy to use firmware a powerful software package and good documentation Available through your dealer user s manual X 10 INTERFACE OPTION BSR X 10 Ultrasonic interface disk with SCHEDULER SOFTWARE amp demos and user s manual PASCAL SOFTWARE Suggested retail prices THUNDERCLOCK PLUS Clock calendar card with batteries and If your dealer doesn t carry the THUNDERCLOCK PLUS ORDER TOLL FREE VISA MC CALL 800 227 6204 EXT 307 Outside California 800 632 2131 EXT 307 California Only OR WRITE TO Disk with PASCAL interface for clock and X 10 interface and user s guide MANUALS ONLY each California residents add 6 sales tax BSR X 10 is a trademark of BSR USA LTD APPLE II is a trademark of APPLE COMPUTER INC 240 May 1981 BYTE Publications Inc THUNDERWARE INC
16. programs run faster than before especially those loaded with mathematical equations If you decide to incorporate these changes into your system I suggest that you first try them on an old copy of your operating system to en sure that the changes work on your computer W Listing 4 Program used with the OS 65D operating system and 8 inch disks Beginning at hexadecimal location 4800 the pro gram loads a portion of BASIC into memory then POKEs the appropriate ROR instructions into the mathematical routines and stores the revised BASIC back on the disk 10 REM DISK BASIC CORRECTION ROUTINE OS 65D 8 DISKS 20 DATA 118 2 118 3 118 4 104 106 200 208 232 24 96 30 DATA 102 115 102 116 102 117 102 118 102 189 152 40 DATA 74 208 214 96 50 REM SET UP TOP OF MEMORY TO 47FF 60 POKE 132 255 POKE 133 71 POKE 128 255 70 REM CALL IN A PORTION OF BASIC TO 4800 80 DISK CA 4800 04 1 90 Al 18516 REM 18516 4854 100 A2 18758 REM 18758 4946 110 REM POKE IN THE CORRECTED CODE 120 FOR I 0 TO 12 READ D POKE Al I D NEXT I 130 FOR I 0 TO 14 READ D POKE A2 I D NEXT I 140 REM SAVE THE CORRECTED BASIC BACK ON DISK 150 DISK SA 04 1 4800 B 160 END POKE 129 71 Listing 5 Program used with the OS 65U operating system This program does the same thing as listing 4 but begins at hexadecimal location 7800 10 REM DISK BASIC CORRECTION ROUTINE OS 65U 20 DATA 0 36 0 0 0 2 0 120 30 DATA 118 2 118 3 118 4 104 106 200 2
17. s of precision a great deal of bit shifting must go on In fact the bit shifting uses most of the time required for a multiplication routine Fortunately there is a convenient instruction in the 6502 microprocessor for shifting several contiguous bytes 1 bit to the right The ROR instruction shifts a byte 1 bit to the right with the carry shifted into the high order bit and the low order bit of the byte shifted into the carry Successive executions of the ROR instruction on con tiguous bytes will shift all of the bytes 1 bit to the right with the low bit of 1 byte shifting into the high bit of the next Listing 1 contains a portion of the Microsoft multipli cation routine for the 6502 It is part of the routine that shifts the product 1 bit right This sequence is repeated four more times in the subroutine and requires a total time of 85 us with a 1 MHz clock rate while assuming High resolution dot addressable graphics with vertical resolution of 72 dots per inch and up to 82 dots per inch horizontal resolution Single sheet feeder is very simple to use The only front load feeder available on the market today The Features Leac Integrated Paper Handling System Dual tractor friction feed allows use of pin feed roll or single sheet paper Versatile Interface Data input from most computers can be sup ported by the 88G RS232C serial and Cen tronics type parallel is standard Options can be added for current
Download Pdf Manuals
Related Search
Faster_Basic_for_the_OSI
Related Contents
MrX Sound Board for the ZX81 from Sinclair “Manual for users and MOB1 user manual PCG-X29 - Sony Europe MF253 Let`s go 3 PCEX 410 - Pepperl+Fuchs Creative Labs Sound Blaster Tactic3D RAGE vitilevure ® quartz Copyright © All rights reserved.
Failed to retrieve file