Bug in 1581 ???

From: Baltissen, GJPAA (Ruud) <ruud.baltissen_at_apg.nl>
Date: Wed, 8 Feb 2012 07:42:46 +0100
Message-ID: <219DEB1536CDE04E98DDD8620CA8CD68275B32@winsv293.office01.internalcorp.net>
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 !!!
The basic of the source is the source uploaded by Dennis Jarvis. I had
to adjust it for my assembler but the comments are original. So IMHO the
"restore carry" would make sense if PHP had been placed after BCS.

Your comment please.


-- 
     ___  
    / __|__ 
   / /  |_/     Groetjes, Ruud 
   \ \__|_\ 
    \___|       http://www.Baltissen.org 


 

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de 
geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te 
nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit 
e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. 
Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige 
overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij 
overgebrachte virussen.

APG Algemene Pensioen Groep NV is gevestigd te Heerlen en is ingeschreven in het 
handelsregister van de Kamer van Koophandel Limburg onder nummer 14099617


The information contained in this e-mail is confidential and may be privileged. 
It may be read, copied and used only by the intended recipient. 
If you have received it in error, please contact the sender immediately by 
return e-mail; please delete in this case the e-mail and do not disclose it's 
contents to any person. We don't accept liability for any errors, omissions, 
delays of receipt or viruses in the contents of this message which arise as a 
result of e-mail transmission.

APG Algemene Pensioen Groep NV is registered in the trade register of the Chamber 
of Commerce Limburg, The Netherlands, registration number: 14099617


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

Archive generated by hypermail 2.2.0.