-
Notifications
You must be signed in to change notification settings - Fork 1
/
playwav3.s
860 lines (750 loc) · 16.9 KB
/
playwav3.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
; ****************************************************************************
; playwav3.s (for TRDOS 386)
; ----------------------------------------------------------------------------
; PLAYWAV3.PRG ! AC'97 (ICH) .WAV PLAYER program by Erdogan TAN
;
; 28/05/2017
;
; [ Last Modification: 17/06/2017 ]
;
; Modified from PLAYWAV2.PRG .wav player program by Erdogan Tan, 27/05/2017
;
; Assembler: NASM version 2.11
; nasm playwav3.s -l playwav3.txt -o PLAYWAV3.PRG
; ----------------------------------------------------------------------------
; Derived from '.wav file player for DOS' Jeff Leyda, Sep 02, 2002
; CODE
; 01/03/2017
; 16/10/2016
; 29/04/2016
; TRDOS 386 system calls (temporary list!)
_ver equ 0
_exit equ 1
_fork equ 2
_read equ 3
_write equ 4
_open equ 5
_close equ 6
_wait equ 7
_creat equ 8
_link equ 9
_unlink equ 10
_exec equ 11
_chdir equ 12
_time equ 13
_mkdir equ 14
_chmod equ 15
_chown equ 16
_break equ 17
_stat equ 18
_seek equ 19
_tell equ 20
_mount equ 21
_umount equ 22
_setuid equ 23
_getuid equ 24
_stime equ 25
_quit equ 26
_intr equ 27
_fstat equ 28
_emt equ 29
_mdate equ 30
_video equ 31
_audio equ 32
_timer equ 33
_sleep equ 34
_msg equ 35
_geterr equ 36
_fpsave equ 37
_pri equ 38
_rele equ 39
_fff equ 40
_fnf equ 41
_alloc equ 42
_dalloc equ 43
_calbac equ 44
%macro sys 1-4
; 29/04/2016 - TRDOS 386 (TRDOS v2.0)
; 03/09/2015
; 13/04/2015
; Retro UNIX 386 v1 system call.
%if %0 >= 2
mov ebx, %2
%if %0 >= 3
mov ecx, %3
%if %0 = 4
mov edx, %4
%endif
%endif
%endif
mov eax, %1
;int 30h
int 40h ; TRDOS 386 (TRDOS v2.0)
%endmacro
; TRDOS 386 (and Retro UNIX 386 v1) system call format:
; sys systemcall (eax) <arg1 (ebx)>, <arg2 (ecx)>, <arg3 (edx)>
BUFFERSIZE equ 32768 ; audio buffer size
ENDOFFILE equ 1 ; flag for knowing end of file
[BITS 32]
[ORG 0]
_STARTUP:
; Prints the Credits Text.
sys _msg, Credits, 255, 0Bh
; clear bss
mov ecx, bss_end
mov edi, bss_start
sub ecx, edi
shr ecx, 1
xor eax, eax
rep stosw
; Detect (& Enable) AC'97 Audio Device
call DetectAC97
jnc short GetFileName
_dev_not_ready:
; couldn't find the audio device!
sys _msg, noDevMsg, 255, 0Fh
jmp Exit
GetFileName:
mov esi, esp
lodsd
cmp eax, 2 ; two arguments
; (program file name & mod file name)
jb pmsg_usage ; nothing to do
lodsd ; program file name address
lodsd ; mod file name address (file to be read)
mov esi, eax
mov edi, wav_file_name
ScanName:
lodsb
test al, al
je pmsg_usage
cmp al, 20h
je short ScanName ; scan start of name.
stosb
mov ah, 0FFh
a_0:
inc ah
a_1:
lodsb
stosb
cmp al, '.'
je short a_0
and al, al
jnz short a_1
or ah, ah ; if period NOT found,
jnz short _1 ; then add a .WAV extension.
SetExt:
dec edi
mov dword [edi], '.WAV'
mov byte [edi+4], 0
_1:
; Allocate Audio Buffer (for user)
sys _audio, 0200h, BUFFERSIZE, audio_buffer
jnc short _2
error_exit:
sys _msg, trdos386_err_msg, 255, 0Eh
jmp Exit
_2:
; DIRECT CGA (TEXT MODE) MEMORY ACCESS
; bl = 0, bh = 4
; Direct access/map to CGA (Text) memory (0B8000h)
sys _video, 0400h
cmp eax, 0B8000h
jne short error_exit
; Initialize Audio Device (bh = 3)
sys _audio, 0301h, 0, audio_int_handler
; jc short error_exit
_3:
call write_audio_dev_info
; open the file
; open existing file
call openFile ; no error? ok.
jnc short _gsr
; file not found!
sys _msg, noFileErrMsg, 255, 0Fh
jmp Exit
_gsr:
call getSampleRate ; read the sample rate
; pass it onto codec.
jc Exit
mov [sample_rate], ax
mov [stmo], cl
mov [bps], dl
; 06/06/2017
sys _audio, 0E00h ; get audio controller info
jc error_exit
;cmp ah, 2 ; ICH ? (Intel AC'97 Audio Controller)
;jne _dev_not_ready
; EAX = IRQ Number in AL
; Audio Device Number in AH
; EBX = DEV/VENDOR ID
; (DDDDDDDDDDDDDDDDVVVVVVVVVVVVVVVV)
; ECX = BUS/DEV/FN
; (00000000BBBBBBBBDDDDDFFF00000000)
; EDX = NABMBAR/NAMBAR (for AC97)
; (Low word, DX = NAMBAR address)
; EDX = Base IO Addr (DX) for SB16 & VT8233
mov [ac97_int_ln_reg], al
mov [dev_vendor], ebx
mov [bus_dev_fn], ecx
;mov [ac97_NamBar], dx
;shr dx, 16
;mov [ac97_NabmBar], dx
mov [ac97_NamBar], edx
call write_ac97_pci_dev_info
; 01/05/2017
call write_wav_file_info
PlayNow:
;
; position file pointer to start in actual wav data
; MUCH improvement should really be done here to check if sample size is
; supported, make sure there are 2 channels, etc.
;
;mov ah, 42h
;mov al, 0 ; from start of file
;mov bx, [FileHandle]
;xor cx, cx
;mov dx, 44 ; jump past .wav/riff header
;int 21h
sys _seek, [FileHandle], 44, 0
sys _msg, nextline, 255, 07h ; 01/05/2017
; 13/06/2017
;mov byte [factor], 0
cmp byte [bps], 16
je short _set_factor_0
inc byte [factor] ; 1
_set_factor_0:
cmp byte [stmo], 2
je short _set_factor_1
add byte [factor], 2 ; 2 or 3
_set_factor_1:
; play the .wav file. Most of the good stuff is in here.
call PlayWav
; close the .wav file and exit.
StopPlaying:
; Stop Playing
sys _audio, 0700h
; Cancel callback service (for user)
sys _audio, 0900h
; Deallocate Audio Buffer (for user)
sys _audio, 0A00h
; Disable Audio Device
sys _audio, 0C00h
Exit:
call closeFile
sys _exit ; Bye!
here:
jmp short here
pmsg_usage:
sys _msg, msg_usage, 255, 0Bh
jmp short Exit
DetectAC97:
; Detect (BH=1) AC'97 (BL=2) Audio Device
sys _audio, 0102h
retn
;open or create file
;
;input: ds:dx-->filename (asciiz)
; al=file Mode (create or open)
;output: none cs:[FileHandle] filled
;
openFile:
;mov ah, 3Bh ; start with a mode
;add ah, al ; add in create or open mode
;xor cx, cx
;int 21h
;jc short _of1
;;mov [cs:FileHandle], ax
sys _open, wav_file_name, 0
jc short _of1
mov [FileHandle], eax
_of1:
retn
; close the currently open file
; input: none, uses cs:[FileHandle]
closeFile:
cmp dword [FileHandle], -1
je short _cf1
;mov bx, [FileHandle]
;mov ax, 3E00h
;int 21h ;close file
sys _close, [FileHandle]
mov dword [FileHandle], -1
_cf1:
retn
getSampleRate:
; reads the sample rate from the .wav file.
; entry: none - assumes file is already open
; exit: ax = sample rate (11025, 22050, 44100, 48000)
; cx = number of channels (mono=1, stereo=2)
; dx = bits per sample (8, 16)
push ebx
;mov ah, 42h
;mov al, 0 ; from start of file
;mov bx, [FileHandle]
;xor cx, cx
;mov dx, 08h ; "WAVE"
;int 21h
sys _seek, [FileHandle], 8, 0
;mov dx, smpRBuff
;mov cx, 28 ; 28 bytes
;mov ah, 3fh
;int 21h
sys _read, [FileHandle], smpRBuff, 28
cmp dword [smpRBuff], 'WAVE'
jne short gsr_stc
cmp word [smpRBuff+12], 1 ; Offset 20, must be 1 (= PCM)
jne short gsr_stc
mov cx, [smpRBuff+14] ; return num of channels in CX
mov ax, [smpRBuff+16] ; return sample rate in AX
mov dx, [smpRBuff+26] ; return bits per sample value in DX
gsr_retn:
pop ebx
retn
gsr_stc:
stc
jmp short gsr_retn
audio_int_handler:
mov byte [srb], 1 ; interrupt (or signal response byte)
cmp byte [cbs_busy], 1
jnb short _callback_bsy_retn
mov byte [cbs_busy], 1
mov al, [half_buff]
cmp al, 1
jb short _callback_retn
xor byte [half_buff], 3 ; 2->1, 1->2
mov ebx, 0B8000h ; video display page address
mov ah, 4Eh
add al, '0'
mov [ebx], ax ; show playing buffer (1, 2)
_callback_retn:
mov byte [cbs_busy], 0
_callback_bsy_retn:
sys _rele ; return from callback service
; we must not come here !
sys _exit
loadFromFile:
; 13/06/2017
mov edx, BUFFERSIZE
mov cl, [factor]
and cl, cl
jz short _set_factor_2
mov edi, temp_buffer
; bit 0 = 8 bit
; bit 1 = mono
add cl, 1 ; 1 -> 2, 2 -> 3, 3 -> 4
shr cl, 1 ; 4 -> 2, 3 -> 1, 2 -> 1
shr edx, cl
jmp short _set_factor_3
_set_factor_2:
; load 32768 bytes into audio buffer
; (for the first half of DMA buffer)
mov edi, audio_buffer
_set_factor_3:
; 17/03/2017
; edi = buffer address
; edx = buffer size
; 10/03/2017
;push eax
;push ecx
;push edx
;push ebx
test byte [flags], ENDOFFILE ; have we already read the
stc ; last of the file?
jnz short endLFF_retn ; 13/06/2017
;clc
; load file into memory
sys _read, [FileHandle], edi
mov ecx, edx
jc short padfill ; error !
and eax, eax
jz short padfill
sub ecx, eax
jz short endLFF
add edi, eax
padfill:
cmp byte [bps], 16
je short _5
; Minimum Value = 0
xor al, al
rep stosb
_4:
;clc ; don't exit with CY yet.
or byte [flags], ENDOFFILE ; end of file flag
endLFF:
; 17/06/2017
; 13/06/2017
; bit 0 = 8bit (1), 16bit (0)
; bit 1 = mono (1), stereo (0)
mov al, [factor]
or al, al
jz short endLFF_retn
mov esi, temp_buffer
mov edi, audio_buffer
mov ecx, BUFFERSIZE / 4
cmp al, 2
ja short _set_factor_5 ; 8 bit mono
je short _set_factor_6 ; 16 bit mono
; 8 bit stereo
_set_factor_4:
lodsb
and al, al
jnz short _set_factor_4a
mov edx, 80000000h
jmp short _set_factor_4b
_set_factor_4a:
sub al, 80h
mov dl, al
shl edx, 24
_set_factor_4b:
lodsb
or al, al
jnz short _set_factor_4c
mov dx, 8000h
jmp short _set_factor_4d
_set_factor_4c:
sub al, 80h
mov dh, al
_set_factor_4d:
mov eax, edx
stosd
loop _set_factor_4
;jmp short _set_factor_7
clc
endLFF_retn:
;pop ebx
;pop edx
;pop ecx
;pop eax
retn
_5:
; Minimum value = 8000h (-32768)
shr ecx, 1
mov ax, 8000h ; -32768
rep stosw
jmp short _4
_set_factor_5:
; 8 bit mono
lodsb
and al, al
jnz short _set_factor_5a
mov ax, 8000h
jmp short _set_factor_5b
_set_factor_5a:
sub al, 80h
mov ah, al
sub al, al
_set_factor_5b:
mov dx, ax
shl eax, 16
mov ax, dx
stosd
loop _set_factor_5
jmp short _set_factor_7
_set_factor_6:
; 16 bit mono
lodsw
mov dx, ax
shl eax, 16
mov ax, dx
stosd
loop _set_factor_6
_set_factor_7:
clc ; 13/06/2017
;pop ebx
;pop edx
;pop ecx
;pop eax
retn
PlayWav:
; 13/06/2017
; Convert 8 bit samples to 16 bit samples
; and convert mono samples to stereo samples
;mov edi, audio_buffer
;mov edx, BUFFERSIZE
call loadFromFile
jc error_exit
mov byte [half_buff], 1 ; (DMA) Buffer 1
; Set Master Volume Level (BL=0 or 80h)
; for next playing (BL>=80h)
sys _audio, 0B80h, 1D1Dh
; Start to play
mov al, [bps]
shr al, 4 ; 8 -> 0, 16 -> 1
shl al, 1 ; 16 -> 2, 8 -> 0
mov bl, [stmo]
dec bl
or bl, al
mov cx, [sample_rate]
mov bh, 4 ; start to play
sys _audio
;mov ebx, 0B8000h ; video display page address
;mov ah, 4Eh
;mov al, [half_buffer]
;mov [ebx], ax ; show playing buffer (1, 2)
;; load 32768 bytes into audio buffer
;; (for the second half of DMA buffer)
;; 20/05/2017
;mov edi, audio_buffer
;mov edx, BUFFERSIZE
;call loadFromFile
;jc short p_return
;mov byte [half_buff], 2 ; (DMA) Buffer 2
mov byte [srb], 1
p_loop:
mov ah, 1 ; any key pressed?
int 32h ; no, Loop.
jz short q_loop
mov ah, 0 ; flush key buffer...
int 32h
p_return:
mov byte [half_buff], 0
retn
q_loop:
cmp byte [srb], 0
jna short p_loop
mov byte [srb], 0
;mov edi, audio_buffer
;mov edx, BUFFERSIZE
call loadFromFile
jc short p_return
;mov byte [srb], 0
jmp short p_loop
write_audio_dev_info:
; EBX = Message address
; ECX = Max. message length (or stop on ZERO character)
; (1 to 255)
; DL = Message color (07h = light gray, 0Fh = white)
sys _msg, msgAudioCardInfo, 255, 0Fh
retn
write_wav_file_info:
; 01/05/2017
sys _msg, msgWavFileName, 255, 0Fh
sys _msg, wav_file_name, 255, 0Fh
write_sample_rate:
; 01/05/2017
mov ax, [sample_rate]
; ax = sample rate (hertz)
xor edx, edx
mov cx, 10
div cx
add [msgHertz+4], dl
sub edx, edx
div cx
add [msgHertz+3], dl
sub edx, edx
div cx
add [msgHertz+2], dl
sub edx, edx
div cx
add [msgHertz+1], dl
add [msgHertz], al
sys _msg, msgSampleRate, 255, 0Fh
mov esi, msg16Bits
cmp byte [bps], 16
je short wsr_1
mov esi, msg8Bits
wsr_1:
sys _msg, esi, 255, 0Fh
mov esi, msgMono
cmp byte [stmo], 1
je short wsr_2
mov esi, msgStereo
wsr_2:
sys _msg, esi, 255, 0Fh
retn
write_ac97_pci_dev_info:
; 06/06/2017
; 03/06/2017
; BUS/DEV/FN
; 00000000BBBBBBBBDDDDDFFF00000000
; DEV/VENDOR
; DDDDDDDDDDDDDDDDVVVVVVVVVVVVVVVV
mov esi, [dev_vendor]
mov eax, esi
movzx ebx, al
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgVendorId+3], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgVendorId+2], al
mov bl, ah
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgVendorId+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgVendorId], al
shr eax, 16
mov bl, al
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgDevId+3], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgDevId+2], al
mov bl, ah
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgDevId+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgDevId], al
mov esi, [bus_dev_fn]
shr esi, 8
mov ax, si
mov bl, al
mov dl, bl
and bl, 7 ; bit 0,1,2
mov al, [ebx+hex_chars]
mov [msgFncNo+1], al
mov bl, dl
shr bl, 3
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgDevNo+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgDevNo], al
mov bl, ah
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgBusNo+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgBusNo], al
mov ax, [ac97_NamBar]
mov bl, al
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgNamBar+3], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgNamBar+2], al
mov bl, ah
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgNamBar+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgNamBar], al
mov ax, [ac97_NabmBar]
mov bl, al
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgNabmBar+3], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgNabmBar+2], al
mov bl, ah
mov dl, bl
and bl, 0Fh
mov al, [ebx+hex_chars]
mov [msgNabmBar+1], al
mov bl, dl
shr bl, 4
mov al, [ebx+hex_chars]
mov [msgNabmBar], al
xor ah, ah
mov al, [ac97_int_ln_reg]
mov cl, 10
div cl
add [msgIRQ], ax
and al, al
jnz short _w_ac97imsg_
mov al, [msgIRQ+1]
mov ah, ' '
mov [msgIRQ], ax
_w_ac97imsg_:
sys _msg, msgAC97Info, 255, 07h
retn
; DATA
FileHandle:
dd -1
Credits:
db 'Tiny WAV Player for TRDOS 386 by Erdogan Tan. '
db 'June 2017.',10,13,0
db '17/06/2017', 10,13,0
msgAudioCardInfo:
db 'for Intel AC97 (ICH) Audio Controller.', 10,13,0
msg_usage:
db 'usage: playwav3 filename.wav',10,13,0
noDevMsg:
db 'Error: Unable to find AC97 audio device!'
db 10,13,0
noFileErrMsg:
db 'Error: file not found.',10,13,0
trdos386_err_msg:
db 'TRDOS 386 System call error !',10,13,0
msgWavFileName: db 0Dh, 0Ah, "WAV File Name: ",0
msgSampleRate: db 0Dh, 0Ah, "Sample Rate: "
msgHertz: db "00000 Hz, ", 0
msg8Bits: db "8 bits, ", 0
msgMono: db "Mono", 0Dh, 0Ah, 0
msg16Bits: db "16 bits, ", 0
msgStereo: db "Stereo"
nextline: db 0Dh, 0Ah, 0
; 03/06/2017
hex_chars db "0123456789ABCDEF", 0
msgAC97Info db 0Dh, 0Ah
db "AC97 Audio Controller & Codec Info", 0Dh, 0Ah
db "Vendor ID: "
msgVendorId db "0000h Device ID: "
msgDevId db "0000h", 0Dh, 0Ah
db "Bus: "
msgBusNo db "00h Device: "
msgDevNo db "00h Function: "
msgFncNo db "00h"
db 0Dh, 0Ah
db "NAMBAR: "
msgNamBar db "0000h "
db "NABMBAR: "
msgNabmBar db "0000h IRQ: "
msgIRQ dw 3030h
db 0Dh, 0Ah, 0
EOF:
; BSS
bss_start:
ABSOLUTE bss_start
alignb 4
stmo: resb 1 ; stereo or mono (1=stereo)
bps: resb 1 ; bits per sample (8,16)
sample_rate: resw 1 ; Sample Frequency (Hz)
cbs_busy: resb 1
half_buff: resb 1
flags: resb 1
srb: resb 1
smpRBuff: resw 14
wav_file_name:
resb 80 ; wave file, path name (<= 80 bytes)
resw 1
ac97_int_ln_reg: resb 1
factor: resb 1 ; 13/06/2017
dev_vendor: resd 1
bus_dev_fn: resd 1
ac97_NamBar: resw 1
ac97_NabmBar: resw 1
bss_end:
alignb 4096
audio_buffer: resb BUFFERSIZE ; DMA Buffer Size / 2 (32768)
; 13/06/2017
temp_buffer: resb BUFFERSIZE