Hello Guys,
Problem for do work the INTERRUPT TIME for Sounds in assembly.
I would like do work these two routines in assembler at INTERRUPT TIME
and using HOOK FD9Fh. But unfortunately it doesn't work......
Therefore: I ask your help for me..... Thanks... ;-)
first routine
.org $c000 - 7
.db $fe
.dw main,endProgram,main
main:
jp installProgram ;Install HOOK
jp stopProgram ;Uninstall HOOK
installProgram:
di
ld hl,$FD9F
ld de,oldHook
ld bc,5
ldir
ld a,$c3
ld hl,startProgram
ld de,$FD9F
ld bc,5
ldir
ei
ret
oldHook: .ds 5
stopProgram:
di
ld hl,oldHook
ld de,$FD9F
ld bc,5
ldir
ei
ret
startProgram:
call 0090h
ld a,01h
ld e,00h
call 0093h
ld a,08h
ld e,0bh
call 0093h
ld bc,03e8h
LOOP1:
ld e,c
ld a,00h
call 0093h
LOOP2:
add a,02h
jr nc,LOOP2
dec bc
ld a,b
or c
jr nz,LOOP1
ld a,08h
ld e,00h
call 0093h
ret
endProgram:
.end
second routine
.org $C000 - 7 .db $fe .dw main,endProgram,main main: jp installProgram ;Install HOOK jp stopProgram ;Uninstall HOOK installProgram: di ld hl,$FD9F ld de,oldHook ld bc,5 ldir ld a,$c3 ld hl,startProgram ld de,$FD9F ld bc,5 ldir ei ret oldHook: .ds 5 stopProgram: di ld hl,oldHook ld de,$FD9F ld bc,5 ldir ei ret startProgram: LD BC,$500 SOUND: LD A,7 CALL $96 OR 9 LD E,A LD A,7 CALL $93 LD E,1 LD A,1 CALL $93 LD E,$DE LD A,0 CALL $93 LD E,8 LD A,13 CALL $93 LD E,15 LD A,11 CALL $93 LD E,0 LD A,12 CALL $93 LD E,16 LD A,8 CALL $93 LD A,7 CALL $93 AND $FE LD E,A LD A,7 CALL $93 DEC BC LD A,B OR C JR NZ,SOUND CALL $90 RET endProgram: .end
Login or register to post comments
