Jump to content

Photo

Possible bug in handy/handybug (0.95)


9 replies to this topic

#1 42bs OFFLINE  

42bs

    Moonsweeper

  • 326 posts
  • Location:Germany/Southest West

Posted Wed Nov 28, 2018 11:13 AM

There seems to be a bug related Z bit evaluation.

 

I have this code

    lda y2
    sbc y1
    sta MATHE_B
    stz MATHE_B+1
    beq .1
      inc
.1:

If the sbc results in zero the branch is not taken.

If I move the "stz MATHE_B+1", the branch is taken.



#2 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Thu Nov 29, 2018 6:14 AM

dont get it yet:

 

what is the problem: stz is setting the Z bit or its resetting it?

what is the problem: sta is setting the Z bit or its resetting it?


Edited by sage, Thu Nov 29, 2018 6:16 AM.


#3 42bs OFFLINE  

42bs

    Moonsweeper

  • Topic Starter
  • 326 posts
  • Location:Germany/Southest West

Posted Thu Nov 29, 2018 6:39 AM

"stz" does not modify the Z bit => correct handled.

But after "stz" the "beq" is not emultated correctly, as if the Z bit was negated.

 

But I have'nt yet made a real test case.

 

Edit: *hmpf* I cannot reproduce the issue :( (or better :-), since we do not want a bug in handy)


Edited by 42bs, Thu Nov 29, 2018 7:33 AM.


#4 enthusi OFFLINE  

enthusi

    Dragonstomper

  • 540 posts
  • Location:Potsdam, Germany

Posted Thu Nov 29, 2018 7:40 AM

STZ seems to reset the Z flag (and not set it, which is correct at least) in your example.

However, I do not see it in my version Handy GCC/SDL Portable Atari Lynx Emulator v0.5
Based upon Handy 0.95 WIN32 by Keith Wilkins.

This works as expected, also with other addresses for STZ.

    lda #0
    stz $fc61
    beq cont
    rti
cont


#5 42bs OFFLINE  

42bs

    Moonsweeper

  • Topic Starter
  • 326 posts
  • Location:Germany/Southest West

Posted Thu Nov 29, 2018 7:47 AM

Yepp, "stz" should not alter any flags.

I tried again the code which made me think it is a bug. But now it works correctly?!



#6 enthusi OFFLINE  

enthusi

    Dragonstomper

  • 540 posts
  • Location:Potsdam, Germany

Posted Thu Nov 29, 2018 8:38 AM

None of us is getting any younger ;-)



#7 42bs OFFLINE  

42bs

    Moonsweeper

  • Topic Starter
  • 326 posts
  • Location:Germany/Southest West

Posted Thu Nov 29, 2018 8:51 AM

None of us is getting any younger ;-)

 

And still 20 years to work 'till retirement ...



#8 sage OFFLINE  

sage

    Stargunner

  • 1,007 posts
  • Location:Germany

Posted Thu Nov 29, 2018 10:04 AM

... unless they increased the retirement age ...



#9 karri OFFLINE  

karri

    River Patroller

  • 2,693 posts
  • Location:Espoo, Finland

Posted Thu Nov 29, 2018 11:40 AM

... as they did here ...



#10 bhall408 OFFLINE  

bhall408

    Star Raider

  • 92 posts
  • Location:California

Posted Sat Feb 16, 2019 4:55 PM

So did this end up getting considered a reproducible bug? Sounds like no...

 

However I have noticed an odd rendering bug with Robotron in some emulators based on the original/sourceforge version of Handy...

 

 

I'll start another topic for that.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users