INMC 80 News


October–December 1981, Issue 5

Page 24 of 71

– 24 –

PHG Electronics PSG register update MACRO-80 3.4 PAGE 1


0004 0005

0000” 0003”

0006” 0007” 0009” 0008’ o000D’ OOOE’ 0010” 0011” 0013” 0015” 00177 0018” 001A’ 0013” 001C’ OO1E’

OOLF’ 0020’ 0021’ 0022’ 0023” 0024’ 0025’ 0026” 0027’ 0028” 0029” 0024” 0028’ 002Cc’

21 O1

79 D3 3E D3

D3 7E D3 3E D3

D3 oc 23 10 cg

ol 01 01 ol 01 ol OL 01 ol OL OL ol OL 01

Oo1F’ 1000

05 03 04 04 05 ol 04



Title PHG Electronics PSG register update

«Comment \

This subroutine is intended to replace the register update routine given as an example in the PHG Electronics PSG Manual. The calling program updates the register image starting at REGTAB, and then call this subroutine. This then updates all the AY-3-8910 registers at once. It is assumed that the ports have been previously initialized to the output mode.

Carl Lioyd-Parker 03-07-81 +Z80

PBASE EQU 04H Port base address


PSG control port PSG data/address port


Point to register table

Prime register count in B register address in C

Get register address

Send register address to PSG


LD A,O3H Strobe into address latches OUT (PCONT),A XOR A 3 Cause strobe pulse OUT (PCONT),A LD A, (HL) 3; Get register data OUT (PDAT),A 3; Send data to PSG LD A,0O1H 3 Strobe into data latches OUT (PCONT),A XOR A 3; Cause strobe pulse OUT (PCONT),A INC C 3 Inc PSG register address INC HL 3 Inc register data pointer DJNZ LOOP 3; Go round again for next RET 3; End of routine REGTAB; DEFB 1 ; RO Channel A fine tune DEFB 1 3; Rl Channel A course tune DEFB 1 ; R2 Channel B fine tune DEFB 1 ; R3 Channel B course tune DEFB 1 3; R4& Channel C fine tune DEFB 1 3; R5 Channel C course tune DEFB 1 ; R6 Noise channel period DEFB L ; R7 Channel Enables DEFB 1 3; R1O Channel A amplitude DEFB 1 ; RI1 Channel B amplitude DEFB 1 ; RL2 Channel C amplitude DEFB 1 3; R13 Fine envelope period DEFB 1 3; R14 Course envelope period DEFB 1 ; R15 Envelope shape/cycle END

Plus points. Supplied built, with almost everything required to make it

go. Good clear manual, and GI’s data booklet also supplied. Good demo tape.




Minus points. No circuit diagram, one connection diagram confusing. Generally fair value for money (you could make one a lot cheaper, but bits, and doesn’t include the sweat involved figuring it all

out). A nice workman like job. Available at 39.50 + VAT from PHG Electronics, 27, Fenwick Drive, Rugby, Warks. And some Nascom dealers.

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

Page 24 of 71