[A83] Re: Interrupt troubles [83, Ion]


[Prev][Next][Index][Thread]

[A83] Re: Interrupt troubles [83, Ion]




Okay, I guess that somebody came with this idea already, but haven't
checked my mail since the last one I sended in here...

What I now do is checking if an error-flag is set by my routine, and fixes
the stack if needed, but it doesn't work :-(

What am I doing wrong? (btw I thought about the stuff, and came to the
conclusoin that the return value is only once on the stack, not twice, as I
said before..)

(I can also try to put in a DI right before the JP IntProcStart in the
statvars, maybe that might help a little too)

-------
[using the same loader]

defc intcount    = $878A		; 1 byte needed

.IntProcStart
	push	af			;
	ld	a,(intcount)		; Check if own interrupt has quited
	bit	7,a			;  correctly, then bit 7 is zero
	jr	nz,int_fix		; If not zero, fix stack...
	push	hl			;
	push	de			;
	push	bc			;
	ld	hl,intcount		; If a 'direct interrupt' occures    
	set	7,(hl)			;  right after the TIOS-int, then
					;  we want bit 7 to be set...
.exit_interrupt				;
	exx				; Swap to shadow registers.
	ex	af,af			; So the TIOS swaps back to the
					;  normal ones... (the ones we saved
					;  with push/pops)
	rst	$38			;
	di				; 'BIG' HOLE HERE...
	ex	af,af			;
	exx				;
					;
	ld	hl,intcount		; Interrupt returned correctly, so
	res	7,(hl)			;  we reset our error-condition...
					;
	pop	bc			;
	pop	de			;
	pop	hl			;
	pop	af			;
	ei				;
	ret				;
.int_fix				;
	pop	af			; Pop AF back
	ex	af,af			; Fix shadowregs back
	exx				;
	pop	bc			; Pop the returnpoint of RST $38
					;  from the stack
	jr	exit_interrupt		;
.jump_over



Follow-Ups: