BBCBasic

It is probably the most popular BASIC version for the 8 bits you can find, there are also versions for Mac and Windows. A search on the net will satisfy much more than four lines written by me. Why am I presenting it? Because I found the assembler sources in https://github.com/jblang/bbcbasic-z80 and I couldn’t resist modifying them to have a BBCBasic version with customized graphic (and audio) instructions for Fabgl’s VT100 video and ESP32 graphic terminal .

The manual is online at https://www.bbcbasic.co.uk/bbcbasic/mancpm/index.html or you can find it here in pdf format  BBCBASIC(Z80) Manual .

The BBCBasic version I downloaded is generic for CP / M and the graphic and sound instructions have been disabled. BASIC is an imperative programming language and certainly does not allow program structuring but BBCBasic is a dialect that  supports named procedures, local variables, recursion and other structured programming features. Unlike Microsoft BASIC, you can write structured programs without having to refer to any line numbers. For example, let’s see the classic calculation of the factorial:

10 PRINT FNfattoriale(5)
20 END
30 :
40 DEF FNfattoriale(N)
50 IF N=0 OR N=1 THEN =1
60 =FNfattoriale(N-1)*N

Note that line numbers are present to sort the instruction list but are not needed to control the flow of instruction execution.

The changes I have made currently are:

MODE 0 | 1: text screen | graphic screen. The text screen is 80 columns by 24 lines and color characters. The graphic extension is rigid and is fixed at 640 horizontal points by 480 vertical points.

CLG: Screen cleaning in graphics mode.

GCOL R, G, B: color setting of the dot or line indicating the intensity of red, green and blue.

PLOT X, Y: lights up a colored dot in the graphic screen (see GLC).

DRAW X1, Y1, X2, Y2: draws a colored line between the coordinate pairs.

MOVE X, Y: scrolls x columns and y rows on a graphic page.

SOUND TYPE, FREQUENCY, DURATION, VOLUME: emits a sound of type 0-sine 1-square 2-triangle 3-sawtooth 4-noise 5-vic noise, of frequency in Hertz, duration in milliseconds and volume between 0 and 127

The BBCBasic program can be found here https://automatico.freevar.com/dump/bbcbasic.com

 

 

Loading