Jump to content
IGNORED

is there a bug with ADC $mem,x over a 16K boundary?!?


Marius

Recommended Posts

I'm totally confused.

 

I was testing some things and I really couldn't get the answer, why the things I wanted did not work out. So I made this little piece of code to test things out, and I was really SURPRISED. Read on please:

 

(This is SynAssembler Syntax)

00010		   .LI OFF
00020 TEMP0	 .EQ $0600
00030 TEMP1	 .EQ $0601
00060		   .OR $4000
00070		  LDA #$00
00080		  LDX #$03 ; there were more TEMPS in my previous code
00090 LUS	  STA TEMP0,X
00100		  DEX
00110		  BPL LUS
00120		  LDX #$10
00130		  LDA #$00
00135		  CLC
00140 LUS2	 ADC $BFF0,X ; ok $BFF0 + $10 should be $C000 right?
00150		  INX
00160		  BNE LUS2
00170		  STA TEMP0
00180		  LDX #$00
00190		  LDA #$00
00200		  CLC
00210 LUS3	 ADC $C000,X
00220		  INX
00230		  CPX #$F0
00240		  BNE LUS3
00250		  STA TEMP1
00260		  RTS

After running this:
TEMP0 = $9B
TEMP1 = $43

 

The use of the code is not interesting or part of the discussion. I simply do not understand why the result of TEMP0 = $9B and the result of TEMP1 = $43 while both should have been equal.

 

Anyone?

 

Thanks a lot

PW

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...