Code: Select all

```
10 PRINT AT 0,0;IN 31,
20 GO TO 10
```

Code: Select all

```
1 REM A 1024MAK program
5 PRINT "Kempston Joystick Testing"
10 LET J=IN 31
20 IF J>31 THEN LET J=J-32: GO TO 20
30 PRINT AT 2,0;J,
40 IF J=1 THEN PRINT "Right",
50 IF J=2 THEN PRINT "Left",
60 IF J=4 THEN PRINT "Down",
70 IF J=8 THEN PRINT "Up",
80 IF J=16 THEN PRINT "Fire",
90 PRINT ,
100 GO TO 10
900 SAVE "Kempston"
```

Code: Select all

```
1 REM A 1024MAK program
5 PRINT "Sinclair Joystick Testing"
10 LET J$=INKEY$
20 IF J$<"0" OR J$>"9" THEN PRINT AT 2,0,,: GO TO 10
30 PRINT AT 2,0;J$,
40 IF J$="1" OR J$="6" THEN PRINT "Left"
50 IF J$="2" OR J$="7" THEN PRINT "Right"
60 IF J$="3" OR J$="8" THEN PRINT "Down"
70 IF J$="4" OR J$="9" THEN PRINT "Up"
80 IF J$="5" OR J$="0" THEN PRINT "Fire"
100 GO TO 10
900 SAVE "Sinclair"
```

Some years ago I also wrote this test program:-

This is useful for testing interfaces that conform to the Sinclair Interface 2 standard:

Code: Select all

```
1 REM A 1024MAK program
5 PRINT AT 3,0;"76543210 76543210"
10 LET a=IN 61438
11 LET b=IN 63486
12 LET k$=INKEY$
13 IF k$="Q" OR k$="q" THEN GO TO 9999
14 LET num=a
15 GO SUB 1000
16 LET c$=b$
22 LET num=b
24 GO SUB 1000
50 PRINT AT 4,0 ;c$;" ";a;" ";
55 PRINT AT 4,20 ;b$;" ";b;" ";
70 GO TO 10
1000 REM convert to bin
1010 REM takes number in num and returns bin number in b$
1020 LET b$="00000000"
1030 IF num<1 OR num >255 THEN RETURN
1040 IF num>=128 THEN LET num=INT (num-128) : LET b$(1)="1"
1050 IF num>=64 THEN LET num=INT (num-64) : LET b$(2)="1"
1060 IF num>=32 THEN LET num=INT (num-32) : LET b$(3)="1"
1070 IF num>=16 THEN LET num=INT (num-16) : LET b$(4)="1"
1080 IF num>=8 THEN LET num=INT (num-8) : LET b$(5)="1"
1090 IF num>=4 THEN LET num=INT (num-4) : LET b$(6)="1"
1100 IF num>=2 THEN LET num=INT (num-2) : LET b$(7)="1"
1110 IF num=1 THEN LET b$(8)="1"
1170 RETURN
```

*Mark*