0

im new to nasm (I have used Tasm) and my program isn't playing the music at all here is my code:

bits 16
org 100h
DATASEG 
sound_pointer dw 0
sound_data:
    incbin "abba.wav"   ;1,556,480
CODESEG
start:
    mov cx, 556480
    mov ax, 0
    mov [sound_pointer], ax
looper:
    mov dx, 22ch
    mov al, 10h
    out dx, al
    mov si, [sound_pointer]
    mov al, [sound_data+si]
    out dx, al
    mov ax, 1
    mov [sound_pointer], ax
    loop looper

r

Michael
  • 57,169
  • 9
  • 80
  • 125
  • 1
    There's more to soundblaster PCM playback than just writing samples to the DSP. See e.g. https://stackoverflow.com/questions/53306701/how-to-write-a-simple-soundblaster-16-driver-using-direct-write-mode-for-a-hobby Also, you seem to have pretty much no delay in between sample writes. And a WAV file (if that's what it really is) [contains more](http://soundfile.sapp.org/doc/WaveFormat/) than just the sample data. – Michael Feb 01 '19 at 15:31
  • 1
    Also, I don't know if nasm's `incbin` directive has some sort of support for handling that, but if that audio file really is 1,556,480 bytes then it won't fit in a segment. – Michael Feb 01 '19 at 15:40
  • thank you for the attention, do you have any advice how make it work? – Idan Gabrielov Feb 05 '19 at 18:55

0 Answers0