mk90.basic
Example programs
Complete listings for arithmetic, control flow, files, display and timing.
Using the examples
The HTML package includes five complete ASCII BAS files under examples/. They illustrate the supported dialect and may be compiled once present on a writable MKS2 volume. The manual archive itself is not an SMP filesystem image.
The boot ROM includes its own demo.bas, so the first trial needs no file-transfer utility. The current physical key mapping cannot produce every BASIC operator; see keyboard limitations. This release does not have a UART transfer command.
Count and beep
10 CLS
20 FOR I=1 TO 5
30 PRINT "MK90 ";I
40 BEEP
50 WAIT 8
60 NEXT I
70 ENDArithmetic and a subroutine
10 A=2+3*4
20 B=-17/5
30 C=-17 MOD 5
40 PRINT A;",";B;",";C
50 GOSUB 80
60 PRINT A
70 END
80 A=A+1
90 RETURNWrite and read three bytes
10 OPEN "letters",OUTPUT,3
20 PUT 65:PUT 66:PUT 67
30 CLOSE
40 OPEN "letters",INPUT
50 IF EOF THEN 90
60 GET A
70 PRINT A
80 GOTO 50
90 CLOSE
100 ENDGraphics and the RTC
10 CLS
20 LINE 0,12,119,12
30 LOCATE 0,0
40 PRINT "TIME ";HOUR;":";MINUTE;":";SECOND
50 PSET 60,40
60 WAIT 16
70 PRESET 60,40
80 BEEP
90 ENDNested loops and conditional branching
10 A=0
20 FOR I=1 TO 3
30 FOR J=2 TO 1 STEP -1
40 A=A+I*J
50 NEXT J
60 NEXT I
70 IF A=18 THEN 100
80 PRINT "UNEXPECTED"
90 END
100 PRINT "TOTAL ";A
110 ENDExpected results
| Example | Result |
|---|---|
| hello.bas | Five MK90 lines and five short beeps. |
| math.bas | 14,-3,-2 followed by 15. |
| files.bas | Creates/replaces letters with bytes 65, 66, 67; reads and prints them. |
| screen.bas | Draws a line, displays RTC components, briefly lights a pixel and beeps. |
| loops.bas | Prints TOTAL 18. |