Re: Bug in 1581 ???

From: Gerrit Heitsch <gerrit_at_laosinh.s.bawue.de>
Date: Wed, 08 Feb 2012 17:08:13 +0100
Message-ID: <4F329DED.8070809@laosinh.s.bawue.de>
On 02/08/2012 07:42 AM, Baltissen, GJPAA (Ruud) wrote:
> Hallo allemaal,
>
>
> I was having a look at the source code of the 1581 to see if it is
> possible to create 1581IDE, the IDE version of the 1581. And I ran in
> this piece of code:
>
> wdstatus				;
> [CD42]
> 		php
>
> 		lda	WDSTAT	; get status
> 		lsr	a
> 		lsr	a
> 		lsr	a
> 		bcs	L93		; [1]
>
> 		and	#bit3+bit1+bit0
> 		tax
>
> 		plp			; restore carry
> 		lda	wdtrans,x
> .by $2C
> L93					;
> [CD53]
> 		lda	#9
> 		sta	ContrStat
>
> 		lda	ContrStat
> 		rts
>
>
>   This code checks the state of the WD177x. Have a look at the point
> marked [1]. If the Carry is set for one or another reason, the branch is
> taken. Then we end up at the RTS. But here it must go terribly wrong as
> the state is still on the stack !!!

Which ROM version did you look at? There were 2 for the 1581, 318045-01 
and 318045-02.

Also, the 1581 doesn't strike me as particularly crash prone, so are you 
sure the WD177x is ever in the state necessary to hit this bug?

  Gerrit




       Message was sent through the cbm-hackers mailing list
Received on 2012-02-08 17:00:08

Archive generated by hypermail 2.2.0.