2Fermer4
FarewellLe 11/03/2010 à 15:48
C'est bien sûr fait, mais :
- ça reste un bug
- ça marche comme attendu à d'autres endroits (saut pc-relatif à la bonne fonction), genre là :
example
;==========================================================
;	ExecSwitchRoutine
;
;	Exec a routine of a switch, according to the sign + or -
;
;	input	a0	const char *switch
;		a1	table of switches to test
;		a2	table of routines if the switch is prefixed with +
;		a3	table of routines if the switch is prefixed with -
;		a4	table of separators to find after switch
;	output	d0.b	0 if the switch doesn't exist
;	destroy	d0/a0
;==========================================================
butillib@0008:
	movem.l	d1-d2/a1-a3,-(sp)
	cmpi.b	#'-',(a0)			; Check and skip the sign
	beq.s	\Minus
\NoMinus:
	cmpi.b	#'+',(a0)
	beq.s	\Plus
\Fail2:		moveq.l	#-1,d0
		bra.s	\Fail
\Plus:	movea.l	a2,a3				; Fix routine adress
\Minus:	move.l	a3,d0				; Is there a table for this sign ?
	beq.s	\Fail2
	addq.l	#1,a0				; Skip sign
	pea	(a3)				; Save it
	movea.l	a0,a2				; RefString
	movea.l	a1,a0				; StringTable
	movea.l	a4,a1				; SeparatorTable
	suba.l	a3,a3				; NextChar
	bsr	butillib::CompareStrings
	movea.l	(sp)+,a0			; Routine to execute
\Fail:	movem.l	(sp)+,d1-d2/a1-a3		; Restore regs
	tst.w	d0				; Item found ?
	bpl.s	\ItemFound			; Yes
		moveq.l	#0,d0			; Else return an error
		rts				; And quit
\ItemFound:
	add.w	d0,d0				; Table of words
	move.w	0(a0,d0.w),d0			; Read offset
	jsr	0(a0,d0.w)			; Jump to the right offset
	moveq.l	#1,d0				; Return value
	rts					; Quit

Maintiens-tu encore A68k ? En clair, est-ce utile que je remplisse un bug report sur le tracker ?