int size for C compilers for the 65816

Let's talk about anything related to the 6502 microprocessor.
tmr4
Posts: 147
Joined: 19 Feb 2022

Re: int size for C compilers for the 65816

Post by tmr4 »

litwr wrote:
Let's work with an example

Code: Select all

zpptr1  byte 1,2,3
zpptr2  byte 4,5,6
We can use these pointers, for instance in instruction LDA [zpptr1]. I need to write exactly 3 bytes (not 4!) if I want to change the value of pointer zpptr1. I also hardly call the normal 65816 access to a 3-byte value as trimming.
Normally you'd use 32-bit pointers with the 4th byte unused.

Code: Select all

zpptr1  byte 1,2,3,4
zpptr2  byte 5,6,7,8
To change the pointers, you have two 16-bit writes with 16-bit registers. And you only need a single 16-bit write when the bank byte isn't changing.
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: int size for C compilers for the 65816

Post by BigDumbDinosaur »

tmr4 wrote:
litwr wrote:
Let's work with an example

Code: Select all

zpptr1  byte 1,2,3
zpptr2  byte 4,5,6
We can use these pointers, for instance in instruction LDA [zpptr1]. I need to write exactly 3 bytes (not 4!) if I want to change the value of pointer zpptr1. I also hardly call the normal 65816 access to a 3-byte value as trimming.
Normally you'd use 32-bit pointers with the 4th byte unused.

Code: Select all

zpptr1  byte 1,2,3,4
zpptr2  byte 5,6,7,8
To change the pointers, you have two 16-bit writes with 16-bit registers. And you only need a single 16-bit write when the bank byte isn't changing.

You’re repeating what Alarm Siren and I had already posted. The OP has himself convinced with this 24-bit stuff.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
tmr4
Posts: 147
Joined: 19 Feb 2022

Re: int size for C compilers for the 65816

Post by tmr4 »

BigDumbDinosaur wrote:
You’re repeating what Alarm Siren and I had already posted.
Yup. I thought using the OP's own example might help get the point across.
Post Reply