EDASS-128-LETS-MAKE-IT-SOUND-SOUND! -------------------------------------------------------------------------------------------------- TOOL: EDASS-128 {Commodore C128 EDITOR & ASSEMBLER} Language: Assembler Extra: - Author: Misel Zivanovic Note: (C) 14th JULY 2026 - www.lived.ch, mzretro.ch -------------------------------------------------------------------------------------------------- I never in my life made anything in assembler that would produce any kind of sound! {I am i not mistaken!} Time to make some changes related to that subject. I am not going to invent the wheel from scratch, no worries! Let's take an existing example from the BASIC world and transfer it to assembly language. I guess you already have it: it's German! {but the numbers and characters are English, right! So no big deal...Haha... --------------------------------------------------------------------------------------------------- 10 REM EXPERIMENTIERPROGRAMM 20 SI=54272 25 FL=SI:FH=SI+1:TL=SI+2:TH=SI+3: 30 W=SI+4: A=SI+5: H=SI+6: L=SI+24 35 PRINT"DRÜCKE EINE TASTE!" Bildschirm-Botschaft 40 GETZ$:IF Z$="" THEN 40 Taste gedrückt? 50 POKE L,15 Lautstärke 60 POKE A,1*16+5 Anschlag und Abschwellen 70 POKE H,0*16+0 Halten und Ausklingen 80 POKE TH,8:POKE TL,0 Tastverhältnis 90 POKE FH,14:POKE FL,162 Frequenz 100 POKE W,17 Wellenform, Generator einschalten 110 FOR T =1 TO 200:NEXT Tondauer 120 POKE W,0 Generator abschalten 130 GOTO 40 Alles von vorn --------------------------------------------------------------------------------------------------- I prefer, mostly, to work with the full addresses. Converting everything to 'normal' is therefore the next step! BASIC, CLEAR HEX Addresses {I am too lazy to translate this!} 50 POKE 54296,15 $d418 Lautstärke 60 POKE 54277,1*16+1 $d405 Anschlag und Abschwellen 70 POKE 54278,0*16+0 $d406 Halten und Ausklingen 80 POKE 54275,8 $d403 Tastverhältnis 85 POKE 54274,0 $d402 Tastverhältnis 90 POKE 54273,14 $d401 Frequenz 95 POKE 54272,162 $d400 Frequenz 100 POKE 54276,17 $d404 Wellenform, Generator einschalten 110 FOR T=0to200: NEXT Tondauer 120 POKE 54276,0 $d404 Generator abschalten 130 GOTO 40 Alles von vorn --------------------------------------------------------------------------------------------------- I guess that was the most difficult part! Now let's hammer the LDA and STA part into the RAM memory! This will then look like this and it actually should work, theoretically! THE EDASS-128 SOURCE CODE --------------------------------------------------------------------------------------------------- It is doing something after some modifications. I think we made it! A premiere! Now we can become professional music developer for Commodore C128 {Since Bil Herd didn't sweat to make something else for C128, this will work on Commodore C64 too} soundfx00.asm -a:0011-a: -e: ;--------------------------------------- ; ; my first sound effects ever ; written in assembler! ; 14.07.2026 ; *= $1300 .obj m .bank 15 ; ;--------------------------------------- ; lda #$0f sta $d418 lda #1+16+1 sta $d405 lda #8*16+5 ;hold & fade out sta $d406 ;16*16+16 = max! lda #$08 sta $d403 lda #$00 sta $d402 lda #$01 ;low, $ff =high sta $d401 ;freq. low byte lda #$a2 ;freq. high byte sta $d400 ; lda #65 ;opt.: 129,33,17 sta $d404 ;waveform ; ; ;small loop ldy #$00 loop2 ldx #$00 loop1 inx cpx #$ff bne loop1 iny cpy #$ff bne loop2 ; ;loop end lda #$00 sta $d404 ;waveform off rts ---------------------------------------------------------------------------------------------------