--- title: "AY-3-8912 Sound Hex Loader" id: 77344 type: "computer_media" slug: "ay-3-8912-sound-hex-loader" url: "http://localhost/computer_media/ay-3-8912-sound-hex-loader/" markdown_url: "http://localhost/computer_media/ay-3-8912-sound-hex-loader.md" published_at: "2026-11-15T18:39:06+00:00" modified_at: "2026-11-18T12:06:58+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/ay-sound-hex-loader-1.png" excerpt: "The read/write hex loader with row checksums for the ZX81 AY-3-8912 sound board's machine code." model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Rene Bruneau" slug: "rene-bruneau" taxonomy: "indiv" url: "http://localhost/indiv/rene-bruneau/" genre: - name: "Sound" slug: "sound" taxonomy: "genre" url: "http://localhost/type/sound/" media_type: "Program" programmers: - name: "Rene Bruneau" slug: "rene-bruneau" taxonomy: "indiv" url: "http://localhost/indiv/rene-bruneau/" mediadate: "1994" images: - url: "http://localhost/wp-content/uploads/2026/11/ay-sound-hex-loader-1.png" - url: "http://localhost/wp-content/uploads/2026/11/ay-sound-hex-loader-2.png" article_media: - id: 65395 title: "Sound for the ZX81" type: "article" url: "http://localhost/article/sound-for-the-zx81/" related_content: - id: 77603 title: "AY-3-8912 Music Demo" type: "computer_media" url: "http://localhost/computer_media/ay-3-8912-music-demo/" media_type_tags: "Sound" license: false --- # AY-3-8912 Sound Hex Loader The hex loader (Figure 4) for Rene Bruneau’s AY-3-8912 sound board for the ZX81, which adds PLAY, MUSIC and SOUND commands (about 600 bytes of code in a REM) and a joystick port. W writes: give the start and finish addresses, then type each row of 8 bytes in hex and its total; R reads memory back as hex rows with totals. Line 1 is a PRINT of zeros joined by plus signs; POKE 16513,234 turns it into the REM that holds the code, as lines 2-4 say. The machine code (Figure 5, 16514-17074) and the music demo (Figure 6) are typed in, checked against the printed row totals and ready to run as [AY-3-8912 Music Demo](https://timexsinclair.com/computer_media/ay-3-8912-music-demo/). As printed, line 310 sends a correct row back to the same INPUT without advancing, so only the first row can be entered. Published in Sinc-Link July-August 1994 ([Sound for the ZX81](https://timexsinclair.com/article/sound-for-the-zx81/)). ## Source Code ``` 1 PRINT 0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0 2 REM ** ENTER 80 ZEROS WITH PLUS SIGNS BETWEEN 3 REM ** POKE 16513,234 4 REM ** RUN HEX LOADER 90 PRINT "READ OR WRITE (R/W)" 95 INPUT M$ 100 CLS 110 PRINT "START ADDRESS" 120 INPUT S 130 PRINT "FINISH ADDRESS" 140 INPUT F 145 IF M$="R" THEN GOTO 400 150 FOR N=S TO F STEP 8 160 LET T=0 170 SCROLL 180 PRINT N;" - "; 190 INPUT A$ 200 PRINT A$;" = "; 210 INPUT TOT 220 PRINT TOT 230 LET Z=0 240 FOR K=1 TO LEN A$ STEP 2 250 LET C=(CODE A$(K)-28)*16+CODE A$(K+1)-28 270 LET T=T+C 280 POKE N+Z,C 290 LET Z=Z+1 300 NEXT K 310 IF TOT=T THEN GOTO 340 320 SCROLL 330 PRINT "ERROR - PLEASE INPUT AGAIN" 340 GOTO 190 350 NEXT N 360 STOP 400 FOR N=S TO F STEP 8 405 LET T=0 410 SCROLL 420 PRINT N;" - "; 430 FOR B=0 TO 7 440 LET C=PEEK (N+B) 445 LET T=T+C 450 LET F$=CHR$ (INT (C/16+28)) 460 LET S$=CHR$ ((C-((CODE F$-28)*16))+28) 465 PRINT F$;S$; 470 NEXT B 480 PRINT " = ";T 490 NEXT N 495 STOP ```