Users browsing this thread: 1 Guest(s)
Expansion of Treasure Chest subroutine

#8
Posts: 48
Threads: 7
Thanks Received: 0
Thanks Given: 0
Joined: Dec 2017
Reputation: 0
Status
None
Thanks!

I made the modifications. However, with

ASL $22
ROL $24
(And also removing the BCS INC_HIGH_BYTE1 operation)

It didn't work. The result was way too low. So I thought that perhaps ROL was 8-bit some how, even though the M flag is 0 (16-bit mode). So, I did

ASL $22
ROL $25
ROL $24

And the result was way too high. However,

ASL $22
ROL $25

Works perfectly! And I don't understand why. Sad

I did try first this approach (well, when I learnt eventually about the ROL opcode Tongue ) and because of this weird behavior, I took another route that I knew would work until I understood it better. I concluded that if some operations directly on the data were somehow always 8-bit, I would prefer to put the values in the A, X or Y registers first and put the results back.
  Find
Quote  



Messages In This Thread
RE: Expansion of Treasure Chest subroutine - by NPCnextdoor - 07-15-2018, 07:56 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite