Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If A = B and B = C, then A = C, except where void or prohibited by law. -- Roy Santoro


devel / comp.emulators.apple2 / Re: 6502 ROL Bug In AppleWin?

SubjectAuthor
* 6502 ROL Bug In AppleWin?John Public
+- Re: 6502 ROL Bug In AppleWin?I am Rob
`* Re: 6502 ROL Bug In AppleWin?I am Rob
 `- Re: 6502 ROL Bug In AppleWin?John Public

1
6502 ROL Bug In AppleWin?

<c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=219&group=comp.emulators.apple2#219

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:ad4:5965:0:b0:440:fee0:bef2 with SMTP id eq5-20020ad45965000000b00440fee0bef2mr28867698qvb.68.1649703254821;
Mon, 11 Apr 2022 11:54:14 -0700 (PDT)
X-Received: by 2002:a05:6214:c42:b0:444:3e15:67da with SMTP id
r2-20020a0562140c4200b004443e1567damr607726qvj.98.1649703254595; Mon, 11 Apr
2022 11:54:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Mon, 11 Apr 2022 11:54:14 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=76.121.88.144; posting-account=kYDfNQoAAACXd0UF3Whu3EsoLtXeizJV
NNTP-Posting-Host: 76.121.88.144
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>
Subject: 6502 ROL Bug In AppleWin?
From: deeplysh...@gmail.com (John Public)
Injection-Date: Mon, 11 Apr 2022 18:54:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 47
 by: John Public - Mon, 11 Apr 2022 18:54 UTC

Not sure but I think I found a bug.
Look at this table then at the 6502 and the results

0 00 0000
1 01 0001
2 02 0010
3 03 0011
4 04 0100
5 05 0101
6 06 0110
7 07 0111
8 08 1000
9 09 1001
10 0A 1010
11 0B 1011
12 0C 1100
13 0D 1101
14 0E 1110
15 0F 1111

19 ROL become 32
32 XOR 58 = 6A
6A ROL become D4
D4 XOR 79 = AD
AD ROL SHOULD BE 5B but it's 5A

Is this a bug in the CPU itself or AppleWin?

If I take AD
10101101

rotate left

01011011 = 5B

The debugger shows 5A in the accumulator with the
carry flag being set?

32 EOR 58

Re: 6502 ROL Bug In AppleWin?

<2a2b2ec2-bce0-4ff9-8395-b098b66c2439n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=220&group=comp.emulators.apple2#220

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:620a:45aa:b0:680:9ec6:ed42 with SMTP id bp42-20020a05620a45aa00b006809ec6ed42mr865733qkb.179.1649708896272;
Mon, 11 Apr 2022 13:28:16 -0700 (PDT)
X-Received: by 2002:a05:620a:1aa9:b0:69b:fe82:a22a with SMTP id
bl41-20020a05620a1aa900b0069bfe82a22amr831448qkb.687.1649708896145; Mon, 11
Apr 2022 13:28:16 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!usenet-fr.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Mon, 11 Apr 2022 13:28:16 -0700 (PDT)
In-Reply-To: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=207.195.86.254; posting-account=U4TNXwoAAABP4nIJHynAJZ69O_f3LY2g
NNTP-Posting-Host: 207.195.86.254
References: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a2b2ec2-bce0-4ff9-8395-b098b66c2439n@googlegroups.com>
Subject: Re: 6502 ROL Bug In AppleWin?
From: gids...@sasktel.net (I am Rob)
Injection-Date: Mon, 11 Apr 2022 20:28:16 +0000
Content-Type: text/plain; charset="UTF-8"
 by: I am Rob - Mon, 11 Apr 2022 20:28 UTC

On Monday, April 11, 2022 at 12:54:15 PM UTC-6, John Public wrote:
> Not sure but I think I found a bug.
> Look at this table then at the 6502 and the results
>
> 0 00 0000
> 1 01 0001
> 2 02 0010
> 3 03 0011
> 4 04 0100
> 5 05 0101
> 6 06 0110
> 7 07 0111
> 8 08 1000
> 9 09 1001
> 10 0A 1010
> 11 0B 1011
> 12 0C 1100
> 13 0D 1101
> 14 0E 1110
> 15 0F 1111
>
>
> 19 ROL become 32
> 32 XOR 58 = 6A
> 6A ROL become D4
> D4 XOR 79 = AD
> AD ROL SHOULD BE 5B but it's 5A
>
> Is this a bug in the CPU itself or AppleWin?
>
> If I take AD
> 10101101
>
> rotate left
>
> 01011011 = 5B
>
> The debugger shows 5A in the accumulator with the
> carry flag being set?

I think your logic might be incorrect.
When you rotate 6A to become D4, the hi-bit of 6A is clear, which rotates into the carry.
The XOR with 79 does not affect the carry so the carry is still clear.
Lastly when AD is rotated, the hi-bit is set and goes into the carry and and the carry (which was preiously clear) goes into the lo-bit, so the result is 5A, which is correct and the carry should now be set.

Re: 6502 ROL Bug In AppleWin?

<c38a4f82-de8c-4938-8c98-629c0e3069can@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=221&group=comp.emulators.apple2#221

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:6214:1643:b0:42c:2865:d1e7 with SMTP id f3-20020a056214164300b0042c2865d1e7mr28882604qvw.52.1649708965301;
Mon, 11 Apr 2022 13:29:25 -0700 (PDT)
X-Received: by 2002:ac8:1e85:0:b0:2ed:8ae:cfc2 with SMTP id
c5-20020ac81e85000000b002ed08aecfc2mr905709qtm.81.1649708965184; Mon, 11 Apr
2022 13:29:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Mon, 11 Apr 2022 13:29:25 -0700 (PDT)
In-Reply-To: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=207.195.86.254; posting-account=U4TNXwoAAABP4nIJHynAJZ69O_f3LY2g
NNTP-Posting-Host: 207.195.86.254
References: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c38a4f82-de8c-4938-8c98-629c0e3069can@googlegroups.com>
Subject: Re: 6502 ROL Bug In AppleWin?
From: gids...@sasktel.net (I am Rob)
Injection-Date: Mon, 11 Apr 2022 20:29:25 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 43
 by: I am Rob - Mon, 11 Apr 2022 20:29 UTC

On Monday, April 11, 2022 at 12:54:15 PM UTC-6, John Public wrote:
> Not sure but I think I found a bug.
> Look at this table then at the 6502 and the results
>
> 0 00 0000
> 1 01 0001
> 2 02 0010
> 3 03 0011
> 4 04 0100
> 5 05 0101
> 6 06 0110
> 7 07 0111
> 8 08 1000
> 9 09 1001
> 10 0A 1010
> 11 0B 1011
> 12 0C 1100
> 13 0D 1101
> 14 0E 1110
> 15 0F 1111
>
>
> 19 ROL become 32
> 32 XOR 58 = 6A
> 6A ROL become D4
> D4 XOR 79 = AD
> AD ROL SHOULD BE 5B but it's 5A
>
> Is this a bug in the CPU itself or AppleWin?
>
> If I take AD
> 10101101
>
> rotate left
>
> 01011011 = 5B
>
> The debugger shows 5A in the accumulator with the
> carry flag being set?

think your logic might be incorrect.
When you rotate 6A to become D4, the hi-bit of 6A is clear, which rotates into the carry.
The XOR with 79 does not affect the carry so the carry is still clear.
Lastly when AD is rotated, the hi-bit is set and goes into the carry and and the carry (which was previously clear) goes into the lo-bit, so the result is 5A, which is correct and the carry should now be set.

Re: 6502 ROL Bug In AppleWin?

<280973d4-2c97-4e1c-be31-dc7506be80a6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=222&group=comp.emulators.apple2#222

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a37:41d6:0:b0:67e:4494:c5e9 with SMTP id o205-20020a3741d6000000b0067e4494c5e9mr1176050qka.605.1649716761045;
Mon, 11 Apr 2022 15:39:21 -0700 (PDT)
X-Received: by 2002:a05:622a:134d:b0:2eb:8429:a420 with SMTP id
w13-20020a05622a134d00b002eb8429a420mr1287650qtk.654.1649716760793; Mon, 11
Apr 2022 15:39:20 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Mon, 11 Apr 2022 15:39:20 -0700 (PDT)
In-Reply-To: <c38a4f82-de8c-4938-8c98-629c0e3069can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=76.121.88.144; posting-account=kYDfNQoAAACXd0UF3Whu3EsoLtXeizJV
NNTP-Posting-Host: 76.121.88.144
References: <c2336a33-8706-4fdf-af6a-93f2f704c500n@googlegroups.com> <c38a4f82-de8c-4938-8c98-629c0e3069can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <280973d4-2c97-4e1c-be31-dc7506be80a6n@googlegroups.com>
Subject: Re: 6502 ROL Bug In AppleWin?
From: deeplysh...@gmail.com (John Public)
Injection-Date: Mon, 11 Apr 2022 22:39:21 +0000
Content-Type: text/plain; charset="UTF-8"
 by: John Public - Mon, 11 Apr 2022 22:39 UTC

Thank you Rob.
I saw the difference as Windows Calculator was showing 5B.
Your explanation makes perfect sense.
I think my logic was OK based on the information I had at hand.
I'd like to find a VB or C# function to show this process.
Learned something ne. Thank you again.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor