.386
.model flat
.stack 1000h

locals

include mxmplay.inc

.data?
mxmdata	db 4000h dup (?)

.code
module:
include atomic.inc

copyright db "mxmplay asm example  (c) '95/96 Niklas Beisert / pascal",10,13
          db 'DOS32 conversion by Crom / ethnica',13,10,10,'$'
playing db 'playing "at0mic playboys" by Screamager... press any key to stop.$'
byebye db 13,10,'thanks for listening',13,10,'$'


START:	sti
	cld

	mov ah,9
	mov edx,OFFSET copyright
	int 21h

        call xmpGetEnvPtrDOS32_
        call xmpGetGUSPort_

	lea ebx,mxmdata
	mov ecx,65536
	mov esi,OFFSET module
        mov dl,MXMINTMODEDPMI
	call xmpInit_

	xor eax,eax
	call xmpPlay_

	mov ah,9
	mov edx,OFFSET playing
	int 21h

	mov ah,7
	int 21h

@@flush:
	mov ah,11
	int 21h
	cmp al,0
	je @@bye
	mov ah,7
	int 21h
	jmp @@flush

@@bye:
	mov ah,9
	mov edx,OFFSET byebye
	int 21h

@@done:
	call xmpStop_

	mov ax,4C00h
	int 21h

	END START
