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

Re: 5.25" PROM MisMatch Between II+ & IIgs



Bryan Parkoff writes ...
> 
 ....

> You will need to compare
> BIT on both Apple II+ and Apple IIgs.  Look at my code below.
> 
> 2000: JSR FC58
> 2003: LDX #03
> 2005: STX 3C
> 2007: LDX #06
> 2009: BIT 3C
> 200B: BEQ 2012
> 200D: LDY #C1
> 200F: STY 0400
> 2012: LDY #C2
> 2014: STY 0401
> 2017: RTS
> 
>     Hex 03 shows 011 and Hex 06 shows 110.  Bit's Hex 02 shows 010.  This
> answer is correct because second bit shows 1.  BIT should tell BEQ not to
> branch because it is nonzero bit.  On Apple II+, it reports "AB", but on
> Apple IIgs, it reports "B".  Apple II+ is to be correct.  Apple IIgs should
> not execute BEQ.  Please compare my code above on your real Apple II+ and
> Apple IIgs.  You will notice the difference.
>     It may prove that Apple IIgs gives the wrong value.
> 
 ....

     Tried your experiment code on a II+ and a IIgs.

     On the IIgs, I got to the Applesoft prompt via BASIC.SYSTEM and did a
CALL-151 to get to a 40-col display for entering code and running it. So, it
was as close to the II+ display as possible.

     Using the code you list, the Accumulator will contain $00 (after the Clear
Screen JSR to $FC58). Checked this by adding an 85 FF at the end before doing
the RTS. After running the code, $00FF contains $00 on the II+ and on the IIgs.

     On both the II+ and the IIgs, running the code results in just "B" being
displayed near the top of the screen. That makes sense. BIT 3C would do ...
$00 AND $03. No bits would match and the Z flag would be 1. BEQ (Branch if Z=1)
would branch and the "A" would not be displayed.


     Probably, you meant the code at $2007 to be a LDA #06. So, I changed the
code at $2007 to A9 06 and ran the routine on the II+ and the IIgs. As you say,
the II+ shows "AB" near the top of the screen and the IIgs shows just "B".

     Since BIT 3C is doing $06 AND $03 there is a match (at bit 1) and the Z
flag should be 0. The BEQ branch should not be taken. So, both "A" and "B"
should be written to the screen.

     It _looks_ like the II+ gets it right and the IIgs doesn't. However, that
is an illusion which results from a difference in the displays. The IIgs
overwrites the contents of $0400 with the prompt character and the II+ doesn't.

     If you write the "A" ($C1) to $0402 instead of $400, it will show up fine
on the IIgs display.

     So, there does not seem to be anything wrong with the way the IIgs handles
BIT.


Rubywand