Wrong syntax of 16-bit value in zeropage #1

Open
opened 2025-03-28 12:18:46 +01:00 by hugova · 0 comments
Member

Throught the code a value in zeropage are stored like this x =$4041 where we have always used >x = $40 as the low nibble and the <x = 41 as the high nibble. The problem is 2-folded. One is that this is not per the cc65 documentation, the > operator should signal the high nibble and vice versa. The other problem is that to store $4000 to x its needed to do this:
LDA #<$4000
STA >X
LDA #>$4000
STA <X

Yes its ugly and should look like this

LDA #<$4000
STA <X
LDA #>$4000
STA >X

Throught the code a value in zeropage are stored like this x =$4041 where we have always used >x = $40 as the low nibble and the <x = 41 as the high nibble. The problem is 2-folded. One is that this is not per the cc65 documentation, the > operator should signal the high nibble and vice versa. The other problem is that to store $4000 to x its needed to do this: LDA #<$4000 STA >X LDA #>$4000 STA <X Yes its ugly and should look like this LDA #<$4000 STA <X LDA #>$4000 STA >X
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Stacken/c64-livecoding#1
No description provided.