80-Bus News


November-December 1984, Volume 3, Issue 6

Page 33 of 55

default routine is executed, in this case the output of an error message and the setting of an error flag.

Now we have introduced the -break” statement, I think that we should give it a further airing along with its bedmate the -continue” statement. Although -c’ allows the use of the -goto” statement, it should never be necessary to use it. Let us say that we are in the body of an executing loop and we come across the following:

if( vbl1_1 == 0 ) break;

vbl lis tested for a zero value and if it is found to be true the loop is exited and control is passed to the statement immediatly following the loop statements. A nice clean way don’t you think to conditionally exit an executing loop.

if the following was encountered: if( vbl_1 == 0 ) continue;

-C’ would interpret this as, if vbl1_1 is found to be 0 then forget about the remainder of the looping statements and continue with the next iteration. This is not an exit from the loop but the forcing of a premature “NEXT”, to give a comparison in BASIC.

It did occur to me a while back that if you used “f£define goto structured repass’ the preprocessor would replace -structured repass” with goto, which means that you could have as many goto’s in your code as you wanted and no one would be any the wiser, especially if you put it in STDIO.H where it could not be found in a source listing. If you want to get your own back, using methods like that, -C” could be the ideal medium for “drop through’ spaghetti programmers!

Arithmetic operators

All the normal operators are supported and usually conform to the standard rules of operator precedence. As you may have already noticed there are two ways that arithmetic syntax can be entered. I call these -longhand” and “shorthand” for convenience. Here is some equivalent syntax.

longhand shorthand desc

x=xt] KH increments x by 1 x=xK+3 X+=3 increments x by 3 K=xX*3 x*s3 multiplies x by 3

In addition to these you will also have bitwise logical operators at your beck and call, some examples below.

x>>=4 shifts x four bits to the right

x<<=6 shifts x six bits to the left

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

Page 33 of 55