Ask anything your want about Megadrive/Genesis programming.
Moderator: BigEvilCorporation
-
Dr. MefistO
- Interested
- Posts: 47
- Joined: Wed Jan 08, 2014 3:39 pm
Post
by Dr. MefistO » Thu Mar 03, 2016 1:39 pm
a2 = 0x00FF0000
d1 = 0x4000F801
a3 => 0x00FEF800
How is it possible?
If it is possible, then this comparing will be true? (a4 =
0x00FFF800)
-
Stef
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
-
Contact:
Post
by Stef » Thu Mar 03, 2016 2:08 pm
For address calculation you used d1.w so only word part (lower 16 bits) of D1 register, in which case it consider signed 16 bits indexing.
So internally D1 is *signed* extended to 32 bits before being added to A2, that explains the result.