6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed May 08, 2024 3:58 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed May 18, 2022 12:37 am 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
I have reserved a 16-bit variable with .res on the zeropage in ca65, but incrementing it sometimes causes damaging side effects to the rest of my program. I suspect that the memory location it is allocated at is serving double duty. Is there an exhaustive list of all 65816 instructions that modify the ZP anywhere?


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 3:17 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Since you are using a 65816 anyways, maybe consider using a direct-page.

But for a quick reference:

zero page unused memory

FREE - $6.9 $17.19 $1E $86.88 $8B $8D.8E $90 $AE $CE.CF $D5 $D7 $D9 $E3 $EB.EF $FA.FE

Monitor calls use (so user should never use this memory) - $20.4F

Applesoft - $0D.14, $10.16, $4E.4F, $67.84, $B1.CD, $D6, $D8.DE, $F1.F8
Integer Basic - $0D, $4A.DF, FE.FF

Text screen - $20.25, $28.29, $32.33, $F1, $F3
Lores graphics - $28.29, $2C, $30
Hires graphics - $1A.1D, $26.27, $E0.EA, $F9

Prodos - $40.4E
Dos 3.3 - $18.19, $26.2F, 33.46


Basically then, you can consider memory free if you are not using that capability. For instance, I use $E0.EF quite a bit if my program uses the text screen and not the graphics screens.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 7:47 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Presumably you guys are talking about a specific system here, not the 65816 in general? It would be good to be clear about that.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 1:32 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
Quote:
an exhaustive list of all 65816 instructions that modify the ZP

You mean something like this? (I've omitted various instructions that push to stack, but these too could potentially modify "zero page" (ie, Direct Page).

STA STY STX
ROL ROR ASL LSR INC DEC
STZ TSB TRB

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 2:10 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8176
Location: Midwestern USA
IamRob wrote:
Since you are using a 65816 anyways, maybe consider using a direct-page.

But for a quick reference:

zero page unused memory

FREE - $6.9 $17.19 $1E $86.88 $8B $8D.8E $90 $AE $CE.CF $D5 $D7 $D9 $E3 $EB.EF $FA.FE

Monitor calls use (so user should never use this memory) - $20.4F

Applesoft - $0D.14, $10.16, $4E.4F, $67.84, $B1.CD, $D6, $D8.DE, $F1.F8
Integer Basic - $0D, $4A.DF, FE.FF

Text screen - $20.25, $28.29, $32.33, $F1, $F3
Lores graphics - $28.29, $2C, $30
Hires graphics - $1A.1D, $26.27, $E0.EA, $F9

Prodos - $40.4E
Dos 3.3 - $18.19, $26.2F, 33.46


Basically then, you can consider memory free if you are not using that capability. For instance, I use $E0.EF quite a bit if my program uses the text screen and not the graphics screens.

I'm not sure I am following the above. The OP didn't mention the system type.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 6:03 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
gfoot wrote:
Presumably you guys are talking about a specific system here, not the 65816 in general? It would be good to be clear about that.


It's a Super Nintendo. Thank for the replies; together with viewtopic.php?f=2&t=7130 I'm making progress on this bug.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 8:23 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8176
Location: Midwestern USA
jeffythedragonslayer wrote:
gfoot wrote:
Presumably you guys are talking about a specific system here, not the 65816 in general? It would be good to be clear about that.

It's a Super Nintendo. Thank for the replies; together with viewtopic.php?f=2&t=7130 I'm making progress on this bug.

In the future, it would be a good idea to mention the target system in your first post.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 11:43 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
BigDumbDinosaur wrote:

In the future, it would be a good idea to mention the target system in your first post.


I thought limiting the conversation to only one particular 65816 system would make the thread less useful.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 19, 2022 4:35 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
BigDumbDinosaur wrote:
IamRob wrote:
Basically then, you can consider memory free if you are not using that capability. For instance, I use $E0.EF quite a bit if my program uses the text screen and not the graphics screens.

I'm not sure I am following the above. The OP didn't mention the system type.

My fault. Had the IIGS tab beside this one and had it in my head when talking about the 65816, it was on the IIGS forum.


Top
 Profile  
Reply with quote  
PostPosted: Thu May 19, 2022 5:54 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8176
Location: Midwestern USA
jeffythedragonslayer wrote:
I thought limiting the conversation to only one particular 65816 system would make the thread less useful.

You’re right, it would be limiting. However, when I saw the ][GS stuff I thought that was what you are working with.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: