Scor­pio News

  

January–March 1987 – Volume 1. Issue 1











Page 49 of 63











FOR ..NEXT or their FORTRAN of PASCAL equivalent DO loops work faster if unnecessary arithmeric is reduced – so constants can be placed outside the loop. Tells also quicker to dispense with loops altogether in some cases where, for example, an array has to be initialised.

FoR 1-1 703 X(1)-0 Next

Af At 4s ‘unrolled’ co give the direct assignments: xay-0

x2 xG)0

since this avoide the work/time overhead

sociated vith Loops.

The vorst offenders in almost all respects are programs originally written for

wainframe computers in which memory restraints are almost unknown and the clock Speed and cycle time are such that even inefficiently-written programe run extremely quickly. Good programe, regardless of their function or the Langua fn which they are written, should take into account most, if not all of the points raised in this article during their development The extra time snd care Involved will certainly not be wasted!

References

Brown, AR. and Sampson, W.A (1973) Program debugging: the prevention and cure of program errors. Macdonald

Monro, D.M. (1978) Basie BASIC. Edward Arnold,

LISTING FOR *HAKING CP/M MORE USER FRIENDLY – By C. Bowden”

BE 5 g a8 : igo: iG i

i ca o8 oH gf

3 zi EF gs Ey oF Sena

e 2202 gee 2: go:

3 3303 rit 5 fag

i iii


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 49 of 63