INMC 80 News


February-April 1981, Issue 3

Page 48 of 55


op00 3E OF LD A,OFH 3 Initialize PIO to output

oD02 D3 06 OUT (6),A

OD04 CF LOOP RST RIN 3 Scan KBD for input

OD05 D3 04 OUT (4),A 3 Send the character to PIO

oDO7 F7 RST ROUT 3; Send character to CRT

oOp0s 18 FA JR LOOP 3 Go round for next character

Execute the program at OD00, and then type keys, different keys will result in

different notes.

I prefer to program in Basic, so how do we use Basic to work the PIO. Answer, read the manual and you will find that OUT 6,15 sets the PIO to the output mode, note that 15 is the decimal of OFH. To output from the PIO in Basic, use OUT 4,A where A is a decimal value between 0 and 255. We can now write a program to play a simple tune, in the following example I used the machine code program to find the notes, converting the character displayed to decimal, and then putting the number into the data. Happy tune playing.


10 REM Set output port to output mode

20 OUT 6,15

30 REM Set up number of notes

40 DIM N(50)

50 FOR L=1 TO 50


70 OUT 4,N

80 FOR I=1 TO 250:NEXT I



1000 REM Note table

1010 DATA 71,71,78, 68,71, 78,88, 88,94, 88 1020 DATA 78,71,78,71,68, 71,71, 78,88, 94 1030 DATA 103,103,103,103,94,88,94,94,94,94 1040 DATA 88,78,88, 94,88, 94,88, 78, 71,88, 94,103 1050 DATA 114,94,88, 78,71,00,00,00,00,00

Option to give a mandolin effect insert the following

70 FOR I=1 TO 5 72 FOR K=1 TO 10 84 OUT 4,N:NEXT K 86 OUT 4,0:NEXT T

M. L. Trim



HELP! Has anybody seen Lawrence since this shot was taken in INMC80-1? Have the Police got him? Where is Heloise? Don’t watch this A space for further details.aa aa Sey h,



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

Page 48 of 55